Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Nov 2, 2024
1 parent 3c03c98 commit 6dd6b4d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,33 @@ target_precompile_headers(${PROJECT_NAME} PRIVATE ${HEADER_FILES})
if(CMAKE_BUILD_TYPE MATCHES "Debug")
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /Od /Zi)
elseif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -O0 -g)
endif()
elseif(CMAKE_BUILD_TYPE MATCHES "Release")
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /O3 /GL)
elseif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -pedantic -O3 -flto)
endif()
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
target_link_options(${PROJECT_NAME} PRIVATE
set(EMSCRIPTEN_OPTIONS
"-s EVAL_CTORS=1"
"-s WASM_BIGINT=1"
"-s DISABLE_EXCEPTION_CATCHING=1"
"-s ALLOW_MEMORY_GROWTH=1"
"-s INITIAL_MEMORY=134217728"
"-s EXPORTED_RUNTIME_METHODS=['callMain']"
# Debug
# Debuggging
"-s RUNTIME_DEBUG"
"-s ASSERTIONS=1"
"-s NO_DISABLE_EXCEPTION_CATCHING"
)
target_compile_options(${PROJECT_NAME} PRIVATE -Os -flto)

target_link_libraries(${PROJECT_NAME} PRIVATE ${EMSCRIPTEN_OPTIONS})
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -Wno-pass-failed=transform-warning -pedantic -O3 -flto)
endif()

option(SANDBOX "Use sandbox" OFF)
Expand Down

0 comments on commit 6dd6b4d

Please sign in to comment.