[CMake] Remove force overwrite of compiler optimisation flags.
In CMake, variables like CMAKE_CXX_FLAGS_RELEASE etc should be cache variables, so users can set them from outside. ROOT, however, FORCE overwrote them, so users cannot change anything. Now, the variables are not set by ROOT at all, we use the CMake defaults. It is fine to append or replace substrings, but the variables should NOT be overwritten to give users some options. In case ROOT wants to move away from CMake defaults, it can be done like this: diff --git a/CMakeLists.txt b/CMakeLists.txt index e40b84a920..ab41612006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,11 @@ endforeach() include(cmake/modules/CaptureCommandLine.cmake) +set(CMAKE_CXX_FLAGS_DEBUG_INIT "-O1 -g") +set(CMAKE_CXX_FLAGS_ASSERT_INIT "-O2 -g") + project(ROOT)
Showing
- CMakeLists.txt 4 additions, 3 deletionsCMakeLists.txt
- cmake/modules/SetUpLinux.cmake 4 additions, 21 deletionscmake/modules/SetUpLinux.cmake
- cmake/modules/SetUpMacOS.cmake 0 additions, 14 deletionscmake/modules/SetUpMacOS.cmake
- cmake/modules/SetUpWindows.cmake 0 additions, 7 deletionscmake/modules/SetUpWindows.cmake
Please register or sign in to comment