Skip to content

Commit

Permalink
Update CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
furudbat committed Oct 27, 2024
1 parent 350f536 commit 18bb595
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ endif()
# Web Configurations
if (${PLATFORM} STREQUAL "Web")
set_target_properties(raylib_game PROPERTIES SUFFIX ".html") # Tell Emscripten to build an example.html file.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY -s GL_ENABLE_GET_PROC_ADDRESS=1")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s WASM=1")

set(web_link_flags)
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
set(web_link_flags "${web_link_flags} -s ASSERTIONS=1")
endif()
set(web_link_flags "${web_link_flags} --preload-file ${CMAKE_CURRENT_SOURCE_DIR}/resources@resources --use-preload-plugins")
set(web_link_flags "${web_link_flags} --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/minshell.html")

set_target_properties(raylib_game PROPERTIES LINK_FLAGS "${web_link_flags}")
endif()

# Checks if OSX and links appropriate frameworks (only required on MacOS)
Expand Down

0 comments on commit 18bb595

Please sign in to comment.