Skip to content

Commit b05df7a

Browse files
committed
cpython: set the target in the func compilation
1 parent a240269 commit b05df7a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

func/cpp/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ project(faasm-func)
44
set(CMAKE_CXX_STANDARD 17)
55

66
if (CMAKE_SYSTEM_NAME STREQUAL "WASI")
7+
# Set the right target so that we look in the right sysroot
8+
set(CMAKE_C_FLAGS "--target=$ENV{FAASM_WASM_TRIPLE} ${CMAKE_C_FLAGS}")
9+
set(CMAKE_CXX_FLAGS "--target=$ENV{FAASM_WASM_TRIPLE} ${CMAKE_CXX_FLAGS}")
10+
711
# For Faasm functions, we add `_faasm_zygote` as an exported symbol
812
set(CMAKE_EXE_LINKER_FLAGS
913
"${CMAKE_EXE_LINKER_FLAGS} -Xlinker --export=_faasm_zygote"
1014
)
15+
1116
message(STATUS "Detected wasm build (sysroot=$ENV{FAASM_WASM_SYSROOT})")
1217
set(CMAKE_EXECUTABLE_SUFFIX ".wasm")
1318
endif ()

0 commit comments

Comments
 (0)