[babl] meson build: try to add -Ofast to CFLAGS
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] meson build: try to add -Ofast to CFLAGS
- Date: Sat, 25 May 2019 16:15:19 +0000 (UTC)
commit 2813752584558a32a321a57cc87150ba72ff5841
Author: John Marshall <jtm home gmail com>
Date: Mon Jun 11 09:27:33 2018 +0100
meson build: try to add -Ofast to CFLAGS
meson.build | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/meson.build b/meson.build
index 95270b4..fbca825 100644
--- a/meson.build
+++ b/meson.build
@@ -137,7 +137,12 @@ build_platform_win32 = (build_os.startswith('mingw') or
################################################################################
-# Extra warnings
+# Compiler arguments
+
+common_c_flags = []
+if cc.get_id().startswith('clang') or cc.get_id().startswith('gcc')
+ common_c_flags += cc.get_supported_arguments(['-Ofast'])
+endif
extra_warnings_list = [
'-Wdeclaration-after-statement',
@@ -147,13 +152,9 @@ extra_warnings_list = [
'-Wold-style-definition',
'-Wpointer-arith',
]
-extra_warnings = []
-foreach warning : extra_warnings_list
- if cc.has_argument(warning)
- extra_warnings += warning
- endif
-endforeach
+common_c_flags += cc.get_supported_arguments(extra_warnings_list)
+add_project_arguments(common_c_flags, language: 'c')
################################################################################
# Check for compiler CPU extensions
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]