mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-29 18:29:18 -05:00
Add "-DPLATFORM=Web" with cmake example
@ -114,7 +114,7 @@ If you prefer to use `CMake` instead of the plain `Makefile` provided, you have
|
|||||||
**You can go with the [emscripten suggested way](https://emscripten.org/docs/compiling/Building-Projects.html)**: That is to use the following command that will add the compiler and toolchain options for you:
|
**You can go with the [emscripten suggested way](https://emscripten.org/docs/compiling/Building-Projects.html)**: That is to use the following command that will add the compiler and toolchain options for you:
|
||||||
|
|
||||||
```
|
```
|
||||||
emcmake cmake -H . -B build
|
emcmake cmake -H . -B build
|
||||||
```
|
```
|
||||||
_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
|
_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ Emscripten cmake will prefer the [ninja build system](https://ninja-build.org/)
|
|||||||
**IDE-friendly option**: As the first option is only available from a command line where you have run "emsdk activate latest" when using an IDE (like Visual Studio, CLion, etc.) you should set the path to the emscripten toolchain file:
|
**IDE-friendly option**: As the first option is only available from a command line where you have run "emsdk activate latest" when using an IDE (like Visual Studio, CLion, etc.) you should set the path to the emscripten toolchain file:
|
||||||
|
|
||||||
```
|
```
|
||||||
cmake -H . -B build -G Ninja "-DCMAKE_TOOLCHAIN_FILE=<fullpath_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
cmake -H . -B build -G Ninja -DPLATFORM=Web "-DCMAKE_TOOLCHAIN_FILE=<fullpath_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
||||||
```
|
```
|
||||||
_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
|
_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
|
||||||
_(The ninja generator is optional and you can use your system default by removing "-G Ninja".)_
|
_(The ninja generator is optional and you can use your system default by removing "-G Ninja".)_
|
||||||
|
|||||||
Reference in New Issue
Block a user