Permalink
Browse files

Fixed CMakeFile

  • Loading branch information...
gabrielcuvillier committed Feb 10, 2019
1 parent 4167f4a commit a45afe4c1f4badeed37253b51706fc8ecaa53c34
Showing with 24 additions and 21 deletions.
  1. +20 −21 CMakeLists.txt
  2. +4 −0 cmake/BuildType.cmake
@@ -97,15 +97,12 @@ set(WITH_SDL 2)
set(WITH_QT CACHE STRING "The Qt version to use: 4 or 5 or empty (use any)")

# Build types
set(default_UNITY_BUILD ON)
set(default_UNITY_BUILD OFF)
if (DEVELOPER)
set(default_UNITY_BUILD OFF)
endif ()

suboption(UNITY_BUILD "Unity build" BOOL ${default_UNITY_BUILD})
if (EMSCRIPTEN)
set(UNITY_BUILD OFF)
endif ()
option(DEBUG_EXTRA "Expensive debug options" OFF)
option(SET_WARNING_FLAGS "Adjust compiler warning flags" ON)
option(SET_NOISY_WARNING_FLAGS "Enable noisy compiler warnings" OFF)
@@ -1441,23 +1438,25 @@ endif ()
if (EMSCRIPTEN)
add_executable(arxwasm "${ARX_SOURCES}" "${ARX_LIBRARIES}" "${ALL_INCLUDES}")
set_target_properties(arxwasm PROPERTIES COMPILE_FLAGS "-s USE_REGAL=1 -s USE_LIBPNG=1 -s USE_FREETYPE=1 -s USE_ZLIB=1 -s USE_SDL=2")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s USE_REGAL=1 -s USE_LIBPNG=1 -s USE_FREETYPE=1 -s USE_ZLIB=1 -s USE_SDL=2")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "--shell-file ../data/emscripten/shell.html")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-o arxwasm.html")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EXTRA_EXPORTED_RUNTIME_METHODS=[\"Pointer_stringify\"]")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s FORCE_FILESYSTEM=1")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s BINARYEN_TRAP_MODE=clamp")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s TOTAL_MEMORY=134217728") # 128MB
#set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s FULL_ES2=1") # Not needed apparently
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EMTERPRETIFY=1")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EMTERPRETIFY_ASYNC=1")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EMTERPRETIFY_FILE=arxwasm.embin")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EMTERPRETIFY_WHITELIST=[\"_main\",\"__ZL8emloopcbv\",\"__ZN7ArxGame14emscripten_runEv\",\"__Z12Menu2_Renderv\",\"__Z15ARX_Menu_Renderv\",\"__ZN7ArxGame6renderEv\",\"__Z13ARX_QuickLoadv\",\"__ZN8MainMenu19onClickedResumeGameEv\",\"__ZN5boost6detail8function26void_function_obj_invoker1INS_3_bi6bind_tIvNS_4_mfi3mf0Iv24ChooseLoadOrSaveMenuPageEENS3_5list1INS3_5valueIPS7_EEEEEEvP10TextWidgetE6invokeERNS1_15function_bufferESG_\",\"__ZN10TextWidget12OnMouseClickEv\",\"__ZN8MainMenu6UpdateEv\",\"__Z13FastSceneLoadRKN3res4pathE\",\"__Z22ARX_CHANGELEVEL_ChangeRKNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_l\",\"__Z20ARX_CHANGELEVEL_LoadRKN2fs4pathE\",\"__ZL24ARX_CHANGELEVEL_PopLevellb\",\"__Z12ARX_SlotLoad10HandleTypeI17SavegameHandleTaglLin1EE\",\"__Z9levelInitv\",\"__Z19DANAE_StartNewQuestv\",\"__ZN7ArxGame7doFrameEv\",\"__Z14DanaeLoadLevelRKN3res4pathEb\",\"__Z15LoadLevelScreenv\",\"__Z15LoadLevelScreenl\"]")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=0")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s USE_REGAL=1 -s USE_LIBPNG=1 -s USE_FREETYPE=1 -s USE_ZLIB=1 -s USE_SDL=2")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s EXIT_RUNTIME=0")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-s ENVIRONMENT=web")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS "-lopenal")

