Emscripten - cmake - pass emscripten options in CMakeList file

后端 未结 2 1625
南笙
南笙 2020-12-15 22:25

How to use emcmake cmake and pass emscripten command-line options?

Pretty new to c++ / CMake, but can\'t find anything helpful on google. So maybe the q

2条回答
  •  没有蜡笔的小新
    2020-12-15 23:14

    I think the issue is that you are overwriting the CMAKE_MODULE_PATH, which emcmake also configure. Try to replace the line by:

    list(APPEND CMAKE_MODULE_PATH )
    

    Then you just have to do "emcmake cmake" and "emmake make", it should work fine normally.

    In the cmake file, you can use "if (EMSCRIPTEN)" to tweak suff just for the emscripten case, such as the compiler or linker flags

提交回复
热议问题