-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File-specific compilation flags #12662
Comments
Related: idea for |
one example use case among many: it would allow compiling different nim files with different modes, eg: |
Hi @timotheecour |
As mentioned a long time ago on IRC and here #11202 (comment) file-specific compilation flags would be useful.
Currently I have to maintain a complex cfg and/or nimble files with variations for Windows/Mac/Linux + making sure that the compiler doesn't compile a SSE2 file with AVX2 otherwise the SSE2 platform will not get SSE2 SIMD.
https://github.com/numforge/laser/blob/3c3c6f526d877cb8fdb7c8bf6e0f0867259e6a42/nim.cfg#L18-L37
https://github.com/mratsim/Arraymancer/blob/master/arraymancer.nimble#L40-L81
This would be useful for:
__attribute(target('avx'))
as a workaround with codegendecl but it also forces me to rewrite all Nim macros like N_INLINE, N_CLOSURE, ... see codegenDecl on functions overrides all attributes #10682I'm not alone in needing this:
@Araq I couldn't find the last discussion (April) where you said that it was planned for the future, so tracking here so that it's not forgotten.
The text was updated successfully, but these errors were encountered: