Skip to content

Commit

Permalink
cmake: change system name from Wasm to WASI to align with wasi-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Feb 13, 2024
1 parent 6afffa4 commit 9969423
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions func/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
# ----------------------
Expand Down
2 changes: 1 addition & 1 deletion func/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion func/dynlink/libA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion func/dynlink/libB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion func/errors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion func/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down
5 changes: 3 additions & 2 deletions func/omp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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 ()

Expand Down

0 comments on commit 9969423

Please sign in to comment.