Skip to content

Commit 17d3b88

Browse files
cqundefinegmta
authored andcommitted
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.
1 parent 3166dab commit 17d3b88

File tree

6 files changed

+7
-25
lines changed

6 files changed

+7
-25
lines changed

AK/Platform.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@
5656
# define AK_IS_ARCH_PPC() 0
5757
#endif
5858

59-
#ifdef __wasm32__
60-
# define AK_IS_ARCH_WASM32() 1
61-
#else
62-
# define AK_IS_ARCH_WASM32() 0
63-
#endif
64-
6559
#if (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) || defined(_WIN64)
6660
# define AK_ARCH_64_BIT
6761
#else
@@ -156,10 +150,6 @@
156150
# define AK_OS_ANDROID
157151
#endif
158152

159-
#if defined(__EMSCRIPTEN__)
160-
# define AK_OS_EMSCRIPTEN
161-
#endif
162-
163153
#define ARCH(arch) (AK_IS_ARCH_##arch())
164154

165155
#if ARCH(X86_64) || ARCH(I386)

Libraries/LibCore/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ else()
7171
TCPServer.cpp)
7272
endif()
7373

74-
if (NOT WIN32 AND NOT EMSCRIPTEN)
74+
if (NOT WIN32)
7575
list(APPEND SOURCES LocalServer.cpp)
76-
elseif (WIN32)
76+
else()
7777
list(APPEND SOURCES LocalServerWindows.cpp)
7878
endif()
7979

8080
# FIXME: Implement these for other systems.
81-
if (LINUX AND NOT EMSCRIPTEN)
81+
if (LINUX)
8282
list(APPEND SOURCES
8383
FileWatcherLinux.cpp
8484
Platform/ProcessStatisticsLinux.cpp

Libraries/LibCore/System.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ErrorOr<int> anon_create([[maybe_unused]] size_t size, [[maybe_unused]] int opti
164164
TRY(close(fd));
165165
return Error::from_errno(saved_errno);
166166
}
167-
#elif defined(AK_OS_BSD_GENERIC) || defined(AK_OS_EMSCRIPTEN) || defined(AK_OS_HAIKU)
167+
#elif defined(AK_OS_BSD_GENERIC) || defined(AK_OS_HAIKU)
168168
static size_t shared_memory_id = 0;
169169

170170
auto name = ByteString::formatted("/shm-{}-{}", getpid(), shared_memory_id++);
@@ -807,8 +807,6 @@ ErrorOr<ByteString> current_executable_path()
807807
if (sizeof(info.name) > sizeof(path))
808808
return Error::from_errno(ENAMETOOLONG);
809809
strlcpy(path, info.name, sizeof(path) - 1);
810-
#elif defined(AK_OS_EMSCRIPTEN)
811-
return Error::from_string_literal("current_executable_path() unknown on this platform");
812810
#else
813811
# warning "Not sure how to get current_executable_path on this platform!"
814812
// GetModuleFileName on Windows, unsure about OpenBSD.

Meta/Lagom/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ include(lagom_compile_options)
8282

8383
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8484

85-
if (EMSCRIPTEN)
86-
set(CMAKE_EXECUTABLE_SUFFIX ".js")
87-
add_cxx_compile_options(-gsource-map)
88-
add_cxx_link_options(--emrun "SHELL:-s ALLOW_MEMORY_GROWTH")
89-
endif()
90-
9185
if (ENABLE_COMPILETIME_FORMAT_CHECK)
9286
add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK)
9387
endif()

Utilities/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
3535
)
3636
endif()
3737

38-
if (ASSERT_FAIL_HAS_INT OR EMSCRIPTEN)
38+
if (ASSERT_FAIL_HAS_INT)
3939
target_compile_definitions(test262-runner PRIVATE ASSERT_FAIL_HAS_INT)
4040
endif()
4141

Utilities/test262-runner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <signal.h>
2525
#include <unistd.h>
2626

27-
#if !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN) && !defined(AK_OS_GNU_HURD)
27+
#if !defined(AK_OS_MACOS) && !defined(AK_OS_GNU_HURD)
2828
// Only used to disable core dumps
2929
# include <sys/prctl.h>
3030
#endif
@@ -589,7 +589,7 @@ int main(int argc, char** argv)
589589
#ifdef AK_OS_GNU_HURD
590590
if (disable_core_dumping)
591591
setenv("CRASHSERVER", "/servers/crash-kill", true);
592-
#elif !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN)
592+
#elif !defined(AK_OS_MACOS)
593593
if (disable_core_dumping && prctl(PR_SET_DUMPABLE, 0, 0, 0) < 0) {
594594
perror("prctl(PR_SET_DUMPABLE)");
595595
return exit_wrong_arguments;

0 commit comments

Comments
 (0)