Skip to content

Commit d41707e

Browse files
authored
Add XRT_BUILD_NUMBER CMake variable for use by upstream builds (#9507)
Upstream projects cannot set XRT_VERSION_PATCH directory as it is reset by project(xrt). Instead upstream builds sets XRT_BUILD_NUMBER which is then used here to explicitly set XRT_VERSION_PATCH. Signed-off-by: Soren Soe <[email protected]>
1 parent 5c6def2 commit d41707e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/CMake/settings.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ set(XRT_VERSION_RELEASE 202610)
6060
set(XRT_VERSION_MAJOR 2)
6161
set(XRT_VERSION_MINOR 21)
6262

63-
if (XRT_VERSION_PATCH)
64-
set(XRT_VERSION_PATCH ${XRT_VERSION_PATCH})
63+
# Upstream builds cannot set XRT_VERSION_PATCH directory as it is
64+
# reset by project(xrt). Instead upstream builds sets
65+
# XRT_BUILD_NUMBER which is then used here
66+
if (XRT_BUILD_NUMBER)
67+
set(XRT_VERSION_PATCH ${XRT_BUILD_NUMBER})
6568
elseif (DEFINED ENV{XRT_VERSION_PATCH})
6669
set(XRT_VERSION_PATCH $ENV{XRT_VERSION_PATCH})
6770
else()
6871
set(XRT_VERSION_PATCH 0)
69-
endif(XRT_VERSION_PATCH)
72+
endif()
7073

7174
# Also update cache to set version for external plug-in .so
7275
set(XRT_SOVERSION ${XRT_VERSION_MAJOR} CACHE INTERNAL "")

0 commit comments

Comments
 (0)