File tree Expand file tree Collapse file tree
olp-cpp-sdk-authentication
olp-cpp-sdk-dataservice-read
olp-cpp-sdk-dataservice-write Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,22 @@ jobs:
104104 run : gcc --version && ./scripts/linux/psv/build_psv.sh
105105 shell : bash
106106
107+ psv-linux-22-04-gcc11-build-json-lib :
108+ name : PSV.Linux.22.04.gcc11.OLP_SDK_EMBED_BOOST_JSON
109+ runs-on : ubuntu-22.04
110+ env :
111+ BUILD_TYPE : RelWithDebInfo
112+ EXTRA_CMAKE_OPTIONS : -DOLP_SDK_EMBED_BOOST_JSON=OFF
113+ steps :
114+ - name : Check out repository
115+ uses : actions/checkout@v4
116+ - name : Install Ubuntu dependencies
117+ run : sudo apt-get update && sudo apt-get install -y libboost-all-dev ccache libssl-dev libcurl4-openssl-dev --no-install-recommends
118+ shell : bash
119+ - name : Compile project with cmake and ccache
120+ run : gcc --version && ./scripts/linux/psv/build_psv.sh
121+ shell : bash
122+
107123 psv-linux-latest-gcc14-build :
108124 name : PSV.Linux.latest.gcc14.Tests
109125 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ option(OLP_SDK_NO_EXCEPTION "Disable exception handling" OFF)
4040option(OLP_SDK_USE_STD_OPTIONAL " Use std::optional instead of boost::optional with C++17 and above " OFF)
4141option(OLP_SDK_USE_STD_ANY " Use std::any instead of boost::any with C++17 and above " OFF)
4242option(OLP_SDK_BOOST_THROW_EXCEPTION_EXTERNAL " The boost::throw_exception () is defined externally " OFF)
43+ option(OLP_SDK_EMBED_BOOST_JSON " Use boost.json in header-only mode. " ON)
4344option(OLP_SDK_BUILD_EXTERNAL_DEPS " Download and build external dependencies " ON)
4445option(OLP_SDK_BUILD_EXAMPLES " Enable examples targets " OFF)
4546option(OLP_SDK_MSVC_PARALLEL_BUILD_ENABLE " Enable parallel build on MSVC " ON)
Original file line number Diff line number Diff line change 1818project (olp-cpp-sdk-authentication VERSION 1.25.0)
1919set (DESCRIPTION "C++ API library for accessing HERE Account authentication service" )
2020
21- find_package (Boost REQUIRED )
21+ if (OLP_SDK_EMBED_BOOST_JSON)
22+ find_package (Boost REQUIRED )
23+ else ()
24+ find_package (Boost COMPONENTS json REQUIRED )
25+ endif ()
2226
2327file (GLOB_RECURSE AUTHENTICATION_INC "include/*.h*" )
2428file (GLOB_RECURSE AUTHENTICATION_SRC "src/*.*" )
@@ -56,6 +60,14 @@ if(BUILD_SHARED_LIBS)
5660 PUBLIC AUTHENTICATION_SHARED_LIBRARY )
5761endif ()
5862
63+ if (OLP_SDK_EMBED_BOOST_JSON)
64+ target_compile_definitions (${PROJECT_NAME }
65+ PRIVATE OLP_SDK_EMBED_BOOST_JSON )
66+ else ()
67+ target_link_libraries (${PROJECT_NAME }
68+ PRIVATE Boost::json )
69+ endif ()
70+
5971target_compile_definitions (${PROJECT_NAME }
6072 PRIVATE
6173 BOOST_ALL_NO_LIB
Original file line number Diff line number Diff line change 1717 * License-Filename: LICENSE
1818 */
1919
20+ #if defined(OLP_SDK_EMBED_BOOST_JSON)
2021#include < boost/json/src.hpp>
22+ #endif
Original file line number Diff line number Diff line change 1919project (olp-cpp-sdk-core VERSION 1.25.0)
2020set (DESCRIPTION "Core network and utility library for the HERE OLP SDK C++" )
2121
22- find_package (Boost REQUIRED )
22+ if (OLP_SDK_EMBED_BOOST_JSON)
23+ find_package (Boost REQUIRED )
24+ else ()
25+ find_package (Boost COMPONENTS json REQUIRED )
26+ endif ()
27+
2328find_package (Threads REQUIRED )
2429
2530if (OLP_SDK_ENABLE_DEFAULT_CACHE)
@@ -456,6 +461,14 @@ if (OLP_SDK_USE_STD_ANY)
456461 PUBLIC OLP_SDK_USE_STD_ANY )
457462endif ()
458463
464+ if (OLP_SDK_EMBED_BOOST_JSON)
465+ target_compile_definitions (${PROJECT_NAME }
466+ PRIVATE OLP_SDK_EMBED_BOOST_JSON )
467+ else ()
468+ target_link_libraries (${PROJECT_NAME }
469+ PRIVATE Boost::json )
470+ endif ()
471+
459472target_compile_definitions (${PROJECT_NAME } PRIVATE BOOST_ALL_NO_LIB )
460473target_compile_definitions (${PROJECT_NAME } PRIVATE BOOST_JSON_NO_LIB )
461474
Original file line number Diff line number Diff line change 1717 * License-Filename: LICENSE
1818 */
1919
20+ #if defined(OLP_SDK_EMBED_BOOST_JSON)
2021#include < boost/json/src.hpp>
22+ #endif
Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ file(GLOB_RECURSE INC "include/*.h*")
2222file (GLOB_RECURSE SRC "src/*.*" )
2323
2424
25- find_package (Boost REQUIRED )
25+ if (OLP_SDK_EMBED_BOOST_JSON)
26+ find_package (Boost REQUIRED )
27+ else ()
28+ find_package (Boost COMPONENTS json REQUIRED )
29+ endif ()
2630
2731add_library (${PROJECT_NAME }
2832 ${SRC}
@@ -53,6 +57,14 @@ if(BUILD_SHARED_LIBS)
5357 PUBLIC DATASERVICE_READ_SHARED_LIBRARY )
5458endif ()
5559
60+ if (OLP_SDK_EMBED_BOOST_JSON)
61+ target_compile_definitions (${PROJECT_NAME }
62+ PRIVATE OLP_SDK_EMBED_BOOST_JSON )
63+ else ()
64+ target_link_libraries (${PROJECT_NAME }
65+ PRIVATE Boost::json )
66+ endif ()
67+
5668# install component
5769file (GLOB API_HEADERS "include/olp/dataservice/read/*.h" )
5870file (GLOB MODEL_HEADERS "include/olp/dataservice/read/model/*.h" )
Original file line number Diff line number Diff line change 1717 * License-Filename: LICENSE
1818 */
1919
20+ #if defined(OLP_SDK_EMBED_BOOST_JSON)
2021#include < boost/json/src.hpp>
22+ #endif
Original file line number Diff line number Diff line change 1818project (olp-cpp-sdk-dataservice-write VERSION 1.25.0)
1919set (DESCRIPTION "C++ API library for writing data to OLP" )
2020
21- find_package (Boost REQUIRED )
21+ if (OLP_SDK_EMBED_BOOST_JSON)
22+ find_package (Boost REQUIRED )
23+ else ()
24+ find_package (Boost COMPONENTS json REQUIRED )
25+ endif ()
2226
2327set (OLP_SDK_DATASERVICE_WRITE_API_HEADERS
2428 ./include/olp/dataservice/write/DataServiceWriteApi.h
@@ -189,6 +193,14 @@ target_compile_definitions(${PROJECT_NAME}
189193 BOOST_ALL_NO_LIB
190194 BOOST_JSON_NO_LIB )
191195
196+ if (OLP_SDK_EMBED_BOOST_JSON)
197+ target_compile_definitions (${PROJECT_NAME }
198+ PRIVATE OLP_SDK_EMBED_BOOST_JSON )
199+ else ()
200+ target_link_libraries (${PROJECT_NAME }
201+ PRIVATE Boost::json )
202+ endif ()
203+
192204# Used also in the package config file
193205set (PROJECT_LIBS olp-cpp-sdk-core)
194206
Original file line number Diff line number Diff line change 1717 * License-Filename: LICENSE
1818 */
1919
20+ #if defined(OLP_SDK_EMBED_BOOST_JSON)
2021#include < boost/json/src.hpp>
22+ #endif
You can’t perform that action at this time.
0 commit comments