Skip to content

Commit 3a272d0

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.
1 parent 7d338f2 commit 3a272d0

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
@@ -167,16 +167,18 @@ def _compiler_vendor_flags(self):
167167
def _version_flags(self):
168168
r = CMakeOptions()
169169
if self.args.swift_compiler_version is not None:
170-
swift_compiler_version = self.args.swift_compiler_version
171-
r.define('SWIFT_COMPILER_VERSION', str(swift_compiler_version))
170+
swift_compiler_version = str(self.args.swift_compiler_version)
171+
r.define('SWIFT_COMPILER_VERSION', swift_compiler_version)
172+
r.define('SWIFT_TOOLCHAIN_VERSION', swift_compiler_version)
173+
else:
174+
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
175+
if toolchain_version:
176+
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
177+
172178
if self.args.clang_compiler_version is not None:
173179
clang_compiler_version = self.args.clang_compiler_version
174180
r.define('CLANG_COMPILER_VERSION', str(clang_compiler_version))
175181

176-
toolchain_version = os.environ.get('TOOLCHAIN_VERSION')
177-
if toolchain_version:
178-
r.define('SWIFT_TOOLCHAIN_VERSION', toolchain_version)
179-
180182
return r
181183

182184
@property

0 commit comments

Comments
 (0)