Use master rapidjson for discord-rpc (fixes #123)
This commit is contained in:
20
external/discord_rpc/CMakeLists.txt
vendored
20
external/discord_rpc/CMakeLists.txt
vendored
@@ -32,21 +32,15 @@ execute_process(
|
|||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
)
|
)
|
||||||
|
|
||||||
find_file(RAPIDJSONTEST NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH)
|
include(FetchContent)
|
||||||
if (NOT RAPIDJSONTEST)
|
|
||||||
message("no rapidjson, download")
|
|
||||||
set(RJ_TAR_FILE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/v1.1.0.tar.gz)
|
|
||||||
file(DOWNLOAD https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz ${RJ_TAR_FILE})
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E tar xzf ${RJ_TAR_FILE}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty
|
|
||||||
)
|
|
||||||
file(REMOVE ${RJ_TAR_FILE})
|
|
||||||
endif(NOT RAPIDJSONTEST)
|
|
||||||
|
|
||||||
find_file(RAPIDJSON NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH)
|
FetchContent_Declare(
|
||||||
|
rapidjson
|
||||||
|
GIT_REPOSITORY https://github.com/Tencent/rapidjson
|
||||||
|
GIT_TAG 24b5e7a8b27f42fa16b96fc70aade9106cf7102f
|
||||||
|
)
|
||||||
|
|
||||||
add_library(rapidjson STATIC IMPORTED ${RAPIDJSON})
|
FetchContent_MakeAvailable(rapidjson)
|
||||||
|
|
||||||
# add subdirs
|
# add subdirs
|
||||||
|
|
||||||
|
|||||||
2
external/discord_rpc/src/CMakeLists.txt
vendored
2
external/discord_rpc/src/CMakeLists.txt
vendored
@@ -109,7 +109,7 @@ if(UNIX)
|
|||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
target_include_directories(discord-rpc PRIVATE ${RAPIDJSON}/include)
|
target_include_directories(discord-rpc PRIVATE ${rapidjson_SOURCE_DIR}/include)
|
||||||
|
|
||||||
if (NOT ${ENABLE_IO_THREAD})
|
if (NOT ${ENABLE_IO_THREAD})
|
||||||
target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DISABLE_IO_THREAD)
|
target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DISABLE_IO_THREAD)
|
||||||
|
|||||||
Reference in New Issue
Block a user