From 9bba3866ffc0d382d511d298d2460c618bfa6c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sun, 24 Sep 2017 02:30:08 +0100 Subject: CMake: Allow user build flags to override default build flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autotools has the very useful feature by design of allowing the user to override the default build flags (you break it you keep it). Apparently CMake applies COMPILE_OPTIONS target property after CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those variables instead to make it work then. Specific target flag overrides can still be added with COMPILER_OPTIONS (e.g: generated files with -Wno-warning) but this is less effective and then we're back at the point where this overrides user flags. It's less of a concern though. Change-Id: I44761a79be4289238e02d4e781fef0099628817b Reviewed-on: https://code.wireshark.org/review/23675 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde Reviewed-by: Peter Wu --- randpkt_core/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'randpkt_core') diff --git a/randpkt_core/CMakeLists.txt b/randpkt_core/CMakeLists.txt index dc88b07e55..f7d5069e8d 100644 --- a/randpkt_core/CMakeLists.txt +++ b/randpkt_core/CMakeLists.txt @@ -41,7 +41,6 @@ add_library(randpkt_core STATIC ) set_target_properties(randpkt_core PROPERTIES - COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" LINK_FLAGS "${WS_LINK_FLAGS}" FOLDER "Libs") -- cgit v1.2.3