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 --- wsutil/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wsutil') diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 43a574d678..4f117a757a 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -276,10 +276,10 @@ set(FULL_SO_VERSION "0.0.0") set_target_properties(wsutil PROPERTIES PREFIX "lib" COMPILE_DEFINITIONS "WS_BUILD_DLL" - COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" LINK_FLAGS "${WS_LINK_FLAGS}" VERSION ${FULL_SO_VERSION} SOVERSION 0 - FOLDER "DLLs") + FOLDER "DLLs" +) if(ENABLE_APPLICATION_BUNDLE) set_target_properties(wsutil PROPERTIES -- cgit v1.2.3