myx-cmake/MyxCMake/modules/MyxCMakeDistCC.cmake

14 lines
459 B
CMake

find_program(DISTCC_EXECUTABLE distcc)
mark_as_advanced(DISTCC_EXECUTABLE)
if(DISTCC_EXECUTABLE)
foreach(lang C CXX)
# cmake-format: off
if(NOT DEFINED CMAKE_${lang}_COMPILER_LAUNCHER AND
NOT CMAKE_${lang}_COMPILER MATCHES ".*/distcc$")
myx_cmake_message_notice("MyxCMake: distcc enabled for ${lang}")
set(CMAKE_${lang}_COMPILER_LAUNCHER ${DISTCC_EXECUTABLE} CACHE STRING "")
endif()
# cmake-format: on
endforeach()
endif()