You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I have one target that need to be compiler with /clr option. However, this option is incompatible with many other options, for instance /rtc1 option, that are in my project options. My problem is that all other targets need the /rtc1 option when I'm using the debug runtimes, and I'm not aware of an option in msvc to unset the /rtc1 options.
I tried putting the clr target into a subproject, but this is not really an option because it needs many other options and variables from the main project.
So far, the only solution I found is to put the clr incompatible options into an array, and to add that array to compile options of every target. This works, but this is cumbersome, and it removes the purpose of having projet or global options.
I think there could be some possible solutions on meson side, requiring a small development. Here are the potential solutions I see:
Add a unset_<lang>_args keyword to build targets to remove some specific options
Add a keyword to build target to ignore global compile options and / or global project options (something like plain: true, or ignore_<global|project>_<lang>_args: true...)
Add a rule in msvc compiler to automatically remove incompatible compile options when /clr is provided
Add a built-in option for managing clr, that would allow compilers to add and remove options according to the selected clr option. That way, overriding the option for a specific target would automatically remove the incompatible global and project options.
I think the first option would be the most versatile.
The second option could be powerful, but would not be very practical without a get_project_arguments and a get_global_arguments. I don't really like it.
The third option seems too specific and too magic for me, but would require not changes to build files.
The fourth option could work, but I don't like the idea of adding a built-in option that is specific to a compiler. I'm not aware of other compilers needing something similar to the /clr switch of msvc.
What do you think of this? Is there something obvious I didn't see?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In my project, I have one target that need to be compiler with
/clr
option. However, this option is incompatible with many other options, for instance/rtc1
option, that are in my project options. My problem is that all other targets need the/rtc1
option when I'm using the debug runtimes, and I'm not aware of an option in msvc to unset the/rtc1
options.I tried putting the clr target into a subproject, but this is not really an option because it needs many other options and variables from the main project.
So far, the only solution I found is to put the clr incompatible options into an array, and to add that array to compile options of every target. This works, but this is cumbersome, and it removes the purpose of having projet or global options.
I think there could be some possible solutions on meson side, requiring a small development. Here are the potential solutions I see:
unset_<lang>_args
keyword to build targets to remove some specific optionsplain: true
, orignore_<global|project>_<lang>_args: true
...)/clr
is providedI think the first option would be the most versatile.
The second option could be powerful, but would not be very practical without a
get_project_arguments
and aget_global_arguments
. I don't really like it.The third option seems too specific and too magic for me, but would require not changes to build files.
The fourth option could work, but I don't like the idea of adding a built-in option that is specific to a compiler. I'm not aware of other compilers needing something similar to the
/clr
switch of msvc.What do you think of this? Is there something obvious I didn't see?
Beta Was this translation helpful? Give feedback.
All reactions