Skip to content

Commit e9d59b8

Browse files
authored
Add OPENCL_CLANG_ prefix to PCH_EXTENSION/EXCLUDE_LIBS_FROM_ALL (#471)
When opencl-clang is used in-tree of a project, these two variables may be defined in CMakeLists.txt of the project. This PR makes the variable names clear that they are intended for opencl-clang library and easily distinguishable from other variables in CMakeLists.txt of the project.
1 parent 9f1f948 commit e9d59b8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ if (NOT DEFINED OPENCL_CLANG_LIBRARY_NAME)
112112
endif()
113113
set(TARGET_NAME ${OPENCL_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
114114

115-
# PCH_EXTENSION can override PCH extension map in options_compile.cpp.
115+
# OPENCL_CLANG_PCH_EXTENSION can override PCH extension map in options_compile.cpp.
116116
# Example: "cl_khr_3d_image_writes,cl_khr_depth_images"
117-
set(PCH_EXTENSION "" CACHE STRING "Comma-separated list of OpenCL extensions")
118-
if (NOT "${PCH_EXTENSION}" STREQUAL "")
119-
add_definitions(-DPCH_EXTENSION="${PCH_EXTENSION}")
117+
set(OPENCL_CLANG_PCH_EXTENSION "" CACHE STRING "Comma-separated list of OpenCL extensions")
118+
if (NOT "${OPENCL_CLANG_PCH_EXTENSION}" STREQUAL "")
119+
add_definitions(-DPCH_EXTENSION="${OPENCL_CLANG_PCH_EXTENSION}")
120120
endif()
121121

122122
if(NOT USE_PREBUILT_LLVM)
@@ -298,10 +298,10 @@ else()
298298
)
299299
endif()
300300

301-
set(EXCLUDE_LIBS_FROM_ALL "" CACHE STRING "Space-separated list of LLVM libraries to exclude from all")
301+
set(OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL "" CACHE STRING "Space-separated list of LLVM libraries to exclude from all")
302302
llvm_map_components_to_libnames(ALL_LLVM_LIBS all)
303-
if (NOT "${EXCLUDE_LIBS_FROM_ALL}" STREQUAL "")
304-
list(REMOVE_ITEM ALL_LLVM_LIBS ${EXCLUDE_LIBS_FROM_ALL})
303+
if (NOT "${OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL}" STREQUAL "")
304+
list(REMOVE_ITEM ALL_LLVM_LIBS ${OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL})
305305
endif()
306306
list(APPEND OPENCL_CLANG_LINK_LIBS ${ALL_LLVM_LIBS})
307307

0 commit comments

Comments
 (0)