From ef306d5666b5f8a362370b23fa3fe4b3345dd31a Mon Sep 17 00:00:00 2001 From: Jared Duke Date: Sat, 23 May 2015 13:46:35 -0700 Subject: [PATCH] Fix issue with CMAKE_CXX_FLAGS initialization Append the necessary flags to CMAKE_CXX_FLAGS, rather than replacing the previous values. It's critical that that flags are preserved to ensure proper and consistent compilation. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9829cd306..50159bb2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,9 +62,9 @@ if( CMAKE_COMPILER_IS_MINGW ) endif() if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW) - set(CMAKE_CXX_FLAGS "-fPIC") # this is a very important switch and some libraries seem now to have it.... + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # this is a very important switch and some libraries seem now to have it.... # hide all not-exported symbols - set(CMAKE_CXX_FLAGS "-fvisibility=hidden -Wall" ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall" ) elseif(MSVC) # enable multi-core compilation with MSVC add_definitions(/MP)