Skip to content

Commit f7a838d

Browse files
committed
Build-script: propagate the build type to the xctest build script
1 parent cf3fdff commit f7a838d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

utils/build-script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ class BuildScriptInvocation(object):
594594
"--swift-stdlib-build-type", args.swift_stdlib_build_variant,
595595
"--lldb-build-type", args.lldb_build_variant,
596596
"--foundation-build-type", args.foundation_build_variant,
597+
"--xctest-build-type", args.build_variant,
597598
"--llvm-enable-assertions", str(args.llvm_assertions).lower(),
598599
"--swift-enable-assertions", str(args.swift_assertions).lower(),
599600
"--swift-stdlib-enable-assertions", str(

utils/build-script-impl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ KNOWN_SETTINGS=(
8585
lldb-build-type "Debug" "the CMake build variant for LLDB"
8686
llbuild-build-type "Debug" "the CMake build variant for llbuild"
8787
foundation-build-type "Debug" "the build variant for Foundation"
88+
xctest-build-type "Debug" "the build variant for xctest"
8889
llbuild-enable-assertions "1" "enable assertions in llbuild"
8990
enable-asan "" "enable Address Sanitizer"
9091
enable-ubsan "" "enable Undefined Behavior Sanitizer"
@@ -2104,13 +2105,19 @@ for host in "${ALL_HOSTS[@]}"; do
21042105
copy_swift_stdlib_tool_substitute "$(build_directory_bin ${host} swift)/swift-stdlib-tool"
21052106
fi
21062107

2107-
# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
2108-
# set) to build either --debug or --release.
2108+
# Use XCTEST_BUILD_TYPE to build either --debug or --release.
2109+
if [[ "${XCTEST_BUILD_TYPE}" == "Debug" ]] ; then
2110+
XCTEST_BUILD_ARGS="--debug"
2111+
else
2112+
XCTEST_BUILD_ARGS="--release"
2113+
fi
2114+
21092115
call "${XCTEST_SOURCE_DIR}"/build_script.py \
21102116
--swiftc="${SWIFTC_BIN}" \
21112117
--build-dir="${XCTEST_BUILD_DIR}" \
21122118
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
2113-
$LIBDISPATCH_BUILD_ARGS
2119+
$LIBDISPATCH_BUILD_ARGS \
2120+
$XCTEST_BUILD_ARGS
21142121

21152122
# XCTest builds itself and doesn't rely on cmake
21162123
continue

0 commit comments

Comments
 (0)