Skip to content

Commit 488b258

Browse files
committed
improve version automation based on CMake project version
1 parent ece9144 commit 488b258

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CMakeLists.txt

+3-2
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.5
1010
LANGUAGES C)
1111

1212
find_package (Threads REQUIRED)
@@ -119,6 +119,7 @@ endif()
119119

120120
add_library (OpenCL::OpenCL ALIAS OpenCL)
121121

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

124125
if (WIN32)
@@ -156,7 +157,7 @@ set (OPENCL_COMPILE_DEFINITIONS
156157
CL_TARGET_OPENCL_VERSION=300
157158
OPENCL_ICD_LOADER_VERSION_MAJOR=3
158159
OPENCL_ICD_LOADER_VERSION_MINOR=0
159-
OPENCL_ICD_LOADER_VERSION_REV=5
160+
OPENCL_ICD_LOADER_VERSION_REV=${PROJECT_VERSION_PATCH}
160161
$<$<BOOL:${ENABLE_OPENCL_LAYERS}>:CL_ENABLE_LAYERS>
161162
)
162163

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

0 commit comments

Comments
 (0)