Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhill <ph1ll@users.noreply.github.com>2017-10-31 11:18:07 +0300
committerMorgan Brown <morganbr@users.noreply.github.com>2017-10-31 11:18:07 +0300
commit15ce20d82918bb04009a30e3dbcebce85b1dd80e (patch)
tree513539fe0a290019ceb06b04c413a37402d26e10 /src/Native/CMakeLists.txt
parent7d205be9ed4705e6564f13478aeefa913a82137e (diff)
Build native code for WebAssembly target (#4624)
Add support to cmake files for wasm build
Diffstat (limited to 'src/Native/CMakeLists.txt')
-rw-r--r--src/Native/CMakeLists.txt22
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)