What do I need to add to my CMakeLists.txt file such that below examples from here can still build?
I can generate the WASM with out any problems but have no idea what to add to my CMakeLists.txt to stop getting the error, when trying to just run the c code
fatal error: 'emscripten/emscripten.h' file not found #include <emscripten/emscripten.h>
I tried finding examples but sadly I found none.
#include <stdio.h>
#include <emscripten/emscripten.h>
int main(int argc, char ** argv) {
printf("Hello World\n");
}
#ifdef __cplusplus
extern "C" {
#endif
EMSCRIPTEN_KEEPALIVE void myFunction(int argc, char ** argv) {
printf("MyFunction Called\n");
}
#ifdef __cplusplus
}
#endif
My CMakeLists.txt is barebones at the moment and contains the following:
cmake_minimum_required(VERSION 3.17)
project(WASM)
set(CMAKE_CXX_STANDARD 14)
add_executable(WASM main.cpp)
emscripten/emscripten.htoadd_executablelist beforemain.cppemscripten?empcripten.hfile installed?