mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
cmake: Fail loudly when found rapidjson is too old (#646)
When the rapidjson found by cmake is an older version it defines a variable RAPIDJSON_INCLUDE_DIRS instead of RapidJSON_INCLUDE_DIRS (#455). According to #383 we do not want to make these older version work with ccls. However currently if the rapidjson found by cmake is an older version that defined RAPIDJSON_INCLUDE_DIRS, then the cmake invocation still succeeds but any build command will fail because RapidJSON_INCLUDE_DIRS was never set properly. This makes the cmake invocation fail with a relevant error message in this event.
This commit is contained in:
parent
c5acf62060
commit
7a05f1ed06
@ -151,6 +151,9 @@ set_property(SOURCE src/utils.cc APPEND PROPERTY COMPILE_DEFINITIONS
|
|||||||
|
|
||||||
if(USE_SYSTEM_RAPIDJSON)
|
if(USE_SYSTEM_RAPIDJSON)
|
||||||
find_package(RapidJSON QUIET)
|
find_package(RapidJSON QUIET)
|
||||||
|
if(NOT DEFINED RapidJSON_INCLUDE_DIRS AND DEFINED RAPIDJSON_INCLUDE_DIRS)
|
||||||
|
message(FATAL_ERROR "RapidJSON version is likely too old. See https://github.com/MaskRay/ccls/issues/455")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT RapidJSON_FOUND)
|
if(NOT RapidJSON_FOUND)
|
||||||
set(RapidJSON_INCLUDE_DIRS third_party/rapidjson/include)
|
set(RapidJSON_INCLUDE_DIRS third_party/rapidjson/include)
|
||||||
|
Loading…
Reference in New Issue
Block a user