mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-08 01:04:54 +00:00
use local rapidjson if available
This commit is contained in:
parent
5e15f51681
commit
cf91d41345
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "third_party/rapidjson"]
|
|
||||||
path = third_party/rapidjson
|
|
||||||
url = https://github.com/Tencent/rapidjson
|
|
@ -1,6 +1,14 @@
|
|||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
project(ccls LANGUAGES CXX)
|
project(ccls LANGUAGES CXX)
|
||||||
|
|
||||||
|
### Colored output
|
||||||
|
if(NOT WIN32)
|
||||||
|
string(ASCII 27 Esc)
|
||||||
|
set(Green "${Esc}[32m")
|
||||||
|
set(BoldBlue "${Esc}[1;34m")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
|
||||||
include(DefaultCMakeBuildType)
|
include(DefaultCMakeBuildType)
|
||||||
|
|
||||||
@ -92,12 +100,48 @@ endif()
|
|||||||
target_compile_definitions(ccls PRIVATE
|
target_compile_definitions(ccls PRIVATE
|
||||||
DEFAULT_RESOURCE_DIRECTORY=R"\(${Clang_RESOURCE_DIR}\)")
|
DEFAULT_RESOURCE_DIRECTORY=R"\(${Clang_RESOURCE_DIR}\)")
|
||||||
|
|
||||||
|
|
||||||
|
### use local installed RapidJSON or FETCH from git via cmake
|
||||||
|
find_package(RapidJSON QUIET)
|
||||||
|
if(RapidJSON_FOUND)
|
||||||
|
message("${BoldBlue}\nRapidJSON has been installed by your system before cloning ccls\n\n${ColourReset}")
|
||||||
|
include_directories(${RapidJSON_INCLUDE_DIRS})
|
||||||
|
else()
|
||||||
|
message("${Green}====> Downloading RapidJSON ---- A fast JSON parser/generator for C++ with both SAX/DOM style API http://rapidjson.org/
|
||||||
|
${ColourReset}")
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
rapidjson
|
||||||
|
GIT_REPOSITORY https://github.com/Tencent/rapidjson
|
||||||
|
GIT_TAG master
|
||||||
|
)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(rapidjson)
|
||||||
|
if (NOT rapidjson_POPULATED)
|
||||||
|
FetchContent_Populate(rapidjson)
|
||||||
|
|
||||||
|
message(${rapidjson_SOURCE_DIR})
|
||||||
|
message(${rapidjson_BINARY_DIR})
|
||||||
|
add_subdirectory(${rapidjson_SOURCE_DIR})
|
||||||
|
message("${BoldBlue}\ngit clone RapidJSON successfully!\n\n${ColourReset}")
|
||||||
|
set(INCLUDE_DIRS ${rapidjson_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
message("${BoldBlue}\n${rapidjson_SOURCE_DIR}/include ${ColourReset}")
|
||||||
|
message("${BoldBlue}\n${INCLUDE_DIRS} ${ColourReset}")
|
||||||
|
target_include_directories(ccls PUBLIC
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
### 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)
|
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
|
1
third_party/rapidjson
vendored
1
third_party/rapidjson
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit 6a905f9311f82d306da77bd963ec5aa5da07da9c
|
|
Loading…
Reference in New Issue
Block a user