-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm] Unify BuildWasmRuntimes target and use cmake (#58878)
Add new cmake file to build native parts of `BuildWasmRuntimes` target. That unifies the build on windows and mac/linux. Implements #51553 * [wasm] Add cmake file for runtime native build * Use the new cmake file * Set the emcc configuration flags The ninja generator is not multi-configuration cmake generator, so we have to pass them from msbuild * Update Makefile * Fix few build issues * Copy ICU files to native bin dir * Copy source files to native bin dir * Copy required header file * Make all settings target specific
- Loading branch information
1 parent
7017817
commit 909880b
Showing
3 changed files
with
61 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14.5) | ||
|
||
project(mono-wasm-runtime C) | ||
|
||
add_executable(dotnet corebindings.c driver.c pinvoke.c) | ||
|
||
target_include_directories(dotnet PUBLIC ${MONO_INCLUDES} ${MONO_OBJ_INCLUDES}) | ||
target_compile_options(dotnet PUBLIC @${NATIVE_BIN_DIR}/src/emcc-default.rsp ${CONFIGURATION_EMCC_FLAGS} -DCORE_BINDINGS -DGEN_PINVOKE=1) | ||
target_link_libraries(dotnet | ||
${ICU_LIB_DIR}/libicuuc.a | ||
${ICU_LIB_DIR}/libicui18n.a | ||
${MONO_ARTIFACTS_DIR}/libmono-component-hot_reload-static.a | ||
${MONO_ARTIFACTS_DIR}/libmono-component-debugger-static.a | ||
${MONO_ARTIFACTS_DIR}/libmono-component-diagnostics_tracing-stub-static.a | ||
${MONO_ARTIFACTS_DIR}/libmono-ee-interp.a | ||
${MONO_ARTIFACTS_DIR}/libmonosgen-2.0.a | ||
${MONO_ARTIFACTS_DIR}/libmono-ilgen.a | ||
${MONO_ARTIFACTS_DIR}/libmono-icall-table.a | ||
${NATIVE_BIN_DIR}/libSystem.Native.a | ||
${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a) | ||
|
||
set_target_properties(dotnet PROPERTIES | ||
CMAKE_EXECUTABLE_SUFFIX ".js" | ||
LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp ${CONFIGURATION_EMCC_FLAGS} -DENABLE_NETCORE=1 --js-library ${SOURCE_DIR}/library_mono.js --js-library ${SOURCE_DIR}/binding_support.js --js-library ${SOURCE_DIR}/dotnet_support.js --js-library ${SYSTEM_NATIVE_DIR}/pal_random.js" | ||
RUNTIME_OUTPUT_DIRECTORY "${NATIVE_BIN_DIR}") | ||
|
||
add_custom_command(TARGET dotnet POST_BUILD COMMAND ${EMSDK_PATH}/upstream/bin/wasm-opt --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.wasm -o ${NATIVE_BIN_DIR}/dotnet.wasm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters