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 @@ -34,6 +34,11 @@ endif()
3434
3535set (PATCH_BOOST_CMD "git apply -v ${CMAKE_CURRENT_SOURCE_DIR } /boost_182_json_noexceptions.diff" )
3636
37+ set (BOOST_LIBRARIES_ARG "" )
38+ if (NOT OLP_SDK_EMBED_BOOST_JSON)
39+ set (BOOST_LIBRARIES_ARG "${BOOST_LIBRARIES_ARG} --with-json" )
40+ endif ()
41+
3742configure_file (CMakeLists.txt.boost.in download/CMakeLists.txt @ONLY )
3843
3944set (CMAKE_VERBOSE_MAKEFILE ON )
@@ -52,7 +57,12 @@ if(result)
5257 message (FATAL_ERROR "Build step for boost failed: ${result} " )
5358endif ()
5459
55- # We are using boost header only, we don't care about libs
56- set (EXTERNAL_BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR } /external_boost PARENT_SCOPE )
57- set (EXTERNAL_BOOST_ROOT_INCLUDE ${CMAKE_CURRENT_BINARY_DIR } /external_boost PARENT_SCOPE )
58- set (EXTERNAL_BOOST_ROOT_LIB dummy_path PARENT_SCOPE )
60+ set (EXTERNAL_BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR } /external_boost_install PARENT_SCOPE )
61+ set (EXTERNAL_BOOST_ROOT_INCLUDE ${CMAKE_CURRENT_BINARY_DIR } /external_boost_install PARENT_SCOPE )
62+
63+ if (OLP_SDK_EMBED_BOOST_JSON)
64+ # We are using boost header only, we don't care about libs
65+ set (EXTERNAL_BOOST_ROOT_LIB dummy_path PARENT_SCOPE )
66+ else ()
67+ set (EXTERNAL_BOOST_ROOT_LIB ${CMAKE_CURRENT_BINARY_DIR } /external_boost_install/lib PARENT_SCOPE )
68+ endif ()
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ ExternalProject_Add(boost-download
7676 BUILD_IN_SOURCE 1
7777 UPDATE_COMMAND ""
7878 CONFIGURE_COMMAND @BOOTSTRAP_CMD@
79- BUILD_COMMAND "@B2_CMD@" headers
80- INSTALL_COMMAND ""
79+ BUILD_COMMAND "@B2_CMD@" headers @BOOST_LIBRARIES_ARG@
80+ INSTALL_COMMAND "@B2_CMD@" install @BOOST_LIBRARIES_ARG@ --prefix=@CMAKE_CURRENT_BINARY_DIR@/external_boost_install
8181 TEST_COMMAND ""
8282)
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
You can’t perform that action at this time.
0 commit comments