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 ec46a4f026)
This commit is contained in:
Ben Barham
2025-06-25 16:59:43 -07:00
parent 478d16ab5f
commit 919bc88a31

View File

@@ -165,16 +165,18 @@ updated without updating swift.py?")
def _version_flags(self):
r = CMakeOptions()
if self.args.swift_compiler_version is not None:
swift_compiler_version = self.args.swift_compiler_version
r.define('SWIFT_COMPILER_VERSION', str(swift_compiler_version))
swift_compiler_version = str(self.args.swift_compiler_version)
r.define('SWIFT_COMPILER_VERSION', swift_compiler_version)
r.define('SWIFT_TOOLCHAIN_VERSION', "swiftlang-" + swift_compiler_version)
else:
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
if toolchain_version:
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
if self.args.clang_compiler_version is not None:
clang_compiler_version = self.args.clang_compiler_version
r.define('CLANG_COMPILER_VERSION', str(clang_compiler_version))
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
if toolchain_version:
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
return r
@property