planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
227 stars 10 forks source link

emscripten/emscripten.h: No such file or directory #67

Closed waozixyz closed 1 year ago

waozixyz commented 1 year ago

Hey i get the following issue when i try to build for web:

/home/wao/.nimble/pkgs/naylib-1.12.0/raylib/src/rcore.c:297:14: fatal error: emscripten/emscripten.h: No such file or directory
297 |     #include <emscripten/emscripten.h>  // Emscripten functionality for C
|              ^~~~~~~~~~~~~

do you know what i could try doing differently? is it possible to directly specify the emsdk/upstream/emscripten folder in the build directly?

planetis-m commented 1 year ago

Yes possibly. By setting the clang.path/clang.cpp.path and passC options to the emscripten directory in the config.nims file. Warning not tested:

const EmscriptenToolchain = "/opt/emscripten-llvm/"
switch("clang.path", EmscriptenToolchain / "bin")
switch("clang.cpp.path", EmscriptenToolchain / "bin")
switch("passC", "-I/usr/lib/emscripten/system/include/emscripten/")
waozixyz commented 1 year ago

thanks, actually i just had to add

import os to the config file and then the error stopped