Skip to content

Commit

Permalink
emscripten: use consistent compile and link options across project
Browse files Browse the repository at this point in the history
  • Loading branch information
Grok Compression committed Feb 4, 2025
1 parent b2f1f5c commit 2d44804
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/highway EXCLUDE_FROM_ALL)
add_library(${GROK_CORE_NAME} ${GROK_LIBRARY_SRCS})
set_target_properties(${GROK_CORE_NAME} PROPERTIES ${GROK_LIBRARY_PROPERTIES})
target_compile_options(${GROK_CORE_NAME} PRIVATE ${GROK_COMPILE_OPTIONS} PRIVATE ${HWY_FLAGS})
# set emcc options
if (CMAKE_SYSTEM_NAME STREQUAL Emscripten)
target_compile_options(${GROK_CORE_NAME} PUBLIC -matomics)
target_link_options(${exe} PUBLIC -sASSERTIONS=1 -sPROXY_TO_PTHREAD -sTOTAL_MEMORY=1536MB -sEXIT_RUNTIME=1 -sUSE_PTHREADS=1)
target_compile_options(${exe} PUBLIC -matomics)
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/liblcms2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set_target_properties(${LIBTARGET} PROPERTIES OUTPUT_NAME "${LIBTARGET}")
set_property(TARGET ${LIBTARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)
# set emcc options
if (CMAKE_SYSTEM_NAME STREQUAL Emscripten)
target_compile_options(${LIBTARGET} PUBLIC -matomics)
target_link_options(${exe} PUBLIC -sASSERTIONS=1 -sPROXY_TO_PTHREAD -sTOTAL_MEMORY=1536MB -sEXIT_RUNTIME=1 -sUSE_PTHREADS=1)
target_compile_options(${exe} PUBLIC -matomics)
endif()

0 comments on commit 2d44804

Please sign in to comment.