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)
|
2021-12-21 10:15:59 +00:00
|
|
|
# cmake-format: off
|
|
|
|
if(NOT DEFINED CMAKE_${lang}_COMPILER_LAUNCHER AND
|
|
|
|
NOT CMAKE_${lang}_COMPILER MATCHES ".*/distcc$")
|
2021-12-21 10:45:09 +00:00
|
|
|
myx_cmake_message_notice("MyxCMake: distcc enabled for ${lang}")
|
2021-12-21 10:15:59 +00:00
|
|
|
set(CMAKE_${lang}_COMPILER_LAUNCHER ${DISTCC_EXECUTABLE} CACHE STRING "")
|
2021-12-08 11:32:04 +00:00
|
|
|
endif()
|
2021-12-21 10:15:59 +00:00
|
|
|
# cmake-format: on
|
2021-12-08 11:32:04 +00:00
|
|
|
endforeach()
|
|
|
|
endif()
|