Closed phdye closed 3 years ago
Hello @phdye !
I'm sorry, I'm a little confused. Can you explain a little bit more about this issue?
As far as I am aware, no extra C-compiler and C-linker arguments are needed.
I have a package which utilizes an external C file. Within a .nim file, one may specify pragmas to add other files to compile (.compile), merely link (.link), other compile (.passC), or linking (.passL) arguments.
I can upload a few tiny projects to github with examples if that would help.
Hello @phdye !
Thank you for clarifying this!
I am unsure of whether or not this can be supported by Nimporter.
I have a question: can .passC
be supported in a *.nim.cfg
file instead?
If not, the only other option is to support these pragmas within the switches.py
file since the whole point of nimporter.build_nim_extensions()
is to allow Python users a simple way to use Nim code in their project.
I'd be happy to look into a patch for this, contingent on my above question.
If special flags need to be passed to Nim during Nimporter's execution, you can use a switches.py script.
If you need additional assistance don't hesitate to reopen! :)
The extension objects in nimporter.build_nim_extensions() do not contain the values specified by:
Of note, the pragma values do carry through to nim-extensions/nim-extensions/src./.json. No effect on the execution of setup.py though.
To workaround, one may add the necessary values after calling nimporter.build_nim_extensions():