Skip to content

Commit 168af25

Browse files
Use Boost::json in olp-cpp-sdk-authentication
Migrating from RapidJSON Relates-To: OCMAM-443 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com>
1 parent 83e0549 commit 168af25

18 files changed

+404
-360
lines changed

olp-cpp-sdk-authentication/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
project(olp-cpp-sdk-authentication VERSION 1.24.0)
1919
set(DESCRIPTION "C++ API library for accessing HERE Account authentication service")
2020

21+
find_package(Boost REQUIRED)
22+
2123
file(GLOB_RECURSE AUTHENTICATION_INC "include/*.h*")
2224
file(GLOB_RECURSE AUTHENTICATION_SRC "src/*.*")
2325

@@ -27,6 +29,7 @@ add_library(${PROJECT_NAME}
2729

2830
target_include_directories(${PROJECT_NAME} PUBLIC
2931
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
32+
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
3033
$<INSTALL_INTERFACE:include>)
3134

3235
# Used also in the package config file
@@ -37,8 +40,9 @@ target_link_libraries(${PROJECT_NAME}
3740
${PROJECT_LIBS}
3841
)
3942

40-
# On MINGW boost uses bcrypt library
41-
if (MINGW)
43+
# On MINGW and MSVC boost uses bcrypt library
44+
# https://github.com/boostorg/uuid/issues/122
45+
if (MINGW OR MSVC)
4246
target_link_libraries(${PROJECT_NAME} PRIVATE bcrypt )
4347
endif()
4448

@@ -49,6 +53,11 @@ if(BUILD_SHARED_LIBS)
4953
PUBLIC AUTHENTICATION_SHARED_LIBRARY)
5054
endif()
5155

56+
target_compile_definitions(${PROJECT_NAME}
57+
PRIVATE
58+
BOOST_ALL_NO_LIB
59+
BOOST_JSON_NO_LIB)
60+
5261
# install component
5362
install (FILES ${AUTHENTICATION_INC} DESTINATION ${INCLUDE_DIRECTORY}/olp/authentication)
5463

0 commit comments

Comments
 (0)