|
1 | 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
2 | | -index d0e9d75e2..bbf1b4c9a 100644 |
| 2 | +index e9baae1ec..954909854 100644 |
3 | 3 | --- a/CMakeLists.txt |
4 | 4 | +++ b/CMakeLists.txt |
5 | | -@@ -11,7 +11,7 @@ endif() |
| 5 | +@@ -18,7 +18,7 @@ endif() |
6 | 6 |
|
7 | | - string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) |
| 7 | + # set(CMAKE_VERBOSE_MAKEFILE ON) |
8 | 8 |
|
9 | 9 | -set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") |
10 | 10 | +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") |
11 | | - if(${CMAKE_VERSION} VERSION_LESS 3.12) |
12 | | - set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/tools/cmake3.12") |
13 | | - endif() |
14 | | -@@ -642,17 +642,17 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") |
15 | 11 |
|
16 | | - # IPO requires too much memory for unit tests |
17 | | - # GCC docu recommends to compile all files with the same options, therefore ignore it completely |
18 | | -- if(NOT UA_BUILD_UNIT_TESTS AND NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) |
19 | | -- # needed to check if IPO is supported (check needs cmake > 3.9) |
20 | | -- if("${CMAKE_VERSION}" VERSION_GREATER 3.9) |
21 | | -- cmake_policy(SET CMP0069 NEW) # needed as long as required cmake < 3.9 |
22 | | -- include(CheckIPOSupported) |
23 | | -- check_ipo_supported(RESULT CC_HAS_IPO) # Inter Procedural Optimization / Link Time Optimization (should be same as -flto) |
24 | | -- if(CC_HAS_IPO) |
25 | | -- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) |
26 | | -- endif() |
27 | | -- endif() |
28 | | -- endif() |
29 | | -+ # if(NOT UA_BUILD_UNIT_TESTS AND NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) |
30 | | -+ # # needed to check if IPO is supported (check needs cmake > 3.9) |
31 | | -+ # if("${CMAKE_VERSION}" VERSION_GREATER 3.9) |
32 | | -+ # cmake_policy(SET CMP0069 NEW) # needed as long as required cmake < 3.9 |
33 | | -+ # include(CheckIPOSupported) |
34 | | -+ # check_ipo_supported(RESULT CC_HAS_IPO) # Inter Procedural Optimization / Link Time Optimization (should be same as -flto) |
35 | | -+ # if(CC_HAS_IPO) |
36 | | -+ # set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) |
37 | | -+ # endif() |
38 | | -+ # endif() |
39 | | -+ # endif() |
| 12 | + find_package(Python3 REQUIRED) |
| 13 | + find_package(Git) |
| 14 | +@@ -669,7 +669,6 @@ if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") AND |
| 15 | + # Threading support |
| 16 | + if(UA_MULTITHREADING GREATER_EQUAL 100 AND NOT WIN32) |
| 17 | + check_add_cc_flag("-pthread") |
| 18 | +- check_add_cc_flag("-ftls-model=initial-exec") # Enable thread-local variables in the .so shared object |
| 19 | + endif() |
| 20 | + |
| 21 | + # Force 32bit build |
| 22 | +@@ -691,17 +690,6 @@ if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") AND |
| 23 | + endif() |
40 | 24 | endif() |
41 | 25 |
|
42 | | - if(UA_ENABLE_AMALGAMATION) |
| 26 | +- # Inter Procedural Optimization / Link Time Optimization (should be same as -flto) |
| 27 | +- # IPO requires too much memory for unit tests |
| 28 | +- # GCC docu recommends to compile all files with the same options, therefore ignore it completely |
| 29 | +- if(NOT UA_BUILD_UNIT_TESTS AND NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) |
| 30 | +- include(CheckIPOSupported) |
| 31 | +- check_ipo_supported(RESULT CC_HAS_IPO) |
| 32 | +- if(CC_HAS_IPO) |
| 33 | +- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) |
| 34 | +- endif() |
| 35 | +- endif() |
| 36 | +- |
| 37 | + # Linker |
| 38 | + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default |
| 39 | + if(APPLE) |
| 40 | +diff --git a/arch/posix/eventloop_posix.h b/arch/posix/eventloop_posix.h |
| 41 | +index a5f51383e..0d8b78418 100644 |
| 42 | +--- a/arch/posix/eventloop_posix.h |
| 43 | ++++ b/arch/posix/eventloop_posix.h |
| 44 | +@@ -277,7 +277,9 @@ typedef int SOCKET; |
| 45 | + |
| 46 | + #ifndef __ANDROID__ |
| 47 | + #ifndef __APPLE__ |
| 48 | ++#ifdef __GLIBC__ |
| 49 | + #include <bits/stdio_lim.h> |
| 50 | ++#endif |
| 51 | + #endif /* !__APPLE__ */ |
| 52 | + #endif /* !__ANDROID__ */ |
| 53 | + |
0 commit comments