Skip to content

Commit 9963ea4

Browse files
committed
Merge pull request #2216 from rintaro/build-script-unused-opts
[build-script] Remove unused cmake options from Swift configuration.
2 parents 3ed1617 + 5195dae commit 9963ea4

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

utils/build-script-impl

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,32 +1564,8 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
15641564
echo "${product}: using standard linker"
15651565
fi
15661566

1567-
PRODUCT=$(toupper ${product})
15681567
llvm_build_dir=$(build_directory ${deployment_target} llvm)
15691568
module_cache="${build_dir}/module-cache"
1570-
swift_cmake_options=(
1571-
"${swift_cmake_options[@]}"
1572-
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
1573-
-DLLVM_CONFIG:PATH="$(build_directory_bin ${deployment_target} llvm)/llvm-config"
1574-
-D${PRODUCT}_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}"
1575-
-D${PRODUCT}_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}"
1576-
-D${PRODUCT}_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}"
1577-
-D${PRODUCT}_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
1578-
-D${PRODUCT}_PATH_TO_CMARK_SOURCE:PATH="${CMARK_SOURCE_DIR}"
1579-
-D${PRODUCT}_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${deployment_target} cmark)"
1580-
)
1581-
1582-
if [[ "${CMAKE_GENERATOR}" == "Xcode" ]] ; then
1583-
swift_cmake_options=(
1584-
"${swift_cmake_options[@]-}"
1585-
-D${PRODUCT}_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src/${CMARK_BUILD_TYPE}
1586-
)
1587-
else
1588-
swift_cmake_options=(
1589-
"${swift_cmake_options[@]-}"
1590-
-D${PRODUCT}_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src
1591-
)
1592-
fi
15931569

15941570
case ${product} in
15951571
cmark)
@@ -1747,8 +1723,32 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
17471723
-DSWIFT_ENABLE_LTO:BOOL=$(true_false "${SWIFT_ENABLE_LTO}")
17481724
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=$(true_false "${BUILD_RUNTIME_WITH_HOST_COMPILER}")
17491725
"${swift_cmake_options[@]}"
1750-
"${SWIFT_SOURCE_DIR}"
17511726
)
1727+
1728+
cmake_options=(
1729+
"${cmake_options[@]}"
1730+
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
1731+
-DLLVM_CONFIG:PATH="$(build_directory_bin ${deployment_target} llvm)/llvm-config"
1732+
-DSWIFT_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}"
1733+
-DSWIFT_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}"
1734+
-DSWIFT_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}"
1735+
-DSWIFT_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
1736+
-DSWIFT_PATH_TO_CMARK_SOURCE:PATH="${CMARK_SOURCE_DIR}"
1737+
-DSWIFT_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${deployment_target} cmark)"
1738+
)
1739+
1740+
if [[ "${CMAKE_GENERATOR}" == "Xcode" ]] ; then
1741+
cmake_options=(
1742+
"${cmake_options[@]}"
1743+
-DSWIFT_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src/${CMARK_BUILD_TYPE}
1744+
)
1745+
else
1746+
cmake_options=(
1747+
"${cmake_options[@]}"
1748+
-DSWIFT_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src
1749+
)
1750+
fi
1751+
17521752
if [[ "${SWIFT_SDKS}" ]] ; then
17531753
cmake_options=(
17541754
"${cmake_options[@]}"
@@ -1773,6 +1773,12 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
17731773
build_targets=("${build_targets[@]}"
17741774
"${SWIFT_BENCHMARK_TARGETS[@]}")
17751775
fi
1776+
1777+
cmake_options=(
1778+
"${cmake_options[@]}"
1779+
"${SWIFT_SOURCE_DIR}"
1780+
)
1781+
17761782
skip_build=${SKIP_BUILD_SWIFT}
17771783
;;
17781784
lldb)

0 commit comments

Comments
 (0)