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:
Undefine
2025-08-12 17:00:32 +02:00
committed by Jelle Raaijmakers
parent 3166dabcd6
commit 17d3b881d3
Notes: github-actions[bot] 2025-11-07 10:30:12 +00:00
6 changed files with 7 additions and 25 deletions

View File

@@ -56,12 +56,6 @@
# define AK_IS_ARCH_PPC() 0
#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)
# define AK_ARCH_64_BIT
#else
@@ -156,10 +150,6 @@
# define AK_OS_ANDROID
#endif
#if defined(__EMSCRIPTEN__)
# define AK_OS_EMSCRIPTEN
#endif
#define ARCH(arch) (AK_IS_ARCH_##arch())
#if ARCH(X86_64) || ARCH(I386)

View File

@@ -71,14 +71,14 @@ else()
TCPServer.cpp)
endif()
if (NOT WIN32 AND NOT EMSCRIPTEN)
if (NOT WIN32)
list(APPEND SOURCES LocalServer.cpp)
elseif (WIN32)
else()
list(APPEND SOURCES LocalServerWindows.cpp)
endif()
# FIXME: Implement these for other systems.
if (LINUX AND NOT EMSCRIPTEN)
if (LINUX)
list(APPEND SOURCES
FileWatcherLinux.cpp
Platform/ProcessStatisticsLinux.cpp

View File

@@ -164,7 +164,7 @@ ErrorOr<int> anon_create([[maybe_unused]] size_t size, [[maybe_unused]] int opti
TRY(close(fd));
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;
auto name = ByteString::formatted("/shm-{}-{}", getpid(), shared_memory_id++);
@@ -807,8 +807,6 @@ ErrorOr<ByteString> current_executable_path()
if (sizeof(info.name) > sizeof(path))
return Error::from_errno(ENAMETOOLONG);
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
# warning "Not sure how to get current_executable_path on this platform!"
// GetModuleFileName on Windows, unsure about OpenBSD.

View File

@@ -82,12 +82,6 @@ include(lagom_compile_options)
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)
add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK)
endif()

View File

@@ -35,7 +35,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
)
endif()
if (ASSERT_FAIL_HAS_INT OR EMSCRIPTEN)
if (ASSERT_FAIL_HAS_INT)
target_compile_definitions(test262-runner PRIVATE ASSERT_FAIL_HAS_INT)
endif()

View File

@@ -24,7 +24,7 @@
#include <signal.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
# include <sys/prctl.h>
#endif
@@ -589,7 +589,7 @@ int main(int argc, char** argv)
#ifdef AK_OS_GNU_HURD
if (disable_core_dumping)
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) {
perror("prctl(PR_SET_DUMPABLE)");
return exit_wrong_arguments;