mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-02 15:46:36 +00:00
cmake: Add CCache support
This commit is contained in:
parent
6829b42846
commit
17187694f6
@ -150,6 +150,9 @@ function(enable_precompiled_headers PRECOMPILED_HEADER SOURCE_FILE SOURCE_VARIAB
|
||||
endif(MSVC)
|
||||
endfunction(enable_precompiled_headers)
|
||||
|
||||
# setup CCache
|
||||
include(CCache)
|
||||
|
||||
# for revision info
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION)
|
||||
|
11
CMakeTests/CCache.cmake
Normal file
11
CMakeTests/CCache.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
find_program(CCACHE_BIN ccache)
|
||||
if(CCACHE_BIN)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_BIN})
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_BIN})
|
||||
|
||||
# ccache uses -I when compiling without preprocessor, which makes clang complain.
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics")
|
||||
endif()
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user