diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-05-26 23:47:49 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-05-27 12:27:45 +0200 |
commit | ffbb0fb9cb8b21c8308ab428cf37041079fe6265 (patch) | |
tree | dbe8d8928e69deed7b426ef4b78686cc4b3900e5 /test/fuzz | |
parent | 4793c31083031e729e6eb17b87b540a3944bba3b (diff) | |
download | systemd-ffbb0fb9cb8b21c8308ab428cf37041079fe6265.tar.gz |
meson: support building fuzzers with meson <0.48.0
Diffstat (limited to 'test/fuzz')
-rw-r--r-- | test/fuzz/meson.build | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/fuzz/meson.build b/test/fuzz/meson.build index b0305bdd0e..99584c144b 100644 --- a/test/fuzz/meson.build +++ b/test/fuzz/meson.build @@ -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]) |