mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 08:35:08 +00:00
cmake: add option to use system rapidjson if exists
This commit is contained in:
parent
ba68f49861
commit
e73f5791bf
@ -7,6 +7,7 @@ include(DefaultCMakeBuildType)
|
|||||||
# Required Clang version
|
# Required Clang version
|
||||||
option(LLVM_ENABLE_RTTI "-fno-rtti if OFF. This should match LLVM libraries" OFF)
|
option(LLVM_ENABLE_RTTI "-fno-rtti if OFF. This should match LLVM libraries" OFF)
|
||||||
option(USE_SHARED_LLVM "Link against libLLVM.so instead separate LLVM{Option,Support,...}" OFF)
|
option(USE_SHARED_LLVM "Link against libLLVM.so instead separate LLVM{Option,Support,...}" OFF)
|
||||||
|
option(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" ON)
|
||||||
|
|
||||||
# Sources for the executable are specified at end of CMakeLists.txt
|
# Sources for the executable are specified at end of CMakeLists.txt
|
||||||
add_executable(ccls "")
|
add_executable(ccls "")
|
||||||
@ -95,9 +96,15 @@ target_compile_definitions(ccls PRIVATE
|
|||||||
### Includes
|
### Includes
|
||||||
|
|
||||||
target_include_directories(ccls PRIVATE src)
|
target_include_directories(ccls PRIVATE src)
|
||||||
target_include_directories(ccls SYSTEM PRIVATE
|
target_include_directories(ccls SYSTEM PRIVATE third_party)
|
||||||
third_party
|
|
||||||
third_party/rapidjson/include)
|
if(USE_SYSTEM_RAPIDJSON)
|
||||||
|
find_package(RapidJSON QUIET)
|
||||||
|
endif()
|
||||||
|
if(NOT RapidJSON_FOUND)
|
||||||
|
set(RapidJSON_INCLUDE_DIRS third_party/rapidjson/include)
|
||||||
|
endif()
|
||||||
|
target_include_directories(ccls SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS})
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user