File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ include(DefaultCMakeBuildType)
77# Required Clang version
88option (LLVM_ENABLE_RTTI "-fno-rtti if OFF. This should match LLVM libraries" OFF )
99option (USE_SHARED_LLVM "Link against libLLVM.so instead separate LLVM{Option,Support,...}" OFF )
10+ option (USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" ON )
1011
1112# Sources for the executable are specified at end of CMakeLists.txt
1213add_executable (ccls "" )
@@ -95,9 +96,16 @@ target_compile_definitions(ccls PRIVATE
9596### Includes
9697
9798target_include_directories (ccls PRIVATE src )
98- target_include_directories (ccls SYSTEM PRIVATE
99- third_party
100- third_party/rapidjson/include )
99+ target_include_directories (ccls SYSTEM PRIVATE third_party )
100+
101+ if (USE_SYSTEM_RAPIDJSON)
102+ find_package (RapidJSON QUIET )
103+ endif ()
104+ if (RapidJSON_FOUND)
105+ target_include_directories (ccls SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS} )
106+ else ()
107+ target_include_directories (ccls SYSTEM PRIVATE third_party/rapidjson/include )
108+ endif ()
101109
102110### Install
103111
You can’t perform that action at this time.
0 commit comments