Поддержка distcc

This commit is contained in:
Andrei Astafev 2019-08-08 11:10:36 +03:00
parent 957f4841fb
commit 98e9784863
2 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,7 @@ include(CMLibGlobalVariables)
include(CMLibLSBInfo)
include(CMLibCompiler)
include(CMLibCompilerFlags)
include(CMLibDistCC)
include(CMLibCompilerFeaturesHPPGenerate)
include(CMLibFlagRemove)
include(CMLibCommonTargetProperties)

10
CMLibDistCC.cmake Normal file
View File

@ -0,0 +1,10 @@
find_program(DISTCC_EXECUTABLE distcc)
mark_as_advanced(DISTCC_EXECUTABLE)
if(DISTCC_EXECUTABLE)
foreach(LANG C CXX)
if(NOT DEFINED CMAKE_${LANG}_COMPILER_LAUNCHER AND NOT CMAKE_${LANG}_COMPILER MATCHES ".*/distcc$")
message(STATUS "Enabling distcc for ${LANG}")
set(CMAKE_${LANG}_COMPILER_LAUNCHER ${DISTCC_EXECUTABLE} CACHE STRING "")
endif()
endforeach()
endif()