]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: refuse -ffinite-math-only 24051/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Jul 2022 20:02:48 +0000 (05:02 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Jul 2022 00:18:13 +0000 (09:18 +0900)
Closes #23610.

meson.build

index 5d7c8699fe0d057855569f25ec1ceedf05a52e8a..61073d4eadb2799f715b46ed856fb7d6908e64ae 100644 (file)
@@ -390,6 +390,11 @@ possible_common_cc_flags = [
 
 c_args = get_option('c_args')
 
+# Our json library does not support -ffinite-math-only, which is enabled by -Ofast or -ffast-math.
+if (('-Ofast' in c_args or '-ffast-math' in c_args or '-ffinite-math-only' in c_args) and not '-fno-finite-math-only' in c_args)
+        error('-Ofast, -ffast-math, or -ffinite-math-only is specified in c_args.')
+endif
+
 # Disable -Wmaybe-uninitialized when compiling with -Os/-O1/-O3/etc. There are
 # too many false positives with gcc >= 8. Effectively, we only test with -O0
 # and -O2; this should be enough to catch most important cases without too much