summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-11-20 00:44:28 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-11-21 11:42:22 +0200
commita8d03129033080c4c42a3f44792b9f7db206e300 (patch)
tree0ebeb0379d1486a67497e651b40234ec08e6f48d /meson.build
parent1516ef3ce6b88034cd9d62cd4ebd4980584bc0da (diff)
meson: Really define _FORTIFY_SOURCE for optimised builds
Commit 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised builds") tried to define _FORTIFY_SOURCE for optimised builds with clang, but updated the common_arguments after it was used. This resulted in the _FORTIFY_SOURCE option not being applied. Fix it. Fixes: 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised builds") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build7
1 files changed, 5 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 72ad7c8b..0a222ba9 100644
--- a/meson.build
+++ b/meson.build
@@ -35,8 +35,8 @@ common_arguments = [
'-include', 'config.h',
]
-c_arguments = common_arguments
-cpp_arguments = common_arguments
+c_arguments = []
+cpp_arguments = []
if cc.get_id() == 'clang'
# Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1
@@ -56,6 +56,9 @@ if cc.get_id() == 'clang'
endif
endif
+c_arguments += common_arguments
+cpp_arguments += common_arguments
+
add_project_arguments(c_arguments, language : 'c')
add_project_arguments(cpp_arguments, language : 'cpp')
add_project_link_arguments(cpp_arguments, language : 'cpp')