Skip to content

Commit 6e87083

Browse files
committed
Runtimes: attempt to wire in the build number into the version
This is in preparation for using Win32 SxS assembly manifests to permit co-installation of the runtimes on Windows without an ABI consideration and allow users to select between the revision.
1 parent 772cff1 commit 6e87083

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ list(APPEND CMAKE_MODULE_PATH ${SwiftCore_CMAKE_MODULES_DIR})
4141
include(CMakeWorkarounds)
4242
# NOTE: always use the 3-component style as the expansion as
4343
# `${PROJECT_VERSION}` will not extend this to the complete form and this can
44-
# change the behaviour for comparison with non-SemVer compliant parsing.
45-
project(SwiftCore LANGUAGES C CXX Swift VERSION 6.1.0)
44+
# change the behaviour for comparison with non-SemVer compliant parsing. If
45+
# possible, use the 4-version component as that is used to differentiate the
46+
# builds of the runtime for Windows.
47+
if($ENV{BUILD_NUMBER})
48+
# NOTE: SxS modules have a limit on each component being [0-65535].
49+
# https://learn.microsoft.com/en-us/windows/win32/sbscs/assembly-versions
50+
math(EXPR BUILD_NUMBER "$ENV{BUILD_NUMBER} % 65535")
51+
set(BUILD_NUMBER ".${BUILD_NUMBER}")
52+
endif()
53+
project(SwiftCore
54+
LANGUAGES C CXX Swift
55+
VERSION 6.1.0${BUILD_NUMBER})
4656

4757
# The Swift standard library is not intended for use as a sub-library as part of
4858
# another project. It is tightly coupled with the compiler version.

0 commit comments

Comments
 (0)