diff options
author | Phill <ph1ll@users.noreply.github.com> | 2017-09-30 06:55:54 +0300 |
---|---|---|
committer | Morgan Brown <morganbr@users.noreply.github.com> | 2017-09-30 06:55:54 +0300 |
commit | da8c27da9644cd658b906cfbd0f6c9997d91c355 (patch) | |
tree | 26934dd2bfed23ebedc01308b0a1c243e886a01d /src/Native | |
parent | d354a5fabb06cfeacb9c4bccc77c67ee15ec144f (diff) |
Add placeholder build option for WebAssembly (#4620)
* Add placeholder build option for WebAssembly
* Add Emscripten build commands
* Use Nmake in place of Make
Diffstat (limited to 'src/Native')
-rwxr-xr-x | src/Native/gen-buildsys-clang.sh | 26 | ||||
-rw-r--r-- | src/Native/gen-buildsys-win.bat | 9 |
2 files changed, 24 insertions, 11 deletions
diff --git a/src/Native/gen-buildsys-clang.sh b/src/Native/gen-buildsys-clang.sh index 393133e95..72e9a0cbb 100755 --- a/src/Native/gen-buildsys-clang.sh +++ b/src/Native/gen-buildsys-clang.sh @@ -113,12 +113,20 @@ if [[ -n "$CROSSCOMPILE" ]]; then cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$1/cross/$build_arch/toolchain.cmake" fi -cmake \ - "-DCMAKE_AR=$llvm_ar" \ - "-DCMAKE_LINKER=$llvm_link" \ - "-DCMAKE_NM=$llvm_nm" \ - "-DCMAKE_OBJDUMP=$llvm_objdump" \ - "-DCMAKE_RANLIB=$llvm_ranlib" \ - "-DCMAKE_BUILD_TYPE=$build_type" \ - $cmake_extra_defines \ - "$1/src/Native" +if [ $build_arch == "wasm" ]; then + emcmake cmake \ + "-DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1" \ + "-DCMAKE_TOOLCHAIN_FILE=$EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake" \ + "-DCMAKE_BUILD_TYPE=$build_type" \ + "$1/src/Native" +else + cmake \ + "-DCMAKE_AR=$llvm_ar" \ + "-DCMAKE_LINKER=$llvm_link" \ + "-DCMAKE_NM=$llvm_nm" \ + "-DCMAKE_OBJDUMP=$llvm_objdump" \ + "-DCMAKE_RANLIB=$llvm_ranlib" \ + "-DCMAKE_BUILD_TYPE=$build_type" \ + $cmake_extra_defines \ + "$1/src/Native" +fi diff --git a/src/Native/gen-buildsys-win.bat b/src/Native/gen-buildsys-win.bat index b7fdcb4fd..91e972134 100644 --- a/src/Native/gen-buildsys-win.bat +++ b/src/Native/gen-buildsys-win.bat @@ -5,7 +5,7 @@ rem This file invokes cmake and generates the build system for windows. set argC=0 for %%x in (%*) do Set /A argC+=1 -if NOT %argC%==3 GOTO :USAGE +if NOT %argC%==4 GOTO :USAGE if %1=="/?" GOTO :USAGE setlocal @@ -26,7 +26,11 @@ if defined CMakePath goto DoGen for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& %~dp0\probe-win.ps1"') do %%a :DoGen -"%CMakePath%" "-DCLR_CMAKE_TARGET_ARCH=%3" -G "Visual Studio %__VSString%" %1 +if "%3" == "wasm" ( + emcmake "%CMakePath%" "-DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1" "-DCMAKE_TOOLCHAIN_FILE=%EMSCRIPTEN%/cmake/Modules/Platform/Emscripten.cmake" "-DCMAKE_BUILD_TYPE=%4" -G "NMake Makefiles" %1 +) else ( + "%CMakePath%" "-DCLR_CMAKE_TARGET_ARCH=%3" -G "Visual Studio %__VSString%" %1 +) endlocal GOTO :DONE @@ -35,6 +39,7 @@ GOTO :DONE echo "gen-buildsys-win.bat <path to top level CMakeLists.txt> <VSVersion>" echo "Specify the path to the top level CMake file - <corert>/src/Native" echo "Specify the VSVersion to be used - VS2013 or VS2015" + echo "Specify the build type (Debug, Release)" EXIT /B 1 :DONE |