Reputation: 401
I'm trying to see if it is possible to run Emscripten using CMake as the Makefile generator. My generate command is:
cmake -DCMAKE_CXX_COMPILER=emcc -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=/usr/include ../
The -DCMAKE_INCLUDE_PATH
shouldn't be necessary but I added it when I got the error:
#include <glm/glm.hpp>
^
1 error generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
My project only contains GLM as a dependency (edit: also depends on C++11), and if I wasn't using emcc
as my compiler it would normally get picked up.
Upvotes: 0
Views: 459
Reputation: 2340
Specifying the compiler in the cmake call is not enough, you need the toolchain. To do that, use emcmake cmake [options]
. It will set everything you need to compile using emscripten.
Upvotes: 2