mirror of https://github.com/oxen-io/oxen-mq.git
Export compile commands and use ccache by default
This commit is contained in:
parent
0738695eb9
commit
b49a94fb83
|
@ -1,3 +1,16 @@
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
find_program(CCACHE_PROGRAM ccache)
|
||||||
|
if(CCACHE_PROGRAM)
|
||||||
|
foreach(lang C CXX)
|
||||||
|
if(NOT DEFINED CMAKE_${lang}_COMPILER_LAUNCHER AND NOT CMAKE_${lang}_COMPILER MATCHES ".*/ccache")
|
||||||
|
message(STATUS "Enabling ccache for ${lang}")
|
||||||
|
set(CMAKE_${lang}_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE STRING "")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.7)
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
|
||||||
# Has to be set before `project()`, and ignored on non-macos:
|
# Has to be set before `project()`, and ignored on non-macos:
|
||||||
|
|
Loading…
Reference in New Issue