diff --git a/README.md b/README.md index 8910973b3..1938648b6 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ The table below lists the dependencies of the Data SDK. |:---------------------|:--------------------| | Libcurl | 7.52.1 | | OpenSSL | 1.1.1w | -| Boost (headers only) | 1.82.0 | +| Boost (headers only) | 1.84.0 | | LevelDB | 1.21 | | Snappy | 1.1.7 | | RapidJSON | latest | diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index b81b81125..fc8d415dd 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2024 HERE Europe B.V. +# Copyright (C) 2019-2026 HERE Europe B.V. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ set(OLP_SDK_CPP_RAPIDJSON_URL "https://github.com/Tencent/rapidjson.git") set(OLP_SDK_CPP_RAPIDJSON_TAG "d621dc9e9c77f81e5c8a35b8dcc16dcd63351321") set(OLP_SDK_CPP_BOOST_URL "https://github.com/boostorg/boost.git") -set(OLP_SDK_CPP_BOOST_TAG "boost-1.82.0") +set(OLP_SDK_CPP_BOOST_TAG "boost-1.84.0") set(OLP_SDK_CPP_LMDB_URL "https://github.com/LMDB/lmdb.git") set(OLP_SDK_CPP_LMDB_TAG "LMDB_0.9.29") @@ -97,7 +97,7 @@ if(OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB) endif() endif() -find_package(Boost 1.82.0 QUIET) +find_package(Boost 1.84.0 QUIET) if(NOT TARGET Boost AND NOT Boost_FOUND) add_subdirectory(boost) set(BOOST_ROOT ${EXTERNAL_BOOST_ROOT} PARENT_SCOPE) diff --git a/external/boost/CMakeLists.txt.boost.in b/external/boost/CMakeLists.txt.boost.in index 562b89335..bb83b6f0f 100644 --- a/external/boost/CMakeLists.txt.boost.in +++ b/external/boost/CMakeLists.txt.boost.in @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2020 HERE Europe B.V. +# Copyright (C) 2019-2026 HERE Europe B.V. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,9 +24,11 @@ include(ExternalProject) ExternalProject_Add(boost-download GIT_REPOSITORY @OLP_SDK_CPP_BOOST_URL@ GIT_TAG @OLP_SDK_CPP_BOOST_TAG@ - GIT_SUBMODULES libs/any + GIT_SUBMODULES libs/align + libs/any libs/assert libs/config + libs/container libs/container_hash libs/core libs/detail @@ -35,8 +37,10 @@ ExternalProject_Add(boost-download libs/function_types libs/headers libs/integer + libs/intrusive libs/io libs/iterator + libs/json libs/move libs/mpl libs/mp11 @@ -47,6 +51,7 @@ ExternalProject_Add(boost-download libs/random libs/serialization libs/smart_ptr + libs/system libs/static_assert libs/throw_exception libs/tti @@ -54,6 +59,7 @@ ExternalProject_Add(boost-download libs/type_traits libs/utility libs/uuid + libs/variant2 libs/winapi tools/build tools/boost_install diff --git a/olp-cpp-sdk-core/CMakeLists.txt b/olp-cpp-sdk-core/CMakeLists.txt index 6190c13dc..e694436ad 100644 --- a/olp-cpp-sdk-core/CMakeLists.txt +++ b/olp-cpp-sdk-core/CMakeLists.txt @@ -359,6 +359,7 @@ endif() set(OLP_SDK_UTILS_SOURCES ./src/utils/Base64.cpp ./src/utils/BoostExceptionHandle.cpp + ./src/utils/BoostJsonSrc.cpp ./src/utils/Credentials.cpp ./src/utils/Dir.cpp ./src/utils/Thread.cpp @@ -456,6 +457,9 @@ if (OLP_SDK_USE_STD_ANY) PUBLIC OLP_SDK_USE_STD_ANY) endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB) +target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_JSON_NO_LIB) + target_include_directories(${PROJECT_NAME} PUBLIC $ $ diff --git a/olp-cpp-sdk-core/src/utils/BoostJsonSrc.cpp b/olp-cpp-sdk-core/src/utils/BoostJsonSrc.cpp new file mode 100644 index 000000000..017758210 --- /dev/null +++ b/olp-cpp-sdk-core/src/utils/BoostJsonSrc.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#include diff --git a/olp-cpp-sdk-core/tests/CMakeLists.txt b/olp-cpp-sdk-core/tests/CMakeLists.txt index 2b9d25f2e..fc13fc82e 100644 --- a/olp-cpp-sdk-core/tests/CMakeLists.txt +++ b/olp-cpp-sdk-core/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2025 HERE Europe B.V. +# Copyright (C) 2019-2026 HERE Europe B.V. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -73,6 +73,7 @@ set(OLP_CPP_SDK_CORE_TESTS_SOURCES ./http/NetworkSettingsTest.cpp ./http/NetworkUtils.cpp + ./utils/JsonTest.cpp ./utils/UtilsTest.cpp ./utils/UrlTest.cpp ) diff --git a/olp-cpp-sdk-core/tests/utils/JsonTest.cpp b/olp-cpp-sdk-core/tests/utils/JsonTest.cpp new file mode 100644 index 000000000..ba402a9c3 --- /dev/null +++ b/olp-cpp-sdk-core/tests/utils/JsonTest.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#include + +#include + +namespace { + +using UtilsTest = testing::Test; + +const std::string kJsonData = R"json( + { + "catalogs": [ + { + "hrn": "hrn:here:data::olp:ocm", + "version": 17, + "dependencies": [], + "metadata_type": "partitions" + } + ], + "regions": [ + { + "id": 423423, + "parent_id": 14123411, + "catalogs": [ + { + "hrn": "hrn:here:data::olp:ocm", + "status": "pending", + "size_raw_bytes": 4623545, + "layer_groups": [ + "rendering" + ], + "tiles": [ + 2354325, + 5243252 + ] + } + ] + } + ] + })json"; + +TEST(UtilsTest, BoostJsonAvailable) { + boost::system::error_code error_code; + auto parsed_json = boost::json::parse(kJsonData, error_code); + + EXPECT_FALSE(error_code.failed()); +} + +} // namespace diff --git a/tests/common/CMakeLists.txt b/tests/common/CMakeLists.txt index 90a99c77c..c3331f672 100644 --- a/tests/common/CMakeLists.txt +++ b/tests/common/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 HERE Europe B.V. +# Copyright (C) 2019-2026 HERE Europe B.V. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,6 +50,9 @@ target_include_directories(olp-cpp-sdk-tests-common ${CMAKE_CURRENT_SOURCE_DIR}/../../olp-cpp-sdk-dataservice-read/src/ ) +target_compile_definitions(olp-cpp-sdk-tests-common PUBLIC BOOST_CONTAINER_NO_LIB) +target_compile_definitions(olp-cpp-sdk-tests-common PUBLIC BOOST_JSON_NO_LIB) + target_link_libraries(olp-cpp-sdk-tests-common PUBLIC gmock