Skip to content

Commit f26af0e

Browse files
authored
Merge pull request #82096 from bnbarham/cherry-pass-through-toolchain-version
[6.2][Build] Pass the toolchain version through to Swift's compilation
2 parents 3ed5570 + 849cd8e commit f26af0e

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
@@ -1758,6 +1758,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [switch] $Test) {
17581758
Python3_INCLUDE_DIR = "$PythonRoot\include";
17591759
Python3_LIBRARY = "$PythonRoot\libs\$PythonLibName.lib";
17601760
Python3_ROOT_DIR = $PythonRoot;
1761+
SWIFT_TOOLCHAIN_VERSION = "${ToolchainIdentifier}";
17611762
SWIFT_BUILD_SWIFT_SYNTAX = "YES";
17621763
SWIFT_CLANG_LOCATION = (Get-PinnedToolchainToolsDir);
17631764
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
@@ -168,6 +170,11 @@ def _version_flags(self):
168170
if self.args.clang_compiler_version is not None:
169171
clang_compiler_version = self.args.clang_compiler_version
170172
r.define('CLANG_COMPILER_VERSION', str(clang_compiler_version))
173+
174+
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
175+
if toolchain_version:
176+
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
177+
171178
return r
172179

173180
@property

0 commit comments

Comments
 (0)