Skip to content

Commit 0afeafa

Browse files
authored
Merge pull request #82071 from bnbarham/pass-through-toolchain-version
[Build] Pass the toolchain version through to Swift's compilation
2 parents 2afb6b5 + 3982ebb commit 0afeafa

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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";

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#
1111
# ----------------------------------------------------------------------------
1212

13+
import os
14+
1315
from build_swift.build_swift.constants import SWIFT_REPO_NAME
1416

1517
from . import cmark
@@ -170,6 +172,11 @@ def _version_flags(self):
170172
if self.args.clang_compiler_version is not None:
171173
clang_compiler_version = self.args.clang_compiler_version
172174
r.define('CLANG_COMPILER_VERSION', str(clang_compiler_version))
175+
176+
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
177+
if toolchain_version:
178+
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
179+
173180
return r
174181

175182
@property

0 commit comments

Comments
 (0)