mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
⬆️ Upgrade boost json to v1.90.0 (#425)
replace deprecated standalone with full release with one component
This commit is contained in:
@@ -4,7 +4,7 @@ inputs:
|
|||||||
version:
|
version:
|
||||||
description: The desired Boost.JSON version to install
|
description: The desired Boost.JSON version to install
|
||||||
required: false
|
required: false
|
||||||
default: "1.78.0"
|
default: "1.90.0"
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -13,32 +13,36 @@ if [[ -z "$1" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
|
|||||||
echo " VERSION Boost.JSON version to install (required)"
|
echo " VERSION Boost.JSON version to install (required)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Examples:"
|
echo "Examples:"
|
||||||
echo " $0 1.78.0"
|
echo " $0 1.90.0"
|
||||||
|
echo " $0 1.89.0"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BOOST_JSON_VERSION="$1"
|
BOOST_JSON_VERSION="$1"
|
||||||
INSTALL_DIR="/tmp"
|
INSTALL_DIR="/tmp"
|
||||||
BUILD_DIR="${INSTALL_DIR}/json-boost-${BOOST_JSON_VERSION}"
|
BUILD_DIR="${INSTALL_DIR}/boost-${BOOST_JSON_VERSION}"
|
||||||
|
|
||||||
echo "Installing Boost.JSON v${BOOST_JSON_VERSION}..."
|
echo "Installing Boost.JSON v${BOOST_JSON_VERSION}..."
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
echo "Downloading Boost.JSON v${BOOST_JSON_VERSION}..."
|
echo "Downloading Boost.JSON v${BOOST_JSON_VERSION}..."
|
||||||
cd "${INSTALL_DIR}"
|
cd "${INSTALL_DIR}"
|
||||||
wget -q "https://github.com/boostorg/json/archive/boost-${BOOST_JSON_VERSION}.tar.gz"
|
wget -q "https://github.com/boostorg/boost/releases/download/boost-${BOOST_JSON_VERSION}/boost-${BOOST_JSON_VERSION}-cmake.tar.xz"
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
echo "Extracting archive..."
|
echo "Extracting archive..."
|
||||||
tar -zxf "boost-${BOOST_JSON_VERSION}.tar.gz"
|
tar -xf "boost-${BOOST_JSON_VERSION}-cmake.tar.xz"
|
||||||
|
|
||||||
# Install
|
# Build and install
|
||||||
|
echo "Building and installing..."
|
||||||
cd "${BUILD_DIR}"
|
cd "${BUILD_DIR}"
|
||||||
sudo cp -vR include/boost /usr/local/include
|
cmake . -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDE_LIBRARIES="json"
|
||||||
|
cmake --build . --config Release
|
||||||
|
sudo cmake --install .
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -f "${INSTALL_DIR}/boost-${BOOST_JSON_VERSION}.tar.gz"
|
rm -f "${INSTALL_DIR}/boost-${BOOST_JSON_VERSION}-cmake.tar.xz"
|
||||||
rm -rf "${BUILD_DIR}"
|
rm -rf "${BUILD_DIR}"
|
||||||
|
|
||||||
echo "✓ Boost.JSON v${BOOST_JSON_VERSION} installed successfully!"
|
echo "✓ Boost.JSON v${BOOST_JSON_VERSION} installed successfully!"
|
||||||
|
|||||||
2
.github/workflows/traits.yml
vendored
2
.github/workflows/traits.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- { name: "danielaparker-jsoncons", tag: "1.3.2", version: "v1.3.2" }
|
- { name: "danielaparker-jsoncons", tag: "1.3.2", version: "v1.3.2" }
|
||||||
- { name: "boost-json", tag: "1.78.0", version: "v1.80.0" }
|
- { name: "boost-json", tag: "1.90.0", version: "v1.90.0" }
|
||||||
- { name: "nlohmann-json", tag: "3.12.0", version: "v3.12.0" }
|
- { name: "nlohmann-json", tag: "3.12.0", version: "v3.12.0" }
|
||||||
- { name: "kazuho-picojson", tag: "111c9be5188f7350c2eac9ddaedd8cca3d7bf394", version: "111c9be" }
|
- { name: "kazuho-picojson", tag: "111c9be5188f7350c2eac9ddaedd8cca3d7bf394", version: "111c9be" }
|
||||||
- { name: "open-source-parsers-jsoncpp", tag: "1.9.6", version: "v1.9.6" }
|
- { name: "open-source-parsers-jsoncpp", tag: "1.9.6", version: "v1.9.6" }
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
if(TARGET boost_json)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
unset(BOOSTJSON_INCLUDE_DIR CACHE)
|
|
||||||
find_path(BOOSTJSON_INCLUDE_DIR "boost/json.hpp" "boost/json/src.hpp")
|
|
||||||
if(EXISTS "${BOOSTJSON_INCLUDE_DIR}/boost/json.hpp")
|
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp.in" "#include <boost/json/src.hpp>")
|
|
||||||
configure_file("${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp.in" private-boost-json.cpp COPYONLY)
|
|
||||||
add_library(boost_json "${BOOSTJSON_INCLUDE_DIR}/boost/json.hpp"
|
|
||||||
"${BOOSTJSON_INCLUDE_DIR}/boost/json/src.hpp"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp")
|
|
||||||
target_include_directories(boost_json PUBLIC ${BOOSTJSON_INCLUDE_DIR})
|
|
||||||
target_compile_definitions(boost_json PUBLIC BOOST_JSON_STANDALONE)
|
|
||||||
target_compile_features(boost_json PUBLIC cxx_std_17)
|
|
||||||
endif()
|
|
||||||
@@ -11,10 +11,10 @@ if(TARGET jsoncons)
|
|||||||
target_link_libraries(danielaparker-jsoncons jwt-cpp::jwt-cpp jsoncons)
|
target_link_libraries(danielaparker-jsoncons jwt-cpp::jwt-cpp jsoncons)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include("../../cmake/private-find-boost-json.cmake")
|
find_package(Boost CONFIG COMPONENTS json)
|
||||||
if(TARGET boost_json)
|
if(TARGET Boost::json)
|
||||||
add_executable(boost-json boost-json.cpp)
|
add_executable(boost-json boost-json.cpp)
|
||||||
target_link_libraries(boost-json jwt-cpp::jwt-cpp boost_json)
|
target_link_libraries(boost-json jwt-cpp::jwt-cpp Boost::json)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(nlohmann_json CONFIG)
|
find_package(nlohmann_json CONFIG)
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ if(TARGET jsoncons)
|
|||||||
list(APPEND AVAILABLE_TRAIT_TYPES "::jwt::traits::danielaparker_jsoncons")
|
list(APPEND AVAILABLE_TRAIT_TYPES "::jwt::traits::danielaparker_jsoncons")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include("private-find-boost-json")
|
find_package(Boost CONFIG COMPONENTS json)
|
||||||
if(TARGET boost_json)
|
if(TARGET Boost::json)
|
||||||
list(APPEND AVAILABLE_TRAIT_NAMES "boost_json")
|
list(APPEND AVAILABLE_TRAIT_NAMES "boost_json")
|
||||||
list(APPEND AVAILABLE_TRAIT_TYPES "::jwt::traits::boost_json")
|
list(APPEND AVAILABLE_TRAIT_TYPES "::jwt::traits::boost_json")
|
||||||
endif()
|
endif()
|
||||||
@@ -80,7 +80,7 @@ if(TARGET jsoncons)
|
|||||||
string(APPEND TRAITS_TYPELIST_CONTENT "#include <jwt-cpp/traits/danielaparker-jsoncons/traits.h>\n")
|
string(APPEND TRAITS_TYPELIST_CONTENT "#include <jwt-cpp/traits/danielaparker-jsoncons/traits.h>\n")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TARGET boost_json)
|
if(TARGET Boost::json)
|
||||||
string(APPEND TRAITS_TYPELIST_CONTENT "#include <jwt-cpp/traits/boost-json/traits.h>\n")
|
string(APPEND TRAITS_TYPELIST_CONTENT "#include <jwt-cpp/traits/boost-json/traits.h>\n")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ if(TARGET jsoncons)
|
|||||||
list(APPEND TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/traits/JsonconsTest.cpp)
|
list(APPEND TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/traits/JsonconsTest.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TARGET boost_json)
|
if(TARGET Boost::json)
|
||||||
list(APPEND TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/traits/BoostJsonTest.cpp)
|
list(APPEND TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/traits/BoostJsonTest.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -167,8 +167,8 @@ else()
|
|||||||
if(TARGET jsoncons)
|
if(TARGET jsoncons)
|
||||||
target_link_libraries(jwt-cpp-test PRIVATE jsoncons)
|
target_link_libraries(jwt-cpp-test PRIVATE jsoncons)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET boost_json)
|
if(TARGET Boost::json)
|
||||||
target_link_libraries(jwt-cpp-test PRIVATE boost_json)
|
target_link_libraries(jwt-cpp-test PRIVATE Boost::json)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET jsoncpp_static)
|
if(TARGET jsoncpp_static)
|
||||||
target_link_libraries(jwt-cpp-test PRIVATE jsoncpp_static)
|
target_link_libraries(jwt-cpp-test PRIVATE jsoncpp_static)
|
||||||
|
|||||||
Reference in New Issue
Block a user