Skip to content

build-script: don't duplicate product-invariant build settings in COMMON_CMAKE_OPTIONS #2779

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
May 31, 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
40 changes: 20 additions & 20 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,26 @@ for host in "${ALL_HOSTS[@]}"; do
echo "Running Swift benchmarks for: ${SWIFT_RUN_BENCHMARK_TARGETS[@]}"
fi

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+=(
-DCMAKE_C_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang"
-DCMAKE_CXX_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang++"
)
fi

# 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+=(
-DCMAKE_BUILD_WITH_INSTALL_RPATH="1"
)
fi
fi

case "${COMPILER_VENDOR}" in
none)
;;
Expand Down Expand Up @@ -1564,26 +1584,6 @@ for host in "${ALL_HOSTS[@]}"; do
build_dir=$(build_directory ${host} ${product})
build_targets=(all)

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+=(
-DCMAKE_C_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang"
-DCMAKE_CXX_COMPILER="$(build_directory ${LOCAL_HOST} llvm)/bin/clang++"
)
fi

# 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+=(
-DCMAKE_BUILD_WITH_INSTALL_RPATH="1"
)
fi
fi

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

# Add in gold linker support if requested.
Expand Down