Skip to content

Commit 8f4627b

Browse files
Make CI pass on XCode up to 15 (#1474)
* Force leveldb to be built with c++11 For some reason traditional ways gives no '-std=c++11' in the compiler command line for XCode later than 11.7 in the iOS toolchain. CMAKE_CXX_STANDARD, set_property(.. CXX_STANDARD ..) are not working. Relates-To: OAM-2333 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com> * Ignore boost and gtest compilation warnings This is a dirty fix and it's better to find another way to ignore them especially because macos (not ios) build are OK. Relates-To: OAM-2333 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com> * Remove -noall_load linker option as obsolete It is obsolete for quite some time and XCode 15 build is failing on it. In addition it represent the default state Relates-To: OAM-2333 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com> * Add operator<< in tests for optional nested types These types are used as a boost::optional in gtest expectations and operator<< for boost::optional is trying to print their value. Alternative way is to use EXPECT_THAT(...) instead for comparison, not solving EXPECT_CALL though. Relates-To: OAM-2333 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com> --------- Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com>
1 parent a2ae147 commit 8f4627b

File tree

13 files changed

+84
-12
lines changed

13 files changed

+84
-12
lines changed

cmake/ios/tester/CMakeLists.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ target_link_libraries(${PROJECT_NAME}
5151
${SECURITY}
5252
"-Wl,-force_load"
5353
${SVC_TEST_LIB}
54-
"-Wl,-noall_load"
54+
"-Wl"
5555
gtest
5656
)
5757

cmake/toolchains/iOS.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
312312
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
313313

314314
# Symbols visibilty
315-
set (CMAKE_C_FLAGS "${APPLE_VERSION_FLAG} -isysroot ${CMAKE_OSX_SYSROOT} -fvisibility=hidden -fvisibility-inlines-hidden")
316-
set (CMAKE_CXX_FLAGS "${APPLE_VERSION_FLAG} -isysroot ${CMAKE_OSX_SYSROOT} -fvisibility=hidden -fvisibility-inlines-hidden")
315+
set (CMAKE_C_FLAGS "${APPLE_VERSION_FLAG} -isysroot ${CMAKE_OSX_SYSROOT} -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated")
316+
set (CMAKE_CXX_FLAGS "${APPLE_VERSION_FLAG} -isysroot ${CMAKE_OSX_SYSROOT} -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated")
317317

318318
set (CMAKE_C_LINK_FLAGS "${APPLE_VERSION_FLAG} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
319319
set (CMAKE_CXX_LINK_FLAGS "${APPLE_VERSION_FLAG} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")

external/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ endif()
4040

4141
# Setup versions for external project
4242
set(OLP_SDK_CPP_GOOGLETEST_URL "https://github.com/google/googletest.git")
43-
set(OLP_SDK_CPP_GOOGLETEST_TAG "release-1.10.0")
43+
set(OLP_SDK_CPP_GOOGLETEST_TAG "release-1.12.1")
4444

4545
set(OLP_SDK_CPP_SNAPPY_URL "https://github.com/google/snappy.git")
4646
set(OLP_SDK_CPP_SNAPPY_TAG "1.1.7")

external/leveldb/CMakeLists-leveldb.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ if(BUILD_SHARED_LIBS)
9999
endif(BUILD_SHARED_LIBS)
100100

101101
add_library(leveldb "")
102+
target_compile_options(leveldb PRIVATE -std=c++11 -Wno-c++11-extensions)
102103
target_sources(leveldb
103104
PRIVATE
104105
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h"
@@ -266,6 +267,7 @@ target_link_libraries(leveldb PUBLIC Threads::Threads)
266267
add_executable(leveldbutil
267268
"${PROJECT_SOURCE_DIR}/db/leveldbutil.cc"
268269
)
270+
target_compile_options(leveldbutil PRIVATE -std=c++11 -Wno-c++11-extensions)
269271
target_link_libraries(leveldbutil leveldb)
270272

271273
if(LEVELDB_BUILD_TESTS)

olp-cpp-sdk-core/tests/geo/tiling/TileKeyUtilsTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019 HERE Europe B.V.
2+
* Copyright (C) 2019-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525

2626
#include <gtest/gtest.h>
2727

28+
#include <algorithm>
2829
#include <queue>
2930
#include <vector>
3031

olp-cpp-sdk-core/tests/logging/FilterGroupTest.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 HERE Europe B.V.
2+
* Copyright (C) 2020-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,11 +22,14 @@
2222

2323
#include <olp/core/logging/FilterGroup.h>
2424
#include <olp/core/logging/Log.h>
25+
#include <boost/optional/optional_io.hpp>
26+
#include "TypesToStream.h"
2527

2628
namespace {
2729

28-
using namespace olp::logging;
29-
using namespace testing;
30+
using olp::logging::FilterGroup;
31+
using olp::logging::Level;
32+
using olp::logging::Log;
3033

3134
TEST(FilterGroupTest, DefaultLevel) {
3235
FilterGroup filter_group;

olp-cpp-sdk-core/tests/logging/LogTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 HERE Europe B.V.
2+
* Copyright (C) 2020-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,9 @@
2727
#include <olp/core/logging/ConsoleAppender.h>
2828
#include <olp/core/logging/FileAppender.h>
2929
#include <olp/core/logging/Log.h>
30+
#include <boost/optional/optional_io.hpp>
3031
#include "MockAppender.h"
32+
#include "TypesToStream.h"
3133

3234
namespace {
3335

olp-cpp-sdk-dataservice-read/tests/MetadataApiTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 HERE Europe B.V.
2+
* Copyright (C) 2020-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@
2525
#include <olp/core/client/OlpClientFactory.h>
2626
#include <olp/core/client/OlpClientSettingsFactory.h>
2727
#include <olp/core/utils/Url.h>
28+
#include <boost/optional/optional_io.hpp>
29+
#include "TypesToStream.h"
2830
#include "generated/api/MetadataApi.h"
2931

3032
namespace {

olp-cpp-sdk-dataservice-read/tests/PartitionsCacheRepositoryTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ TEST(PartitionsCacheRepositoryTest, DefaultExpiry) {
140140

141141
TEST(PartitionsCacheRepositoryTest, QuadTree) {
142142
using testing::_;
143+
using testing::DoAll;
143144
using testing::Return;
144145
using testing::SaveArg;
145146

olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <olp/dataservice/read/PartitionsRequest.h>
3636
#include <olp/dataservice/read/TileRequest.h>
3737
#include <olp/dataservice/read/model/Partitions.h>
38+
#include <boost/optional/optional_io.hpp>
3839

3940
// clang-format off
4041
#include "generated/parser/PartitionsParser.h"

0 commit comments

Comments
 (0)