Dependency-level macro setting - #952
Conversation
|
Can this be extended to macro definitions with a token string (no expectations to do it now, but just in terms of the manifest syntax)? For example ! bar.F90
print *, FOO
end$ gfortran -DFOO=42 bar.F90
$ ./a.out
42Would the name |
|
Yes (untested) that syntax is possible: preprocess.cpp.macros=["FOO=42", "REAL_PRECISION=real64"] |
I think several keywords were possible, including |
|
Thank you for your comments @zoziha. |
|
@zoziha I would wait for a few more days, and if there are no further comments, I think this is ready to merge. |
|
Merging. |
I'm opening a PR to address #950.
The request is to enable dependencies to have user-specified pre-processor macros.
I suggest to do it via the package manifest, under the
[dependencies]section: each dependency can have an optionalpreprocessnode with the same contents and structure as the one in the package manifest:Seems a bit verbose, but I think it's important that the same syntax for preprocessing is used here or in the package manifest (BTW - cpp is the only supported thus far...)
Of course, it is the user's responsibility to ensure that user-enabled macros do not clash with package-level macros, there is no way to check that.
CC @zoziha @awvwgk @certik @arteevraina @henilp105 @minhqdao