Skip to content
Snippets Groups Projects
Commit 5dc567a4 authored by Joe Donofry's avatar Joe Donofry
Browse files

Update JSON build dependency

I think I finally worked out the issues w/ linking against the
nlohmann JSON library.  I have updated the build and the various
CI scripts.
parent 9592d830
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,6 @@ if [ $TRAVIS_OS_NAME == osx ]; then
brew update || true
brew upgrade boost || true
brew install libsodium clang-format
brew tap nlohmann/json
brew install nlohmann_json
fi
......@@ -32,6 +32,7 @@ if [ $TRAVIS_OS_NAME == osx ]; then
cmake -Hdeps -B.deps -DCMAKE_BUILD_TYPE=Release \
-DUSE_BUNDLED_BOOST=OFF \
-DUSE_BUNDLED_GTEST=OFF
-DUSE_BUNDLED_JSON=OFF
cmake --build .deps
# Build the library.
......
......@@ -170,7 +170,8 @@ target_link_libraries(matrix_client
OpenSSL::Crypto
OpenSSL::SSL
Olm::Olm
ZLIB::ZLIB)
ZLIB::ZLIB
nlohmann_json::nlohmann_json)
if(NOT MSVC AND NOT APPLE)
target_link_libraries(matrix_client PUBLIC Threads::Threads)
......
......@@ -10,7 +10,7 @@ help: ## This help message
@# Change the digit following by an 's' to adjust the width of the help text
third-party: ## Build & install third party dependencies
@cmake -GNinja -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_BOOST=OFF
@cmake -GNinja -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_BOOST=OFF -DUSE_BUNDLED_JSON=OFF
@cmake --build ${DEPS_BUILD_DIR}
debug: ## Create a debug build
......
......@@ -38,6 +38,7 @@ build_script:
-DUSE_BUNDLED_BOOST=OFF
-DUSE_BUNDLED_SPDLOG=OFF
-DUSE_BUNDLED_GTEST=OFF
-DUSE_BUNDLED_JSON=OFF
- cmake --build .deps --config Release
- cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild
......
......@@ -26,6 +26,7 @@ option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${USE_BUNDLED})
option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${USE_BUNDLED})
option(USE_BUNDLED_GTEST "Use the bundled version of Google Test."
${USE_BUNDLED})
option(USE_BUNDLED_JSON "Use the bundled version of nlohmann json." ${USE_BUNDLED})
option(USE_EXISTING_SRC_DIR
"Skip download of deps sources in case of existing source directory."
......@@ -53,13 +54,14 @@ set(SPDLOG_URL https://github.com/gabime/spdlog/archive/v1.1.0.tar.gz)
set(SPDLOG_HASH
3dbcbfd8c07e25f5e0d662b194d3a7772ef214358c49ada23c044c4747ce8b19)
set(JSON_HEADER_URL
https://github.com/nlohmann/json/releases/download/v3.2.0/json.hpp)
set(JSON_HEADER_HASH
ce6b5610a051ec6795fa11c33854abebb086f0fd67c311f5921c3c07f9531b44)
set(JSON_URL
https://github.com/nlohmann/json.git)
set(JSON_TAG
v3.2.0)
file(DOWNLOAD ${JSON_HEADER_URL} ${DEPS_INSTALL_DIR}/nlohmann/include/json.hpp
EXPECTED_HASH SHA256=${JSON_HEADER_HASH})
if(USE_BUNDLED_JSON)
include(Json)
endif()
if(USE_BUNDLED_BOOST)
include(Boost)
......
ExternalProject_Add(
Json
GIT_REPOSITORY ${JSON_URL}
GIT_TAG ${JSON_TAG}
BUILD_IN_SOURCE 1
SOURCE_DIR ${DEPS_BUILD_DIR}/json
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DJSON_BuildTests=OFF
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}/json
INSTALL_COMMAND make install
)
list(APPEND THIRD_PARTY_DEPS Json)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment