diff --git a/func/CMakeLists.txt b/func/CMakeLists.txt index 59a5de82..c436ce45 100644 --- a/func/CMakeLists.txt +++ b/func/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(FAASM_NATIVE_INSTALL $ENV{FAASM_NATIVE_INSTALL_DIR}) -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") # For Faasm functions, we add `_faasm_zygote` as an exported symbol set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker --export=_faasm_zygote" @@ -20,7 +20,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") set(CMAKE_EXECUTABLE_SUFFIX ".wasm") endif () -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") # ---------------------- # Wasm build # ---------------------- diff --git a/func/demo/CMakeLists.txt b/func/demo/CMakeLists.txt index a1ebc9ad..8906082e 100644 --- a/func/demo/CMakeLists.txt +++ b/func/demo/CMakeLists.txt @@ -101,7 +101,7 @@ demo_func(zygote_check zygote_check.cpp) # 23/09/2020 - removing simd # WASM-only functions -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") demo_func(emscripten_check emscripten_check.cpp) target_link_libraries(emscripten_check emscripten) diff --git a/func/dynlink/libA/CMakeLists.txt b/func/dynlink/libA/CMakeLists.txt index ceda19f9..b6d081c4 100644 --- a/func/dynlink/libA/CMakeLists.txt +++ b/func/dynlink/libA/CMakeLists.txt @@ -3,7 +3,7 @@ set(PUBLIC_HEADERS ../include/sharedHeader.h libA.h) add_library(fakeLibA SHARED ${PUBLIC_HEADERS} libA.c) set_target_properties(fakeLibA PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") install(TARGETS fakeLibA ARCHIVE DESTINATION lib/wasm32-wasi LIBRARY DESTINATION lib/wasm32-wasi diff --git a/func/dynlink/libB/CMakeLists.txt b/func/dynlink/libB/CMakeLists.txt index 3d5360e8..ae2c06e7 100644 --- a/func/dynlink/libB/CMakeLists.txt +++ b/func/dynlink/libB/CMakeLists.txt @@ -3,7 +3,7 @@ set_target_properties(fakeLibB PROPERTIES PUBLIC_HEADER libB.h) target_link_libraries(fakeLibB fakeLibA) -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") install(TARGETS fakeLibB ARCHIVE DESTINATION lib/wasm32-wasi LIBRARY DESTINATION lib/wasm32-wasi diff --git a/func/errors/CMakeLists.txt b/func/errors/CMakeLists.txt index 292e4870..1f01b413 100644 --- a/func/errors/CMakeLists.txt +++ b/func/errors/CMakeLists.txt @@ -11,7 +11,7 @@ error_func(open_blocked open_blocked.cpp) error_func(ret_one ret_one.cpp) error_func(stdin_poll stdin_poll.cpp) -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") error_func(stackoverflow stackoverflow.cpp) endif() diff --git a/func/mpi/CMakeLists.txt b/func/mpi/CMakeLists.txt index b3ed5d2d..b3454fcf 100644 --- a/func/mpi/CMakeLists.txt +++ b/func/mpi/CMakeLists.txt @@ -8,7 +8,7 @@ function(mpi_func exec_name dir_path) target_link_libraries(${exec_name} faasmpi mpi) - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Wasm") + if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI") target_link_libraries(${exec_name} pthread) endif () diff --git a/func/omp/CMakeLists.txt b/func/omp/CMakeLists.txt index 4b16f50a..ec2b6bc4 100644 --- a/func/omp/CMakeLists.txt +++ b/func/omp/CMakeLists.txt @@ -1,8 +1,9 @@ set(FAASM_USER omp) -if (CMAKE_SYSTEM_NAME STREQUAL "Wasm") +if (CMAKE_SYSTEM_NAME STREQUAL "WASI") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker --shared-memory") else () find_package(OpenMP REQUIRED) include_directories(${OPENMP_INCLUDE_DIR} ${LLVM_INCLUDE_DIRS}/openmp) @@ -15,7 +16,7 @@ function(omp_func exec_name dir_path) target_link_libraries(${exec_name} faasmp) - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Wasm") + if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI") target_link_libraries(${exec_name} pthread) endif ()