mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 17:19:27 +00:00
Add -s flags to projects/CMake/CMakeLists.txt for newer versions of raylib
This commit is contained in:
@@ -35,6 +35,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp)
|
||||
if (${PLATFORM} STREQUAL "Web")
|
||||
# Tell Emscripten to build an example.html file.
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html")
|
||||
|
||||
# Required linker flags for using Raylib with Emscripten
|
||||
target_link_options(${PROJECT_NAME} PRIVATE -sEXPORTED_FUNCTIONS=['_main','_malloc'] -sEXPORTED_RUNTIME_METHODS=ccall -sUSE_GLFW=3)
|
||||
endif()
|
||||
|
||||
# That's it! You should have an example executable that you can run. Have fun!
|
||||
|
||||
@@ -16,7 +16,7 @@ make
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3"
|
||||
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release
|
||||
emmake make
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user