mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
AK+Everywhere: Remove ifdefs for WASM and Emscripten
Building the Ladybird code for Emscripten doesn't really make sense and I doubt it is even possible with all the dependencies now.
This commit is contained in:
parent
3166dabcd6
commit
17d3b881d3
Notes:
github-actions[bot]
2025-11-07 10:30:12 +00:00
Author: https://github.com/cqundefine
Commit: 17d3b881d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6631
Reviewed-by: https://github.com/gmta ✅
6 changed files with 7 additions and 25 deletions
|
|
@ -56,12 +56,6 @@
|
||||||
# define AK_IS_ARCH_PPC() 0
|
# define AK_IS_ARCH_PPC() 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __wasm32__
|
|
||||||
# define AK_IS_ARCH_WASM32() 1
|
|
||||||
#else
|
|
||||||
# define AK_IS_ARCH_WASM32() 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) || defined(_WIN64)
|
#if (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) || defined(_WIN64)
|
||||||
# define AK_ARCH_64_BIT
|
# define AK_ARCH_64_BIT
|
||||||
#else
|
#else
|
||||||
|
|
@ -156,10 +150,6 @@
|
||||||
# define AK_OS_ANDROID
|
# define AK_OS_ANDROID
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__EMSCRIPTEN__)
|
|
||||||
# define AK_OS_EMSCRIPTEN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ARCH(arch) (AK_IS_ARCH_##arch())
|
#define ARCH(arch) (AK_IS_ARCH_##arch())
|
||||||
|
|
||||||
#if ARCH(X86_64) || ARCH(I386)
|
#if ARCH(X86_64) || ARCH(I386)
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,14 @@ else()
|
||||||
TCPServer.cpp)
|
TCPServer.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32 AND NOT EMSCRIPTEN)
|
if (NOT WIN32)
|
||||||
list(APPEND SOURCES LocalServer.cpp)
|
list(APPEND SOURCES LocalServer.cpp)
|
||||||
elseif (WIN32)
|
else()
|
||||||
list(APPEND SOURCES LocalServerWindows.cpp)
|
list(APPEND SOURCES LocalServerWindows.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# FIXME: Implement these for other systems.
|
# FIXME: Implement these for other systems.
|
||||||
if (LINUX AND NOT EMSCRIPTEN)
|
if (LINUX)
|
||||||
list(APPEND SOURCES
|
list(APPEND SOURCES
|
||||||
FileWatcherLinux.cpp
|
FileWatcherLinux.cpp
|
||||||
Platform/ProcessStatisticsLinux.cpp
|
Platform/ProcessStatisticsLinux.cpp
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ ErrorOr<int> anon_create([[maybe_unused]] size_t size, [[maybe_unused]] int opti
|
||||||
TRY(close(fd));
|
TRY(close(fd));
|
||||||
return Error::from_errno(saved_errno);
|
return Error::from_errno(saved_errno);
|
||||||
}
|
}
|
||||||
#elif defined(AK_OS_BSD_GENERIC) || defined(AK_OS_EMSCRIPTEN) || defined(AK_OS_HAIKU)
|
#elif defined(AK_OS_BSD_GENERIC) || defined(AK_OS_HAIKU)
|
||||||
static size_t shared_memory_id = 0;
|
static size_t shared_memory_id = 0;
|
||||||
|
|
||||||
auto name = ByteString::formatted("/shm-{}-{}", getpid(), shared_memory_id++);
|
auto name = ByteString::formatted("/shm-{}-{}", getpid(), shared_memory_id++);
|
||||||
|
|
@ -807,8 +807,6 @@ ErrorOr<ByteString> current_executable_path()
|
||||||
if (sizeof(info.name) > sizeof(path))
|
if (sizeof(info.name) > sizeof(path))
|
||||||
return Error::from_errno(ENAMETOOLONG);
|
return Error::from_errno(ENAMETOOLONG);
|
||||||
strlcpy(path, info.name, sizeof(path) - 1);
|
strlcpy(path, info.name, sizeof(path) - 1);
|
||||||
#elif defined(AK_OS_EMSCRIPTEN)
|
|
||||||
return Error::from_string_literal("current_executable_path() unknown on this platform");
|
|
||||||
#else
|
#else
|
||||||
# warning "Not sure how to get current_executable_path on this platform!"
|
# warning "Not sure how to get current_executable_path on this platform!"
|
||||||
// GetModuleFileName on Windows, unsure about OpenBSD.
|
// GetModuleFileName on Windows, unsure about OpenBSD.
|
||||||
|
|
|
||||||
|
|
@ -82,12 +82,6 @@ include(lagom_compile_options)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (EMSCRIPTEN)
|
|
||||||
set(CMAKE_EXECUTABLE_SUFFIX ".js")
|
|
||||||
add_cxx_compile_options(-gsource-map)
|
|
||||||
add_cxx_link_options(--emrun "SHELL:-s ALLOW_MEMORY_GROWTH")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ENABLE_COMPILETIME_FORMAT_CHECK)
|
if (ENABLE_COMPILETIME_FORMAT_CHECK)
|
||||||
add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK)
|
add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ASSERT_FAIL_HAS_INT OR EMSCRIPTEN)
|
if (ASSERT_FAIL_HAS_INT)
|
||||||
target_compile_definitions(test262-runner PRIVATE ASSERT_FAIL_HAS_INT)
|
target_compile_definitions(test262-runner PRIVATE ASSERT_FAIL_HAS_INT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN) && !defined(AK_OS_GNU_HURD)
|
#if !defined(AK_OS_MACOS) && !defined(AK_OS_GNU_HURD)
|
||||||
// Only used to disable core dumps
|
// Only used to disable core dumps
|
||||||
# include <sys/prctl.h>
|
# include <sys/prctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -589,7 +589,7 @@ int main(int argc, char** argv)
|
||||||
#ifdef AK_OS_GNU_HURD
|
#ifdef AK_OS_GNU_HURD
|
||||||
if (disable_core_dumping)
|
if (disable_core_dumping)
|
||||||
setenv("CRASHSERVER", "/servers/crash-kill", true);
|
setenv("CRASHSERVER", "/servers/crash-kill", true);
|
||||||
#elif !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN)
|
#elif !defined(AK_OS_MACOS)
|
||||||
if (disable_core_dumping && prctl(PR_SET_DUMPABLE, 0, 0, 0) < 0) {
|
if (disable_core_dumping && prctl(PR_SET_DUMPABLE, 0, 0, 0) < 0) {
|
||||||
perror("prctl(PR_SET_DUMPABLE)");
|
perror("prctl(PR_SET_DUMPABLE)");
|
||||||
return exit_wrong_arguments;
|
return exit_wrong_arguments;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue