]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: support building fuzzers with meson <0.48.0
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 26 May 2020 21:47:49 +0000 (23:47 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 27 May 2020 10:27:45 +0000 (12:27 +0200)
test/fuzz/meson.build

index b0305bdd0ec05457cb58851ce25943d552f27ea9..99584c144b153f610badc41242579e14bb6e68c3 100644 (file)
@@ -1,5 +1,13 @@
 # SPDX-License-Identifier: LGPL-2.1+
 
+# The 'optimization' option was introduced in meson 0.48.0, so let's keep
+# the code compatible with older versions as well
+if meson.version().version_compare('>=0.48.0')
+        optimization = '--optimization=@0@'.format(get_option('optimization'))
+else
+        optimization = ''
+endif
+
 sanitize_address_undefined = custom_target(
         'sanitize-address-undefined-fuzzers',
         output : 'sanitize-address-undefined-fuzzers',
@@ -7,8 +15,7 @@ sanitize_address_undefined = custom_target(
                    project_source_root,
                    '@OUTPUT@',
                    'fuzzers',
-                   '-Db_lundef=false -Db_sanitize=address,undefined ' +
-                   '--optimization=@0@'.format(get_option('optimization')),
+                   '-Db_lundef=false -Db_sanitize=address,undefined @0@'.format(optimization),
                    ' '.join(cc.cmd_array()),
                    cxx_cmd])