aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-11-02 13:07:23 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-01-06 00:51:02 +0100
commit6a97f3939240977e66e90862419911666956a76a (patch)
treeb79224d174c742c235e2092e414cc1928caa6cdf /meson.build
parentca9b5c2ebf1aca87677a24c208bf3d0345c0b1aa (diff)
downloadqemu-6a97f3939240977e66e90862419911666956a76a.zip
qemu-6a97f3939240977e66e90862419911666956a76a.tar.gz
qemu-6a97f3939240977e66e90862419911666956a76a.tar.bz2
meson: support meson 0.64 -Doptimization=plain
In Meson 0.64, the optimization built-in option now accepts the "plain" value, which will not set any optimization flags. While QEMU does not check the contents of the option and therefore does not suffer any ill effect from the new value, it uses get_option to print the optimization flags in the summary. Clean the code up to remove duplication, and check for -Doptimization=plain at the same time. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 7 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index b45814c..65e3f03 100644
--- a/meson.build
+++ b/meson.build
@@ -3757,18 +3757,16 @@ endif
if targetos == 'darwin'
summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
endif
-summary_info += {'CFLAGS': ' '.join(get_option('c_args')
- + ['-O' + get_option('optimization')]
- + (get_option('debug') ? ['-g'] : []))}
+option_cflags = (get_option('debug') ? ['-g'] : [])
+if get_option('optimization') != 'plain'
+ option_cflags += ['-O' + get_option('optimization')]
+endif
+summary_info += {'CFLAGS': ' '.join(get_option('c_args') + option_cflags)}
if link_language == 'cpp'
- summary_info += {'CXXFLAGS': ' '.join(get_option('cpp_args')
- + ['-O' + get_option('optimization')]
- + (get_option('debug') ? ['-g'] : []))}
+ summary_info += {'CXXFLAGS': ' '.join(get_option('cpp_args') + option_cflags)}
endif
if targetos == 'darwin'
- summary_info += {'OBJCFLAGS': ' '.join(get_option('objc_args')
- + ['-O' + get_option('optimization')]
- + (get_option('debug') ? ['-g'] : []))}
+ summary_info += {'OBJCFLAGS': ' '.join(get_option('objc_args') + option_cflags)}
endif
link_args = get_option(link_language + '_link_args')
if link_args.length() > 0