mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
simd128: cmake options
After this, the required options for cmake are listed below: ``` -DCMAKE_C_FLAGS="-msimd128" -DCMAKE_TOOLCHAIN_FILE=/path/to/wasi-sdk-19.0/share/cmake/wasi-sdk.cmake -DWASI_SDK_PREFIX=/path/to/wasi-sdk-19.0 -DCGLM_USE_TEST=ON ``` If compiling to wasi with simd128 support, `-DCMAKE_C_FLAGS="-msimd128"` can be removed. If tests are not needed, `-DCGLM_USE_TEST=ON` can be removed.
This commit is contained in:
@@ -16,6 +16,11 @@ option(CGLM_STATIC "Static build" OFF)
|
||||
option(CGLM_USE_C99 "" OFF)
|
||||
option(CGLM_USE_TEST "Enable Tests" OFF)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
|
||||
set(CGLM_STATIC ON CACHE BOOL "Static option" FORCE)
|
||||
set(CGLM_SHARED OFF CACHE BOOL "Shared option" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT CGLM_STATIC AND CGLM_SHARED)
|
||||
set(CGLM_BUILD SHARED)
|
||||
else(CGLM_STATIC)
|
||||
|
@@ -22,6 +22,11 @@ set(TEST_RUNNER_PARAMS "")
|
||||
add_executable(${TEST_MAIN} ${TESTFILES})
|
||||
target_compile_definitions(${TEST_MAIN} PRIVATE CGLM_DEFINE_PRINTS=1)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
|
||||
target_compile_definitions(${TEST_MAIN} PRIVATE _WASI_EMULATED_PROCESS_CLOCKS=1)
|
||||
target_link_options(${TEST_MAIN} PRIVATE "-lwasi-emulated-process-clocks")
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(${TEST_MAIN} PRIVATE m)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user