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)
35
35
if (${PLATFORM} STREQUAL "Web" )
36
36
# Tell Emscripten to build an example.html file.
37
37
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)
38
41
endif ()
39
42
40
43
# 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 16
16
```
17
17
mkdir build
18
18
cd 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
20
20
emmake make
21
21
```
22
22
You can’t perform that action at this time.
0 commit comments