Add "-DPLATFORM=Web" with cmake example

master
Bensuperpc 2 years ago
parent
commit
7a744dc890
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      Working-for-Web-(HTML5).md

+ 2
- 2
Working-for-Web-(HTML5).md

@ -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".)_

Loading…
Cancel
Save