myx-cmake/MyxCMake/modules/MyxCMakeDistCC.cmake

14 lines
426 B
CMake
Raw Normal View History

2021-12-08 11:32:04 +00:00
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 "MyxCMake: distcc enabled for ${lang}")
set(CMAKE_${lang}_COMPILER_LAUNCHER
${DISTCC_EXECUTABLE}
CACHE STRING "")
endif()
endforeach()
endif()