File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp)
3535if (${PLATFORM} STREQUAL "Web" )
3636 # Tell Emscripten to build an example.html file.
3737 set_target_properties (${PROJECT_NAME} PROPERTIES SUFFIX ".html" )
38+
39+ # Required linker flags for using Raylib with Emscripten
40+ target_link_options (${PROJECT_NAME} PRIVATE -sEXPORTED_FUNCTIONS=['_main','_malloc'] -sEXPORTED_RUNTIME_METHODS=ccall -sUSE_GLFW=3)
3841endif ()
3942
4043# That's it! You should have an example executable that you can run. Have fun!
Original file line number Diff line number Diff line change 1616```
1717mkdir build
1818cd build
19- emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3"
19+ emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release
2020emmake make
2121```
2222
You can’t perform that action at this time.
0 commit comments