BlazePascal
BlazePascal

Reputation: 401

Global path not found by Emscripten when using CMake

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

Answers (1)

user1906
user1906

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

Related Questions