From d525d80c150ea960010402c65f9539de7bdeca2a Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Tue, 3 Mar 2026 11:41:56 +0200 Subject: [PATCH 1/3] CI: build with hidden symbols using Clang Good to able to do this. No tests as not exposed classes are accessed in tests Relates-To: MINOR Signed-off-by: Rustam Gamidov --- .github/workflows/psv_pipelines.yml | 19 +++++++++++++++++++ scripts/linux/psv/build_psv.sh | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/psv_pipelines.yml b/.github/workflows/psv_pipelines.yml index 4b0fd3a36..4232600dc 100644 --- a/.github/workflows/psv_pipelines.yml +++ b/.github/workflows/psv_pipelines.yml @@ -173,6 +173,25 @@ jobs: run: scripts/linux/psv/build_psv.sh shell: bash + psv-linux-22-04-clang-hidden-build: + name: PSV.Linux.22.04.clang.hidden + runs-on: ubuntu-22.04 + env: + BUILD_TYPE: RelWithDebInfo + CC: clang-11 + CXX: clang++-11 + CXXFLAGS: -Wno-deprecated-copy + EXTRA_CMAKE_OPTIONS: -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DOLP_SDK_ENABLE_TESTING=OFF + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Ubuntu dependencies + run: sudo apt-get update -y && sudo apt-get install clang-11 ccache libcurl4-openssl-dev -y --no-install-recommends --fix-missing + shell: bash + - name: Compile project on Clang + run: scripts/linux/psv/build_psv.sh + shell: bash + psv-android-22-04-build: name: PSV.Linux.Android.22.04 runs-on: ubuntu-22.04 diff --git a/scripts/linux/psv/build_psv.sh b/scripts/linux/psv/build_psv.sh index 7373352b2..0104f4f3d 100755 --- a/scripts/linux/psv/build_psv.sh +++ b/scripts/linux/psv/build_psv.sh @@ -1,6 +1,6 @@ #!/bin/bash -ex # -# 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. @@ -30,6 +30,7 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DOLP_SDK_BUILD_EXAMPLES=ON \ -DBUILD_SHARED_LIBS=ON \ + $EXTRA_CMAKE_OPTIONS \ .. make -j$(nproc) From 07beac4190abec7be9b77f4eb1120c760b46e1a8 Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Tue, 3 Mar 2026 12:20:12 +0200 Subject: [PATCH 2/3] Examples: export functions from libs To utilize in the common binary Relates-To: MINOR Signed-off-by: Rustam Gamidov --- examples/CMakeLists.txt | 21 ++++++++++++++++++++- examples/Examples.h | 17 ++++++++++++++--- examples/ProtectedCacheExample.h | 19 ++++++++++++------- examples/ReadExample.h | 4 +++- examples/StreamLayerReadExample.h | 4 +++- examples/WriteExample.h | 11 ++++++++--- 6 files changed, 60 insertions(+), 16 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index dbac398a4..2a0684c91 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -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. @@ -81,6 +81,25 @@ else() olp-cpp-sdk-authentication olp-cpp-sdk-dataservice-read) + target_compile_definitions(${OLP_SDK_DATASERVICE_READ_EXAMPLE_TARGET} + PRIVATE EXAMPLES_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_WRITE_EXAMPLE_TARGET} + PRIVATE EXAMPLES_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_CACHE_EXAMPLE_TARGET} + PRIVATE EXAMPLES_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_READ_STREAM_LAYER_EXAMPLE_TARGET} + PRIVATE EXAMPLES_LIBRARY) + if(BUILD_SHARED_LIBS) + target_compile_definitions(${OLP_SDK_DATASERVICE_READ_EXAMPLE_TARGET} + PUBLIC EXAMPLES_SHARED_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_WRITE_EXAMPLE_TARGET} + PUBLIC EXAMPLES_SHARED_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_CACHE_EXAMPLE_TARGET} + PUBLIC EXAMPLES_SHARED_LIBRARY) + target_compile_definitions(${OLP_SDK_DATASERVICE_READ_STREAM_LAYER_EXAMPLE_TARGET} + PUBLIC EXAMPLES_SHARED_LIBRARY) + endif() + add_executable(${OLP_SDK_DATASERVICE_EXAMPLE_TARGET} ./main.cpp ./Examples.h diff --git a/examples/Examples.h b/examples/Examples.h index b0492468f..dd16f0acd 100644 --- a/examples/Examples.h +++ b/examples/Examples.h @@ -1,5 +1,5 @@ /* - * 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. @@ -19,10 +19,21 @@ #pragma once +#include + +#ifdef EXAMPLES_SHARED_LIBRARY +#ifdef EXAMPLES_LIBRARY +#define EXAMPLES_API OLP_CPP_SDK_DECL_EXPORT +#else +#define EXAMPLES_API OLP_CPP_SDK_DECL_IMPORT +#endif // EXAMPLES_LIBRARY +#else +#define EXAMPLES_API +#endif // EXAMPLES_SHARED_LIBRARY + #include -struct AccessKey -{ +struct AccessKey { std::string id; // Your here.access.key.id std::string secret; // Your here.access.key.secret }; diff --git a/examples/ProtectedCacheExample.h b/examples/ProtectedCacheExample.h index 7656fe724..961798f42 100644 --- a/examples/ProtectedCacheExample.h +++ b/examples/ProtectedCacheExample.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-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. @@ -21,14 +21,19 @@ #include "Examples.h" +#include + /** - * @brief Dataservice cache example. + * @brief Dataservice cache example. * - * Gets the partition data using the HERE Open Location Platform with mutable cache. - * Makes the mutable cache path - * protected. Reads the same data from the protected cache. + * Gets the partition data using the HERE Open Location Platform with mutable + * cache. Makes the mutable cache path protected. Reads the same data from the + * protected cache. * @param access_key Your access key ID and access key secret. - * @param The HERE Resource Name (HRN) of the catalog from which you want to read data. + * @param The HERE Resource Name (HRN) of the catalog from which you want to + * read data. * @return 0 if data was published successfully. */ -int RunExampleProtectedCache(const AccessKey& access_key, const std::string& catalog); +EXAMPLES_API +int RunExampleProtectedCache(const AccessKey& access_key, + const std::string& catalog); diff --git a/examples/ReadExample.h b/examples/ReadExample.h index c4eb8c565..008de9f3e 100644 --- a/examples/ReadExample.h +++ b/examples/ReadExample.h @@ -1,5 +1,5 @@ /* - * 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. @@ -22,6 +22,7 @@ #include "Examples.h" #include +#include /** * @brief Dataservice read example. Authenticate client using access key id and @@ -33,6 +34,7 @@ * @param catalog_version The desired version of the catalog. * @return result of publish data(0 - if succeed) */ +EXAMPLES_API int RunExampleRead(const AccessKey& access_key, const std::string& catalog, const olp::porting::optional& catalog_version = olp::porting::none); diff --git a/examples/StreamLayerReadExample.h b/examples/StreamLayerReadExample.h index 06519bb5a..1fb8f7274 100644 --- a/examples/StreamLayerReadExample.h +++ b/examples/StreamLayerReadExample.h @@ -1,5 +1,5 @@ /* - * 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. @@ -22,6 +22,7 @@ #include "Examples.h" #include +#include /** * @brief Dataservice read from stream layer example. Authenticate client using @@ -34,6 +35,7 @@ * @param subscription_mode The type of client subscription. * @return 0 on success, -1 otherwise. */ +EXAMPLES_API int RunStreamLayerExampleRead( const AccessKey& access_key, const std::string& catalog, const std::string& layer_id, diff --git a/examples/WriteExample.h b/examples/WriteExample.h index 2dbfd1c1a..15546fa26 100644 --- a/examples/WriteExample.h +++ b/examples/WriteExample.h @@ -1,5 +1,5 @@ /* - * 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. @@ -21,13 +21,18 @@ #include "Examples.h" +#include + /** * @brief Dataservice write example. Authenticate client using access key id and * secret. Publish data to some layer in HRN catalog. * @param access_key Your access key ID and access key secret. - * @param The HERE Resource Name (HRN) of the catalog to which you want to publish data. - * @param layer_id The layer ID of the catalog to which you want to publish data. + * @param The HERE Resource Name (HRN) of the catalog to which you want to + * publish data. + * @param layer_id The layer ID of the catalog to which you want to publish + * data. * @return result of publish data(0 - if succeed) */ +EXAMPLES_API int RunExampleWrite(const AccessKey& access_key, const std::string& catalog, const std::string& layer_id); From 01c91fb9d501df54b6083b7e9331d62cba93a17d Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Tue, 3 Mar 2026 12:31:27 +0200 Subject: [PATCH 3/3] Make boost::json header only in the read lib Otherwise there are unresolved external symbols when built with visibility=hidden Relates-To: MINOR Signed-off-by: Rustam Gamidov --- .../src/utils/BoostJsonSrc.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 olp-cpp-sdk-dataservice-read/src/utils/BoostJsonSrc.cpp diff --git a/olp-cpp-sdk-dataservice-read/src/utils/BoostJsonSrc.cpp b/olp-cpp-sdk-dataservice-read/src/utils/BoostJsonSrc.cpp new file mode 100644 index 000000000..017758210 --- /dev/null +++ b/olp-cpp-sdk-dataservice-read/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