meson: only use "-Ofast" for optimized builds
authorEll <ell_se@yahoo.com>
Fri, 25 Oct 2019 14:03:38 +0000 (17:03 +0300)
committerEll <ell_se@yahoo.com>
Fri, 25 Oct 2019 14:26:16 +0000 (17:26 +0300)
Only use "-Ofast" when the build type is either "debugoptimized"
or "release", so that unoptimized builds are possible.

meson.build

index f0538637fad97b1b8f9172ed0a7e90e16e41cffe..1ada1a996fb1644f2a8edcdf583c3e0496121bd2 100644 (file)
@@ -155,7 +155,8 @@ cc_can_run = not meson.is_cross_build() or meson.has_exe_wrapper()
 # Compiler arguments
 
 common_c_flags = []
-if cc.get_id().startswith('clang') or cc.get_id().startswith('gcc')
+
+if buildtype == 'debugoptimized' or buildtype == 'release'
   common_c_flags += cc.get_supported_arguments(['-Ofast'])
 endif