Skip to content

Commit 2261761

Browse files
committed
[Build] Pass the toolchain version through to Swift's compilation
Passes the value of the environment variable `TOOLCHAIN_VERSION` through to Swift's `SWIFT_TOOLCHAIN_VERSION` for use in eg. `-print-target-info` (and some day, `--version`).
1 parent 5dadb5d commit 2261761

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

utils/build-script-impl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,13 @@ for host in "${ALL_HOSTS[@]}"; do
15661566
)
15671567
fi
15681568

1569+
if [[ "${TOOLCHAIN_VERSION}" ]] ; then
1570+
swift_cmake_options=(
1571+
"${swift_cmake_options[@]}"
1572+
-DSWIFT_TOOLCHAIN_VERSION:STRING="${TOOLCHAIN_VERSION}"
1573+
)
1574+
fi
1575+
15691576
if [[ "${NATIVE_CLANG_TOOLS_PATH}" ]] ; then
15701577
CLANG_BIN="${NATIVE_CLANG_TOOLS_PATH}"
15711578
if [[ ! -f "${CLANG_BIN}/clang" ]] ; then

utils/build.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [switch] $Test) {
18281828
Python3_INCLUDE_DIR = "$PythonRoot\include";
18291829
Python3_LIBRARY = "$PythonRoot\libs\$PythonLibName.lib";
18301830
Python3_ROOT_DIR = $PythonRoot;
1831+
SWIFT_TOOLCHAIN_VERSION = "${ToolchainIdentifier}";
18311832
SWIFT_BUILD_SWIFT_SYNTAX = "YES";
18321833
SWIFT_CLANG_LOCATION = (Get-PinnedToolchainToolsDir);
18331834
SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY = "YES";

0 commit comments

Comments
 (0)