Skip to content

Commit aeb17ec

Browse files
committed
samples/wasi-threads: Fix wasm app target
As far as I know, cmake can't handle two different compilers and targets within a project as this sample is trying to do. This commit is a band-aid fix. While CMAKE_C_COMPILER_TARGET here happens to work when both of host compiler and wasm compiler are clang, it doesn't seem working if the host compiler is gcc. (as it is on the CI.)
1 parent efa6d2a commit aeb17ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samples/wasi-threads/wasm-apps/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ endif ()
1414
set (CMAKE_SYSROOT "${WASI_SYSROOT}")
1515
set (CMAKE_C_COMPILER "${WASI_SDK_DIR}/bin/clang")
1616
set (CMAKE_ASM_COMPILER "${WASI_SDK_DIR}/bin/clang")
17-
set (CMAKE_C_COMPILER_TARGET "wasm32-wasi-threads")
17+
set (CMAKE_EXE_LINKER_FLAGS "-target wasm32-wasi-threads")
1818

1919
function (compile_sample SOURCE_FILE)
2020
get_filename_component (FILE_NAME ${SOURCE_FILE} NAME_WLE)

0 commit comments

Comments
 (0)