diff options
author | Be <be@mixxx.org> | 2021-02-25 12:16:23 -0600 |
---|---|---|
committer | Be <be@mixxx.org> | 2021-02-26 03:30:56 -0600 |
commit | 4ceeb3b474ad4765578d17fe40892168b99ab870 (patch) | |
tree | 309e0ee336da8a61ffc40b6d13708cf0aa5bbd7c /CMakeLists.txt | |
parent | 2afc1c46ea16e966a2495287cdf057b1628a7afa (diff) |
CMake: use /Z7 instead of /Zi on Windows to let caching work
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e552e9b32a..2e8add94b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,18 @@ if(MSVC) add_compile_definitions("__SSE__" "__SSE2__") endif() + # Needed for sccache + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + endif() + if(NOT OPTIMIZE STREQUAL "off") # Use the fastest floating point math library # http://msdn.microsoft.com/en-us/library/e7s85ffb.aspx |