only-cliches / cpp-wasm-loader

C/C++ to WASM Webpack Loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copying to temporary directory breaks local includes

dstelljes opened this issue · comments

Given a source file like this...

#include "someheader.h"

... compilation fails because someheader.h doesn't exist relative to the temporary copy. Seems like there are two workarounds: don't make a temporary copy, or pass the directory to the compiler (emcc /tmp/whatever/source.c -I/path/to/source). Happy to open a PR for either.

I guess that the temporary copy is not necessary, so it would be better to remove it. It seems like a better option than adding the source directory to the include paths, because that could break or alter the compilation in rare cases.

It would be great if you could open a PR :-) I don't have much time to look at this ATM.

Cool, thanks!