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 "" )
@@ -96,8 +97,16 @@ target_compile_definitions(ccls PRIVATE
9697
9798target_include_directories (ccls PRIVATE src )
9899target_include_directories (ccls SYSTEM PRIVATE
99- third_party
100- third_party/rapidjson/include )
100+ third_party )
101+
102+ if (USE_SYSTEM_RAPIDJSON)
103+ find_package (RapidJSON QUIET )
104+ endif ()
105+ if (RapidJSON_FOUND)
106+ target_include_directories (ccls SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS} )
107+ else ()
108+ target_include_directories (ccls SYSTEM PRIVATE third_party/rapidjson/include )
109+ endif ()
101110
102111### Install
103112
You can’t perform that action at this time.
0 commit comments