diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b8f348b2246f4603a093b45ca3fa8d473fbff1e..7f190fe37282cd1e2cf863c1ffa96cd32996f4c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,7 +246,10 @@ else() endif() if (CMAKE_COMPILER_IS_GNUCXX) - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing" CACHE STRING "" FORCE) + # do not write back into cache, otherwise the compile command line gets expanded + # with multiple -fno-strict-aliasing flags, triggering a complete rebuild whenever + # cmake is run + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing") endif()