mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Support override CLANG_RESOURCE_DIR
The result from clang commandline is something like /usr/lib/llvm-7/lib/clang/7.0.1 Which means I need to recompile when the clang is upgraded to newer 7.x.x However the system has a convenient symlink, which is /usr/include/clang/7.
This commit is contained in:
parent
689c19a5af
commit
07ed9902e0
@ -120,6 +120,7 @@ endif()
|
||||
|
||||
# Find Clang resource directory with Clang executable.
|
||||
|
||||
if(NOT CLANG_RESOURCE_DIR)
|
||||
find_program(CLANG_EXECUTABLE clang)
|
||||
if(NOT CLANG_EXECUTABLE)
|
||||
message(FATAL_ERROR "clang executable not found.")
|
||||
@ -137,6 +138,7 @@ if(CLANG_FIND_RESOURCE_DIR_RESULT)
|
||||
message(FATAL_ERROR "Error retrieving Clang resource directory with Clang \
|
||||
executable. Output:\n ${CLANG_FIND_RESOURCE_DIR_ERROR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(SOURCE src/utils.cc APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
CLANG_RESOURCE_DIRECTORY=R"\(${CLANG_RESOURCE_DIR}\)")
|
||||
|
Loading…
Reference in New Issue
Block a user