[PATCH] meson: put custom CFLAGS after default CFLAGS

Konstantin Khlebnikov posted 1 patch 3 years, 12 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/164449347000.2210159.3879447183273643758.stgit@dynamic-vpn.dhcp.yndx.net
meson.build |   12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[PATCH] meson: put custom CFLAGS after default CFLAGS
Posted by Konstantin Khlebnikov 3 years, 12 months ago
Flags passed to configure must be at the end to override defaults.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 meson.build |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 5f43355071..d94f3ee3e3 100644
--- a/meson.build
+++ b/meson.build
@@ -3293,13 +3293,13 @@ if targetos == 'windows'
     summary_info += {'Windows SDK':   config_host['WIN_SDK']}
   endif
 endif
-summary_info += {'CFLAGS':            ' '.join(get_option('c_args')
-                                               + ['-O' + get_option('optimization')]
-                                               + (get_option('debug') ? ['-g'] : []))}
+summary_info += {'CFLAGS':            ' '.join(['-O' + get_option('optimization')]
+                                               + (get_option('debug') ? ['-g'] : [])
+                                               + get_option('c_args'))}
 if link_language == 'cpp'
-  summary_info += {'CXXFLAGS':        ' '.join(get_option('cpp_args')
-                                               + ['-O' + get_option('optimization')]
-                                               + (get_option('debug') ? ['-g'] : []))}
+  summary_info += {'CXXFLAGS':        ' '.join(['-O' + get_option('optimization')]
+                                               + (get_option('debug') ? ['-g'] : [])
+                                               + get_option('cpp_args'))}
 endif
 link_args = get_option(link_language + '_link_args')
 if link_args.length() > 0


Re: [PATCH] meson: put custom CFLAGS after default CFLAGS
Posted by Philippe Mathieu-Daudé via 3 years, 12 months ago
Hi Konstantin,

On 10/2/22 12:44, Konstantin Khlebnikov wrote:
> Flags passed to configure must be at the end to override defaults.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> ---
>   meson.build |   12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 5f43355071..d94f3ee3e3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3293,13 +3293,13 @@ if targetos == 'windows'
>       summary_info += {'Windows SDK':   config_host['WIN_SDK']}
>     endif
>   endif
> -summary_info += {'CFLAGS':            ' '.join(get_option('c_args')
> -                                               + ['-O' + get_option('optimization')]
> -                                               + (get_option('debug') ? ['-g'] : []))}
> +summary_info += {'CFLAGS':            ' '.join(['-O' + get_option('optimization')]
> +                                               + (get_option('debug') ? ['-g'] : [])
> +                                               + get_option('c_args'))}
>   if link_language == 'cpp'
> -  summary_info += {'CXXFLAGS':        ' '.join(get_option('cpp_args')
> -                                               + ['-O' + get_option('optimization')]
> -                                               + (get_option('debug') ? ['-g'] : []))}
> +  summary_info += {'CXXFLAGS':        ' '.join(['-O' + get_option('optimization')]
> +                                               + (get_option('debug') ? ['-g'] : [])
> +                                               + get_option('cpp_args'))}

These are just informative... What is your problem? AFAIU This patch
doesn't have any logical impact on the build system.

Re: [PATCH] meson: put custom CFLAGS after default CFLAGS
Posted by Konstantin Khlebnikov 3 years, 12 months ago