Skip to content

Commit 1ba5ce6

Browse files
committed
[BuildScript] Pass build conf to swiftpm
- <rdar://problem/27791475> SwiftPM can now be built in release mode because all the outstanding issues preventing that has been resolved. The major issues were: * Building (and running) unit tests with @testable import in * release. (swiftpm PR #758) * Linker errors when building unit tests with wmo on linux. (SR-3034)
1 parent af8e173 commit 1ba5ce6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

utils/build-script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ class BuildScriptInvocation(object):
591591
"--libdispatch-build-type", args.libdispatch_build_variant,
592592
"--libicu-build-type", args.libicu_build_variant,
593593
"--xctest-build-type", args.build_variant,
594+
"--swiftpm-build-type", args.build_variant,
594595
"--swift-enable-assertions", str(args.swift_assertions).lower(),
595596
"--swift-stdlib-enable-assertions", str(
596597
args.swift_stdlib_assertions).lower(),

utils/build-script-impl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ KNOWN_SETTINGS=(
7878
playgroundlogger-build-type "Debug" "the build variant for PlaygroundLogger"
7979
playgroundsupport-build-type "Debug" "the build variant for PlaygroundSupport"
8080
xctest-build-type "Debug" "the build variant for xctest"
81+
swiftpm-build-type "Debug" "the build variant for swiftpm"
8182
llbuild-enable-assertions "1" "enable assertions in llbuild"
8283
enable-asan "" "enable Address Sanitizer"
8384
cmake "" "path to the cmake binary"
@@ -1755,6 +1756,10 @@ function set_swiftpm_bootstrap_command() {
17551756
exit 1
17561757
fi
17571758
swiftpm_bootstrap_command=("${SWIFTPM_SOURCE_DIR}/Utilities/bootstrap" "${swiftpm_bootstrap_options[@]}")
1759+
# Add --release if we have to build in release mode.
1760+
if [[ "${SWIFTPM_BUILD_TYPE}" == "Release" ]] ; then
1761+
swiftpm_bootstrap_command+=(--release)
1762+
fi
17581763
if [[ "${VERBOSE_BUILD}" ]] ; then
17591764
swiftpm_bootstrap_command+=(-v)
17601765
fi

0 commit comments

Comments
 (0)