ref: 920079edb1ead2f2cbeaf46fd6643ebb344b8b6b
parent: bcebc7bd89f550f2bd2694dc188cc9bf1eed9c8d
author: Martin Storsjö <[email protected]>
date: Mon Nov 9 10:43:47 EST 2020
meson: Handle the b_lto option as a string option for newer meson versions Since 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d in meson (past the 0.56 release), the b_lto option was changed from a bool to a tristate option (false/true/thin). One could just compare the b_lto option against 'false', but that causes warnings on older meson versions (on all existing releases).
--- a/tests/libfuzzer/meson.build
+++ b/tests/libfuzzer/meson.build
@@ -72,8 +72,15 @@
objcopy = find_program('objcopy',
required: false)
+
+if meson.version().version_compare('<0.56.99')
+ lto = get_option('b_lto') ? 'true' : 'false'
+else
+ lto = get_option('b_lto')
+endif
+
if (objcopy.found() and
- not get_option('b_lto') and
+ lto == 'false' and
get_option('default_library') == 'static' and
cc.has_function('posix_memalign', prefix : '#include <stdlib.h>', args : test_args))