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
Hello,
I have a question about compiler flags (c_args, cpp_args).
The flags can be set in a crossfile, for example:
[binaries]
c = ['gcc', '-some_flag=0']
Other possibility is to set the flags in [built-in options] in the crossfile:
[built-in options]
c_args = ['-some_flag=1']
And then I can set these flags directly in a meson script:
c_args = ['-some_flag=2']
executable('my_app', source_files, c_args: c_args)
If I define these flags together as above then the compile command will be (simplified):
gcc -some_flag=0 -some_flag=2 -some_flag=1 ...
I'd expect the flag set in the meson script ('-some_flag=2') to be at the end of the compile command and override the definitions from the cross file. Is there some good reason that the flags from [built-in options] are at the end of the compile command?
I'm asking because I'm using some community crossfile that I cannot chang. This crossfile has some flags in [built-in options] and I need to override some of the flags in my own meson script. But the Meson puts the flags from [built-in options] at the end of the compile command and thus overrides my flags defined in my meson script.
How can I override the [built-in options] flags? I think the args passed to target (executable() in my case) should have highest priority and should be at the end of the compile command.
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
-
Hello,
I have a question about compiler flags (c_args, cpp_args).
The flags can be set in a crossfile, for example:
[binaries]
c = ['gcc', '-some_flag=0']
Other possibility is to set the flags in [built-in options] in the crossfile:
[built-in options]
c_args = ['-some_flag=1']
And then I can set these flags directly in a meson script:
c_args = ['-some_flag=2']
executable('my_app', source_files, c_args: c_args)
If I define these flags together as above then the compile command will be (simplified):
gcc -some_flag=0 -some_flag=2 -some_flag=1 ...
I'd expect the flag set in the meson script ('-some_flag=2') to be at the end of the compile command and override the definitions from the cross file. Is there some good reason that the flags from [built-in options] are at the end of the compile command?
I'm asking because I'm using some community crossfile that I cannot chang. This crossfile has some flags in [built-in options] and I need to override some of the flags in my own meson script. But the Meson puts the flags from [built-in options] at the end of the compile command and thus overrides my flags defined in my meson script.
How can I override the [built-in options] flags? I think the args passed to target (executable() in my case) should have highest priority and should be at the end of the compile command.
Beta Was this translation helpful? Give feedback.
All reactions