Skip to content

Commit 919bc88

Browse files
committed
Use SWIFT_COMPILER_VERSION before SWIFT_TOOLCHAIN_VERSION if it exists
We should eventually split these, but for now SWIFT_COMPILER_VERSION matches SWIFT_TOOLCHAIN_VERSION when it's actually set. Just use it in preference to SWIFT_TOOLCHAIN_VERSION. (cherry picked from commit ec46a4f)
1 parent 478d16a commit 919bc88

File tree

1 file changed

+8
-6
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+8
-6
lines changed

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,18 @@ def _compiler_vendor_flags(self):
165165
def _version_flags(self):
166166
r = CMakeOptions()
167167
if self.args.swift_compiler_version is not None:
168-
swift_compiler_version = self.args.swift_compiler_version
169-
r.define('SWIFT_COMPILER_VERSION', str(swift_compiler_version))
168+
swift_compiler_version = str(self.args.swift_compiler_version)
169+
r.define('SWIFT_COMPILER_VERSION', swift_compiler_version)
170+
r.define('SWIFT_TOOLCHAIN_VERSION', "swiftlang-" + swift_compiler_version)
171+
else:
172+
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
173+
if toolchain_version:
174+
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
175+
170176
if self.args.clang_compiler_version is not None:
171177
clang_compiler_version = self.args.clang_compiler_version
172178
r.define('CLANG_COMPILER_VERSION', str(clang_compiler_version))
173179

174-
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
175-
if toolchain_version:
176-
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
177-
178180
return r
179181

180182
@property

0 commit comments

Comments
 (0)