cmlib/CMLibDistCC.cmake
2021-06-12 12:59:31 +03:00

11 lines
390 B
CMake

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()