Skip to content

Commit c4626ba

Browse files
authored
Un-set CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER in s… (#23806)
[CMake] Add check for distcc before setting CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER
1 parent 98200db commit c4626ba

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

stdlib/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ else()
2929
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH}/clang")
3030
endif()
3131

32-
set(CMAKE_C_COMPILER_LAUNCHER "")
33-
set(CMAKE_CXX_COMPILER_LAUNCHER "")
32+
if(CMAKE_C_COMPILER_LAUNCHER MATCHES ".*distcc")
33+
set(CMAKE_C_COMPILER_LAUNCHER "")
34+
endif()
35+
if(CMAKE_CXX_COMPILER_LAUNCHER MATCHES ".*distcc")
36+
set(CMAKE_CXX_COMPILER_LAUNCHER "")
37+
endif()
3438

3539
# The sanitizers require using the same version of the compiler for
3640
# everything and there are various places where we link runtime code with

unittests/runtime/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
2020
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH}/clang")
2121
endif()
2222

23-
set(CMAKE_C_COMPILER_LAUNCHER "")
24-
set(CMAKE_CXX_COMPILER_LAUNCHER "")
23+
if(CMAKE_C_COMPILER_LAUNCHER MATCHES ".*distcc")
24+
set(CMAKE_C_COMPILER_LAUNCHER "")
25+
endif()
26+
if(CMAKE_CXX_COMPILER_LAUNCHER MATCHES ".*distcc")
27+
set(CMAKE_CXX_COMPILER_LAUNCHER "")
28+
endif()
2529
endif()
2630

2731
set(swift_runtime_test_extra_libraries)

0 commit comments

Comments
 (0)