Skip to content

Commit ee1732c

Browse files
Address raspberry pi compilation issues. (#807)
Remove porting_config.h.in Remove unused defines. Inline make_unique check. Remove GLOB usage in CMakeLists.txt Resolves: OLPEDGE-1862 Signed-off-by: Mykhailo Kuchma <ext-mykhailo.kuchma@here.com>
1 parent b212899 commit ee1732c

File tree

5 files changed

+14
-80
lines changed

5 files changed

+14
-80
lines changed

olp-cpp-sdk-core/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@ set(OLP_SDK_PLATFORM_HEADERS
9898
./include/olp/core/context/Context.h
9999
)
100100

101-
file(GLOB PORTING_HEADERS
102-
"${CMAKE_CURRENT_SOURCE_DIR}/include/olp/core/porting/*.h"
103-
"${CMAKE_CURRENT_BINARY_DIR}/include/olp/core/porting/*.h"
101+
set(OLP_SDK_PORTING_HEADERS
102+
./include/olp/core/porting/deprecated.h
103+
./include/olp/core/porting/export.h
104+
./include/olp/core/porting/make_unique.h
105+
./include/olp/core/porting/platform.h
106+
./include/olp/core/porting/try_emplace.h
107+
./include/olp/core/porting/warning_disable.h
104108
)
105109

106110
set(OLP_SDK_UTILS_HEADERS
@@ -296,7 +300,7 @@ set(OLP_SDK_CORE_HEADERS
296300
${OLP_SDK_GENERATED_HEADERS}
297301
${OLP_SDK_HTTP_HEADERS}
298302
${OLP_SDK_PLATFORM_HEADERS}
299-
${PORTING_HEADERS}
303+
${OLP_SDK_PORTING_HEADERS}
300304
${OLP_SDK_UTILS_HEADERS}
301305
${OLP_SDK_LOGGING_HEADERS}
302306
${OLP_SDK_THREAD_HEADERS}
@@ -421,7 +425,7 @@ endif()
421425
# install component
422426
install (FILES ${OLP_SDK_HTTP_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/http)
423427
install (FILES ${OLP_SDK_PLATFORM_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/platform)
424-
install (FILES ${PORTING_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/porting)
428+
install (FILES ${OLP_SDK_PORTING_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/porting)
425429
install (FILES ${OLP_SDK_UTILS_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/utils)
426430
install (FILES ${OLP_SDK_THREAD_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/thread)
427431
install (FILES ${OLP_SDK_CACHE_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/olp/core/cache)

olp-cpp-sdk-core/cmake/CompileChecks.cmake

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,17 @@
1616
# License-Filename: LICENSE
1717

1818
function(porting_do_checks)
19-
if (ARGC GREATER 0)
20-
set(PATH_TO_INPUT_FILE ${ARGV0}/)
21-
list(REMOVE_AT ARGN 0)
22-
endif()
23-
2419
include(CheckCXXSourceCompiles)
25-
include(TestBigEndian)
26-
27-
test_big_endian(PORTING_SYSTEM_BIG_ENDIAN)
2820

2921
# run the cxx compile test with c++xx flags and pthreads library
3022
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION}")
3123
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
3224

33-
set(HAVE_STD_OPTIONAL OFF PARENT_SCOPE)
34-
check_cxx_source_compiles(
35-
"#include <optional>
36-
int main() { return *std::make_optional(4); }"
37-
HAVE_STD_OPTIONAL)
38-
39-
set(HAVE_EXPERIMENTAL_OPTIONAL OFF PARENT_SCOPE)
40-
check_cxx_source_compiles(
41-
"#include <experimental/optional>
42-
int main() { return *std::experimental::make_optional(4); }"
43-
HAVE_EXPERIMENTAL_OPTIONAL)
44-
45-
set(HAVE_STD_FILESYSTEM OFF PARENT_SCOPE)
46-
check_cxx_source_compiles(
47-
"#include <filesystem>
48-
int main() { return static_cast<int>(std::filesystem::file_type::directory); }"
49-
HAVE_STD_FILESYSTEM)
50-
5125
set(HAVE_PTHREAD_SETNAME_NP OFF PARENT_SCOPE)
5226
check_cxx_source_compiles(
5327
"#define _GNU_SOURCE 1
5428
#include <pthread.h>
5529
int main() { pthread_t thread; pthread_setname_np(thread, NULL); }"
5630
HAVE_PTHREAD_SETNAME_NP)
57-
58-
configure_file(${PATH_TO_INPUT_FILE}porting_config.h.in
59-
include/olp/core/porting/porting_config.h
60-
@ONLY)
6131
endfunction(porting_do_checks)
6232

olp-cpp-sdk-core/include/olp/core/porting/make_unique.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919

2020
#pragma once
2121

22-
#include <olp/core/porting/porting_config.h>
23-
2422
#include <memory>
2523

24+
#if ((__cplusplus >= 201304L) || (defined(_MSC_VER) && _MSC_VER >= 1800))
25+
#define HAVE_STD_MAKE_UNIQUE
26+
#endif
27+
2628
#if !defined(HAVE_STD_MAKE_UNIQUE)
2729

2830
#include <cstdint>

olp-cpp-sdk-core/porting_config.h.in

Lines changed: 0 additions & 42 deletions
This file was deleted.

olp-cpp-sdk-core/src/http/DefaultNetwork.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class DefaultNetwork final : public Network {
7171
void LockStatistics(uint8_t bucket_id,
7272
std::function<void(Statistics&)> callback);
7373

74-
std::atomic_uint8_t current_statistics_bucket_;
74+
std::atomic<uint8_t> current_statistics_bucket_;
7575

7676
using BucketsContainer = std::unordered_map<uint8_t, Statistics>;
7777
thread::Atomic<BucketsContainer> buckets_;

0 commit comments

Comments
 (0)