Skip to content

Commit 3167055

Browse files
build: correct OCL version setting
- ignore hotfix number if NEO_VERSION_HOTFIX was set to 0 - respect hotfix number if NEO_VERSION_BUILD contains both build and hotfix even if NEO_VERSION_BUILD has hotfix number 0 - detect inconsistent setting of hotfix number Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com> Source: 71a9731
1 parent e2fb3ce commit 3167055

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

version.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,26 @@ else()
1414
set(NEO_REVISION ${NEO_VERSION_BUILD})
1515
endif()
1616

17+
if(NOT DEFINED NEO_VERSION_HOTFIX)
18+
set(NEO_VERSION_HOTFIX 0)
19+
endif()
20+
21+
set(NEO_OCL_VERSION_SUFFIX "")
22+
if(NOT ("${NEO_VERSION_HOTFIX}" STREQUAL "0"))
23+
set(NEO_OCL_VERSION_SUFFIX ".${NEO_VERSION_HOTFIX}")
24+
endif()
25+
1726
if(NEO_VERSION_BUILD MATCHES "^([0-9]+)\\.([0-9]+)$")
1827
set(NEO_VERSION_BUILD "${CMAKE_MATCH_1}")
19-
if(DEFINED NEO_VERSION_HOTFIX AND NOT ("${NEO_VERSION_HOTFIX}" STREQUAL "${CMAKE_MATCH_2}"))
28+
if(NOT ("${NEO_OCL_VERSION_SUFFIX}" STREQUAL "") AND NOT ("${NEO_OCL_VERSION_SUFFIX}" STREQUAL ".${CMAKE_MATCH_2}"))
2029
message(FATAL_ERROR "Inconsistent hotfix version provided: ${NEO_VERSION_HOTFIX} vs ${CMAKE_MATCH_2}")
2130
endif()
2231
set(NEO_VERSION_HOTFIX "${CMAKE_MATCH_2}")
23-
endif()
24-
25-
if(NOT DEFINED NEO_VERSION_HOTFIX)
26-
set(NEO_VERSION_HOTFIX 0)
32+
set(NEO_OCL_VERSION_SUFFIX ".${NEO_VERSION_HOTFIX}")
2733
endif()
2834

2935
# OpenCL package version
30-
set(NEO_OCL_DRIVER_VERSION "${NEO_OCL_VERSION_MAJOR}.${NEO_OCL_VERSION_MINOR}.${NEO_VERSION_BUILD}")
31-
32-
if(NOT ("${NEO_VERSION_HOTFIX}" STREQUAL "0"))
33-
set(NEO_OCL_DRIVER_VERSION "${NEO_OCL_DRIVER_VERSION}.${NEO_VERSION_HOTFIX}")
34-
endif()
36+
set(NEO_OCL_DRIVER_VERSION "${NEO_OCL_VERSION_MAJOR}.${NEO_OCL_VERSION_MINOR}.${NEO_VERSION_BUILD}${NEO_OCL_VERSION_SUFFIX}")
3537

3638
# Level-Zero package version
3739
set(NEO_L0_VERSION_MAJOR 1)

0 commit comments

Comments
 (0)