I have a project containing both C++ and C files which I am compiling from the command line with Emscripten using this command:
emcc -s WASM=1 -o output.html -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap', 'Pointer_stringify']" -s ASSERTIONS=1 -O1 -O2 -O3 -std=c++11 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=1 file1.cpp file2.c
I need to use c++11 for this to work but because some of the files are in C it gives this error:
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
Is there some way I can tell the compiler to only use c++11 for the C++ files but not the C files?