diff options
Diffstat (limited to 'src/Native/CMakeLists.txt')
-rw-r--r-- | src/Native/CMakeLists.txt | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Native/CMakeLists.txt b/src/Native/CMakeLists.txt index f654cdd89..5aeb930a5 100644 --- a/src/Native/CMakeLists.txt +++ b/src/Native/CMakeLists.txt @@ -90,7 +90,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL NetBSD) set(CLR_CMAKE_PLATFORM_NETBSD 1) endif(CMAKE_SYSTEM_NAME STREQUAL NetBSD) -if (CLR_CMAKE_PLATFORM_UNIX) +if(CMAKE_SYSTEM_NAME STREQUAL Emscripten) + set(CLR_CMAKE_PLATFORM_WASM 1) +endif(CMAKE_SYSTEM_NAME STREQUAL Emscripten) + +if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_PLATFORM_WASM) include_directories(inc/unix) add_definitions(-DPLATFORM_UNIX=1) @@ -133,7 +137,7 @@ if (CLR_CMAKE_PLATFORM_UNIX) if(CLR_CMAKE_PLATFORM_LINUX) set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack") endif(CLR_CMAKE_PLATFORM_LINUX) -endif(CLR_CMAKE_PLATFORM_UNIX) +endif(CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_PLATFORM_WASM) if(CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM) set(CLR_CMAKE_PLATFORM_ARCH_ARM 1) @@ -143,6 +147,8 @@ elseif(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64) set(CLR_CMAKE_PLATFORM_ARCH_AMD64 1) elseif(CLR_CMAKE_PLATFORM_UNIX_TARGET_I386) set(CLR_CMAKE_PLATFORM_ARCH_I386 1) +elseif(CLR_CMAKE_PLATFORM_WASM) + set(CLR_CMAKE_PLATFORM_ARCH_WASM 1) elseif(WIN32) if (CLR_CMAKE_TARGET_ARCH STREQUAL x64) set(CLR_CMAKE_PLATFORM_ARCH_AMD64 1) @@ -195,6 +201,9 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM) elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64) add_definitions(-D_TARGET_ARM64_=1) add_definitions(-D_ARM64_) +elseif(CLR_CMAKE_PLATFORM_ARCH_WASM) + add_definitions(-D_TARGET_WASM_=1) + add_definitions(-D_WASM_) else() clr_unknown_arch() endif() @@ -246,9 +255,12 @@ if(WIN32) endif() add_subdirectory(Runtime) add_subdirectory(Bootstrap) -add_subdirectory(jitinterface) + +if(NOT CLR_CMAKE_PLATFORM_WASM) + add_subdirectory(jitinterface) +endif(NOT CLR_CMAKE_PLATFORM_WASM) # We don't need the PAL on Windows. -if(CLR_CMAKE_PLATFORM_UNIX) +if(NOT WIN32) add_subdirectory(System.Private.CoreLib.Native) -endif() +endif(NOT WIN32) |