set(LINK_FLAGS "${LINK_FLAGS} -s USE_REGAL=1 -s USE_LIBPNG=1 -s USE_FREETYPE=1 -s USE_ZLIB=1 -s USE_SDL=2")
set(LINK_FLAGS "${LINK_FLAGS} --shell-file ../data/emscripten/shell.html")
set(LINK_FLAGS "${LINK_FLAGS} -o arxwasm.html")
set(LINK_FLAGS "${LINK_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"Pointer_stringify\"]")
set(LINK_FLAGS "${LINK_FLAGS} -s FORCE_FILESYSTEM=1")
set(LINK_FLAGS "${LINK_FLAGS} -s BINARYEN_TRAP_MODE=clamp")
set(LINK_FLAGS "${LINK_FLAGS} -s TOTAL_MEMORY=134217728") # 128MB
#set(LINK_FLAGS "${LINK_FLAGS} -s FULL_ES2=1") # Not needed apparently
set(LINK_FLAGS "${LINK_FLAGS} -s EMTERPRETIFY=1")
set(LINK_FLAGS "${LINK_FLAGS} -s EMTERPRETIFY_ASYNC=1")
set(LINK_FLAGS "${LINK_FLAGS} -s EMTERPRETIFY_FILE=arxwasm.embin")
set(LINK_FLAGS "${LINK_FLAGS} -s EMTERPRETIFY_WHITELIST=[\"_main\",\"__ZL8emloopcbv\",\"__ZN7ArxGame14emscripten_runEv\",\"__Z12Menu2_Renderv\",\"__Z15ARX_Menu_Renderv\",\"__ZN7ArxGame6renderEv\",\"__Z13ARX_QuickLoadv\",\"__ZN8MainMenu19onClickedResumeGameEv\",\"__ZN5boost6detail8function26void_function_obj_invoker1INS_3_bi6bind_tIvNS_4_mfi3mf0Iv24ChooseLoadOrSaveMenuPageEENS3_5list1INS3_5valueIPS7_EEEEEEvP10TextWidgetE6invokeERNS1_15function_bufferESG_\",\"__ZN10TextWidget12OnMouseClickEv\",\"__ZN8MainMenu6UpdateEv\",\"__Z13FastSceneLoadRKN3res4pathE\",\"__Z22ARX_CHANGELEVEL_ChangeRKNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_l\",\"__Z20ARX_CHANGELEVEL_LoadRKN2fs4pathE\",\"__ZL24ARX_CHANGELEVEL_PopLevellb\",\"__Z12ARX_SlotLoad10HandleTypeI17SavegameHandleTaglLin1EE\",\"__Z9levelInitv\",\"__Z19DANAE_StartNewQuestv\",\"__ZN7ArxGame7doFrameEv\",\"__Z14DanaeLoadLevelRKN3res4pathEb\",\"__Z15LoadLevelScreenv\",\"__Z15LoadLevelScreenl\"]")
set(LINK_FLAGS "${LINK_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0")
set(LINK_FLAGS "${LINK_FLAGS} -s EXIT_RUNTIME=0")
set(LINK_FLAGS "${LINK_FLAGS} -s ENVIRONMENT=web")
set(LINK_FLAGS "${LINK_FLAGS} -lopenal")
set_target_properties(arxwasm PROPERTIES LINK_FLAGS ${LINK_FLAGS})

else ()
add_executable_shared(arx "${ARX_SOURCES}" "${ARX_LIBRARIES}" "${ALL_INCLUDES}")
set_binary_type(arx WIN32)
@@ -254,6 +254,10 @@ else(MSVC)

endif(SET_OPTIMIZATION_FLAGS)

if (EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()

endif(MSVC)

set(BUILD_TYPES ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})

0 comments on commit a45afe4

Please sign in to comment.