File tree Expand file tree Collapse file tree 2 files changed +19
-26
lines changed Expand file tree Collapse file tree 2 files changed +19
-26
lines changed Original file line number Diff line number Diff line change 97
97
cmake_extra_defines_wasm=()
98
98
if [[ " $host_arch " == " wasm" ]]; then
99
99
if [[ " $target_os " == " browser" ]]; then
100
+ if [[ -z " $EMSDK_PATH " ]]; then
101
+ if [[ -d " $reporoot " /src/mono/browser/emsdk/ ]]; then
102
+ export EMSDK_PATH=" $reporoot " /src/mono/browser/emsdk/
103
+ else
104
+ echo " Error: You need to set the EMSDK_PATH environment variable pointing to the emscripten SDK root."
105
+ exit 1
106
+ fi
107
+ fi
108
+ export EMSDK_QUIET=1 && source " $EMSDK_PATH " /emsdk_env.sh
100
109
cmake_command=" emcmake $cmake_command "
101
110
elif [[ " $target_os " == " wasi" ]]; then
102
- cmake_extra_defines_wasm=(" -DCLR_CMAKE_TARGET_OS=wasi" " -DCLR_CMAKE_TARGET_ARCH=wasm" " -DWASI_SDK_PREFIX=$WASI_SDK_PATH " " -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH} /share/cmake/wasi-sdk-p2.cmake" " -DCMAKE_SYSROOT=${WASI_SDK_PATH} /share/wasi-sysroot" " -DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1" )
111
+ if [[ -z " $WASI_SDK_PATH " ]]; then
112
+ if [[ -d " $reporoot " /src/mono/wasi/wasi-sdk ]]; then
113
+ export WASI_SDK_PATH=" $reporoot " /src/mono/wasi/wasi-sdk
114
+ else
115
+ echo " Error: You need to set the WASI_SDK_PATH environment variable pointing to the WASI SDK root."
116
+ exit 1
117
+ fi
118
+ fi
119
+ cmake_extra_defines_wasm=(" -DCLR_CMAKE_TARGET_OS=wasi" " -DCLR_CMAKE_TARGET_ARCH=wasm" " -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH} /share/cmake/wasi-sdk-p2.cmake" " -DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1" )
103
120
else
104
121
echo " target_os was not specified"
105
122
exit 1
Original file line number Diff line number Diff line change @@ -53,31 +53,7 @@ __usePThreads=0
53
53
source " $__RepoRootDir " /eng/native/build-commons.sh
54
54
55
55
# Set cross build
56
- if [[ " $__TargetOS " == browser ]]; then
57
- if [[ -z " $EMSDK_PATH " ]]; then
58
- if [[ -d " $__RepoRootDir " /src/mono/browser/emsdk/ ]]; then
59
- export EMSDK_PATH=" $__RepoRootDir " /src/mono/browser/emsdk/
60
- else
61
- echo " Error: You need to set the EMSDK_PATH environment variable pointing to the emscripten SDK root."
62
- exit 1
63
- fi
64
- fi
65
- source " $EMSDK_PATH " /emsdk_env.sh
66
- export CLR_CC=$( which emcc)
67
- elif [[ " $__TargetOS " == wasi ]]; then
68
- if [[ -z " $WASI_SDK_PATH " ]]; then
69
- if [[ -d " $__RepoRootDir " /src/mono/wasi/wasi-sdk ]]; then
70
- export WASI_SDK_PATH=" $__RepoRootDir " /src/mono/wasi/wasi-sdk
71
- else
72
- echo " Error: You need to set the WASI_SDK_PATH environment variable pointing to the WASI SDK root."
73
- exit 1
74
- fi
75
- fi
76
- export WASI_SDK_PATH=" ${WASI_SDK_PATH%/ } /"
77
- export CLR_CC=" $WASI_SDK_PATH " bin/clang
78
- export TARGET_BUILD_ARCH=wasm
79
- __CMakeArgs=" -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm -DWASI_SDK_PREFIX=$WASI_SDK_PATH -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH} /share/cmake/wasi-sdk-p2.cmake $__CMakeArgs "
80
- elif [[ " $__TargetOS " == ios || " $__TargetOS " == iossimulator ]]; then
56
+ if [[ " $__TargetOS " == browser || " $__TargetOS " == wasi || " $__TargetOS " == ios || " $__TargetOS " == iossimulator ]]; then
81
57
# nothing to do here
82
58
true
83
59
elif [[ " $__TargetOS " == tvos || " $__TargetOS " == tvossimulator ]]; then
You can’t perform that action at this time.
0 commit comments