Skip to content

Commit 2d457ef

Browse files
tstellarTurboGit
authored andcommitted
Fix build with clang-21
Error Message: darktable-5.2.0/data/kernels/soften.cl:33:18: error: use of undeclared identifier 'read_imagef' 33 | float4 pixel = read_imagef(in, sampleri, (int2)(x, y)); | ^~~~~~~~~~~ llvm/llvm-project@c1aebd4 wrapped all the image function declarations in the __IMAGE_SUPPORT__ macro, so darktable needs to define this macro in order to use these functions.
1 parent 0d52b5e commit 2d457ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data/kernels/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro (testcompile_opencl_kernel IN)
1515

1616
add_custom_command(
1717
OUTPUT ${TOUCH}
18-
COMMAND ${CLANG_OPENCL_COMPILER} -cc1 -cl-std=CL1.2 -isystem ${CLANG_OPENCL_INCLUDE_DIR} -finclude-default-header -I${CMAKE_CURRENT_SOURCE_DIR} ${IN}
18+
COMMAND ${CLANG_OPENCL_COMPILER} -cc1 -cl-std=CL1.2 -isystem ${CLANG_OPENCL_INCLUDE_DIR} -D__IMAGE_SUPPORT__=1 -finclude-default-header -I${CMAKE_CURRENT_SOURCE_DIR} ${IN}
1919
COMMAND ${CMAKE_COMMAND} -E touch ${TOUCH} # will be empty!
2020
DEPENDS ${IN}
2121
COMMENT "Test-compiling OpenCL program ${KERNAME}"

0 commit comments

Comments
 (0)