diff options
| author | Neui <neuisen@googlemail.com> | 2024-06-10 23:41:49 +0200 |
|---|---|---|
| committer | Neui <neuisen@googlemail.com> | 2024-06-10 23:44:46 +0200 |
| commit | a1c54063d0d8271a316915b73f839e82cafef5ed (patch) | |
| tree | ff37212836da06e4d99202606cee77f0cef90226 /CMake | |
| parent | f91413db8f27043ce89a62d5fd5fdad87ba57be5 (diff) | |
CMake: CCache: Always make clang happy
When we are using ccache anyway, always add the flags to make clang
happy. Also, fix copy-paste error regarding what variable to modify for
it.
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/CCache.cmake | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/CMake/CCache.cmake b/CMake/CCache.cmake index 5cd4c9c478..a8ee5da473 100644 --- a/CMake/CCache.cmake +++ b/CMake/CCache.cmake @@ -3,17 +3,15 @@ if(CCACHE_BIN) # Official ccache recommendation is to set CMAKE_C(XX)_COMPILER_LAUNCHER if (NOT CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache") list(INSERT CMAKE_C_COMPILER_LAUNCHER 0 "${CCACHE_BIN}") - # ccache uses -I when compiling without preprocessor, which makes clang complain. - if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") - endif() endif() if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache") list(INSERT CMAKE_CXX_COMPILER_LAUNCHER 0 "${CCACHE_BIN}") - # ccache uses -I when compiling without preprocessor, which makes clang complain. - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") - endif() + endif() + + # ccache uses -I when compiling without preprocessor, which makes clang complain. + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") endif() endif() |
