Skip to content

Commit 9a7f3f3

Browse files
committed
improve version automation based on CMake project version
1 parent 2e35ae7 commit 9a7f3f3

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(TARGET OpenCL)
66
endif()
77

88
project (OpenCL-ICD-Loader
9-
VERSION 1.2
9+
VERSION 1.2.3
1010
LANGUAGES C)
1111

1212
find_package (Threads REQUIRED)
@@ -106,8 +106,11 @@ endif()
106106

107107
add_library (OpenCL::OpenCL ALIAS OpenCL)
108108

109+
# We could eventually use OpenCL-ICD-Loader_VERSION or PROJECT_VERSION here instead of a hardcoded 1.2.
109110
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
110111

112+
target_compile_definitions (OpenCL PRIVATE OPENCL_ICD_LOADER_VERSION_REV=${PROJECT_VERSION_PATCH})
113+
111114
if (WIN32)
112115
target_link_libraries (OpenCL PRIVATE cfgmgr32.lib runtimeobject.lib)
113116

loader/icd.c

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void khrIcdInitializeTrace(void)
4343
{
4444
khrEnableTrace = 1;
4545
}
46+
KHR_ICD_TRACE("OpenCL ICD Loader Revision %u\n", OPENCL_ICD_LOADER_VERSION_REV);
4647
}
4748

4849
// entrypoint to initialize the ICD and add all vendors

loader/windows/OpenCL.rc

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#define OPENCL_ICD_LOADER_VERSION_MAJOR 3
2222
#define OPENCL_ICD_LOADER_VERSION_MINOR 0
23-
#define OPENCL_ICD_LOADER_VERSION_REV 3
2423

2524
#ifdef RC_INVOKED
2625

0 commit comments

Comments
 (0)