@@ -1496,6 +1496,24 @@ eval COMMON_CMAKE_OPTIONS=(${COMMON_CMAKE_OPTIONS})
1496
1496
eval EXTRA_CMAKE_OPTIONS=(${EXTRA_CMAKE_OPTIONS} )
1497
1497
eval BUILD_ARGS=(${BUILD_ARGS} )
1498
1498
1499
+ if [[ -n " ${DISTCC} " ]]; then
1500
+ if [[ " $( uname -s) " == " Darwin" ]] ; then
1501
+ # These are normally deduced by CMake, but when the compiler is set to
1502
+ # distcc which is installed elsewhere, we need to set them explicitly.
1503
+ COMMON_CMAKE_OPTIONS=(
1504
+ " ${COMMON_CMAKE_OPTIONS[@]} " " -DCMAKE_AR=$( xcrun_find_tool ar) "
1505
+ " -DCMAKE_LINKER=$( xcrun_find_tool ld) "
1506
+ " -DCMAKE_NM=$( xcrun_find_tool nm) "
1507
+ " -DCMAKE_OBJDUMP=$( xcrun_find_tool objdump) "
1508
+ " -DCMAKE_RANLIB=$( xcrun_find_tool ranlib) "
1509
+ " -DCMAKE_STRIP=$( xcrun_find_tool strip) "
1510
+ )
1511
+ fi
1512
+ fi
1513
+
1514
+ eval CMAKE_BUILD=(" ${DISTCC_PUMP} " " ${CMAKE} " " --build" )
1515
+
1516
+
1499
1517
if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]]; then
1500
1518
BUILD_TARGET_FLAG=" -target"
1501
1519
fi
@@ -2485,10 +2503,10 @@ for host in "${ALL_HOSTS[@]}"; do
2485
2503
2486
2504
# Xcode can't restart itself if it turns out we need to reconfigure.
2487
2505
# Do an advance build to handle that.
2488
- call ${DISTCC_PUMP} " ${CMAKE} " --build " ${build_dir} " $( cmake_config_opt ${product} )
2506
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2489
2507
fi
2490
2508
2491
- call ${DISTCC_PUMP} " ${CMAKE} " --build " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2509
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2492
2510
fi
2493
2511
done
2494
2512
done
@@ -2728,11 +2746,11 @@ for host in "${ALL_HOSTS[@]}"; do
2728
2746
2729
2747
trap " tests_busted ${product} ''" ERR
2730
2748
build_dir=$( build_directory ${host} ${product} )
2731
- build_cmd=(" ${CMAKE} " --build " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " )
2749
+ build_cmd=(" ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " )
2732
2750
2733
2751
if [[ " ${executable_target} " != " " ]]; then
2734
2752
echo " --- Building tests for ${product} ---"
2735
- call ${DISTCC_PUMP} " ${build_cmd[@]} " ${BUILD_TARGET_FLAG} " ${executable_target} "
2753
+ call " ${build_cmd[@]} " ${BUILD_TARGET_FLAG} " ${executable_target} "
2736
2754
fi
2737
2755
2738
2756
# We can only run tests built for the host machine, because
@@ -3014,7 +3032,7 @@ for host in "${ALL_HOSTS[@]}"; do
3014
3032
echo " --- Installing ${product} ---"
3015
3033
build_dir=$( build_directory ${host} ${product} )
3016
3034
3017
- call env DESTDIR=" ${host_install_destdir} " " ${CMAKE} " --build " ${build_dir} " -- ${INSTALL_TARGETS}
3035
+ call env DESTDIR=" ${host_install_destdir} " " ${CMAKE_BUILD[@]} " " ${build_dir} " -- ${INSTALL_TARGETS}
3018
3036
done
3019
3037
3020
3038
if [[ " ${DARWIN_INSTALL_EXTRACT_SYMBOLS} " ]] && [[ $( host_has_darwin_symbols ${host} ) ]]; then
0 commit comments