-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
At some point in the past filenames generated inside nimcache have changed from their plain name to parent directory + plain name. As such, the ios cross calculator example doesn't work any more because the Xcode IDE expects the filenames backend.m or system.m. Now the files generated by the build script are named nimrod_backend_backend.m and root_system.m.
Generated files could be put into nimcache replicating the original source file tree. Alternatively if a plain filesystem is preferred, since system.nim gets the root_ prefix (despite not being located in a root directory), the main nimrod project file could receive main as prefix instead of the brittle parent directory name, prone to change. External modules could receive the prefix modulename_ for all of their imports.
Another compromise would be to concatenate all generated source files into a single .c file to be specified through a new singleOut switch. Some build flows might benefit from this despite disallowing incremental compilation.
An illustration of this problem can be seen through the following commands:
$ mkdir test1
$ cd test1
$ echo 'echo "Hi"' > t.nim
$ nimrod c t
$ find nimcache
nimcache
nimcache/root_system.c
nimcache/root_system.o
nimcache/test1_t.c
nimcache/test1_t.o