Currently, I am creating a “custom” compiler that compiles nim code into c code, and then manually compiles that c code using emscripten as separate WASM files. (This is needed for future stuff) At the same time, I need to generate the dependencies of each c file, so that I can use it later to load all the WASM files needed by following the dependency tree. The part I’m stuck at now is how to get those dependencies. I don’t care if it is from the c files, nim files or something else, I just need to accurately get the dependencies or imports of a nim file and their c counterparts. (Eg. math.c is not generated, so std/math would be a invalid dependency)
Anyone have a solution to this?
The nim code is compiled using:
nim c --warning:UnusedImport:off --hints:off --os:linux --cpu:i386 --cc:clang -d:release --compileOnly --noMain --nimcache:".build/c" path