Переглянути джерело

Projects: Fix CMake example project (#4332)

* Update CMakeLists.txt

Add missing link flags

* Update README.md

Remove unneeded flag because this flag is defined in the updated CMakeList file

* Update CMakeLists.txt
pull/4335/head
Ridge3Dproductions 8 місяці тому
committed by GitHub
джерело
коміт
9337913766
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: B5690EEEBB952194
2 змінених файлів з 4 додано та 4 видалено
  1. +2
    -2
      projects/CMake/CMakeLists.txt
  2. +2
    -2
      projects/CMake/README.md

+ 2
- 2
projects/CMake/CMakeLists.txt Переглянути файл

@ -30,8 +30,8 @@ target_link_libraries(${PROJECT_NAME} raylib)
# Web Configurations # Web Configurations
if (${PLATFORM} STREQUAL "Web") if (${PLATFORM} STREQUAL "Web")
# Tell Emscripten to build an example.html file.
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html")
nb">set_target_properties(${PROJECT_NAME} 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")
endif() endif()
# Checks if OSX and links appropriate frameworks (Only required on MacOS) # Checks if OSX and links appropriate frameworks (Only required on MacOS)

+ 2
- 2
projects/CMake/README.md Переглянути файл

@ -22,6 +22,6 @@ Compiling for the web requires the [Emscripten SDK](https://emscripten.org/docs/
``` bash ``` bash
mkdir build mkdir build
cd build cd build
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXECUTABLE_SUFFIX=".html"
emmake make emmake make
```
```

Завантаження…
Відмінити
Зберегти