Use ccache in builds when it is present
This commit is contained in:
parent
1992e1d42b
commit
871ebabb11
|
@ -36,6 +36,12 @@ if (NOT MSVC)
|
|||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
|
||||
find_program(CCACHE_PRESENT ccache)
|
||||
if(CCACHE_PRESENT)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif(CCACHE_PRESENT)
|
||||
|
||||
if ((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang))
|
||||
set(CMAKE_CXX_FLAGS "-flto ${CMAKE_CXX_FLAGS} -pipe -fstack-protector-strong -fstack-clash-protection -fexceptions")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize")
|
||||
|
|
Loading…
Reference in New Issue