Skip to content

[build-script] Use a clean set of COMMON_CMAKE_OPTIONS for every host #2832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1506,12 +1506,14 @@ for host in "${ALL_HOSTS[@]}"; do
echo "Running Swift benchmarks for: ${SWIFT_RUN_BENCHMARK_TARGETS[@]}"
fi

common_cmake_options_host=("${COMMON_CMAKE_OPTIONS[@]}")

if [[ $(is_cross_tools_host ${host}) ]] ; then

if [[ "${CROSS_COMPILE_WITH_HOST_TOOLS}" ]]; then
# Optionally use the freshly-built host copy of clang to build
# for foreign hosts.
COMMON_CMAKE_OPTIONS+=(
common_cmake_options_host+=(
-DCMAKE_C_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang"
-DCMAKE_CXX_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang++"
)
Expand All @@ -1520,7 +1522,7 @@ for host in "${ALL_HOSTS[@]}"; do
# CMake can't relink when using Ninja, but that's okay -
# we don't need a build-local rpath because we can't run cross-compiled products
if [[ "${CMAKE_GENERATOR}" == "Ninja" ]]; then
COMMON_CMAKE_OPTIONS+=(
common_cmake_options_host+=(
-DCMAKE_BUILD_WITH_INSTALL_RPATH="1"
)
fi
Expand Down Expand Up @@ -1627,7 +1629,7 @@ for host in "${ALL_HOSTS[@]}"; do
build_dir=$(build_directory ${host} ${product})
build_targets=(all)

cmake_options=("${COMMON_CMAKE_OPTIONS[@]}")
cmake_options=("${common_cmake_options_host[@]}")

# Add in gold linker support if requested.
if [[ "${USE_GOLD_LINKER}" ]]; then
Expand Down Expand Up @@ -1702,7 +1704,6 @@ for host in "${ALL_HOSTS[@]}"; do

swift)

cmake_options=("${COMMON_CMAKE_OPTIONS[@]}")
if [[ "${USE_GOLD_LINKER}" ]]; then
# Swift will selectively use the gold linker on all
# parts except building the standard library. We
Expand Down