Skip to content

Commit 66670f0

Browse files
committed
Merge pull request #2779 from apple/build-script-dont-duplicate-cmake-variables
build-script: don't duplicate product-invariant build settings in COMMON_CMAKE_OPTIONS
2 parents 99365ad + 2ad7954 commit 66670f0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

utils/build-script-impl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,26 @@ for host in "${ALL_HOSTS[@]}"; do
14631463
echo "Running Swift benchmarks for: ${SWIFT_RUN_BENCHMARK_TARGETS[@]}"
14641464
fi
14651465

1466+
if [[ $(is_cross_tools_host ${host}) ]] ; then
1467+
1468+
if [[ "${CROSS_COMPILE_WITH_HOST_TOOLS}" ]]; then
1469+
# Optionally use the freshly-built host copy of clang to build
1470+
# for foreign hosts.
1471+
COMMON_CMAKE_OPTIONS+=(
1472+
-DCMAKE_C_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang"
1473+
-DCMAKE_CXX_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang++"
1474+
)
1475+
fi
1476+
1477+
# CMake can't relink when using Ninja, but that's okay -
1478+
# we don't need a build-local rpath because we can't run cross-compiled products
1479+
if [[ "${CMAKE_GENERATOR}" == "Ninja" ]]; then
1480+
COMMON_CMAKE_OPTIONS+=(
1481+
-DCMAKE_BUILD_WITH_INSTALL_RPATH="1"
1482+
)
1483+
fi
1484+
fi
1485+
14661486
case "${COMPILER_VENDOR}" in
14671487
none)
14681488
;;
@@ -1564,26 +1584,6 @@ for host in "${ALL_HOSTS[@]}"; do
15641584
build_dir=$(build_directory ${host} ${product})
15651585
build_targets=(all)
15661586

1567-
if [[ $(is_cross_tools_host ${host}) ]] ; then
1568-
1569-
if [[ "${CROSS_COMPILE_WITH_HOST_TOOLS}" ]]; then
1570-
# Optionally use the freshly-built host copy of clang to build
1571-
# for foreign hosts.
1572-
COMMON_CMAKE_OPTIONS+=(
1573-
-DCMAKE_C_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang"
1574-
-DCMAKE_CXX_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang++"
1575-
)
1576-
fi
1577-
1578-
# CMake can't relink when using Ninja, but that's okay -
1579-
# we don't need a build-local rpath because we can't run cross-compiled products
1580-
if [[ "${CMAKE_GENERATOR}" == "Ninja" ]]; then
1581-
COMMON_CMAKE_OPTIONS+=(
1582-
-DCMAKE_BUILD_WITH_INSTALL_RPATH="1"
1583-
)
1584-
fi
1585-
fi
1586-
15871587
cmake_options=("${COMMON_CMAKE_OPTIONS[@]}")
15881588

15891589
# Add in gold linker support if requested.

0 commit comments

Comments
 (0)