mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-07 07:50:32 +00:00
Better fix for Boost Asio and string_view issue in macOS
This commit is contained in:
parent
d13e00ba50
commit
59494034d8
@ -690,6 +690,17 @@ if(CMAKE_VERSION VERSION_LESS 3.5)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Fix for Boost Asio < 1.70 when using Clang in macOS
|
||||||
|
if(${Boost_VERSION} VERSION_LESS 107000)
|
||||||
|
# Check if we have std::string_view
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
check_cxx_source_compiles("
|
||||||
|
#include <string_view>
|
||||||
|
int main()
|
||||||
|
{ std::string_view sv; }"
|
||||||
|
has_string_view
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -94,12 +94,20 @@ if(Boost_VERSION VERSION_GREATER "106599")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Fix for Boost Asio < 1.70
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
|
||||||
|
if(${has_string_view})
|
||||||
target_compile_definitions(pvt_libs
|
target_compile_definitions(pvt_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(pvt_libs
|
||||||
|
PUBLIC
|
||||||
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -76,12 +76,20 @@ if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Fix for Boost Asio < 1.70
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
|
||||||
|
if(${has_string_view})
|
||||||
target_compile_definitions(signal_source_gr_blocks
|
target_compile_definitions(signal_source_gr_blocks
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(signal_source_gr_blocks
|
||||||
|
PUBLIC
|
||||||
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -100,12 +100,20 @@ if(Boost_VERSION VERSION_GREATER "106599")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Fix for Boost Asio < 1.70
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
|
||||||
|
if(${has_string_view})
|
||||||
target_compile_definitions(tracking_libs
|
target_compile_definitions(tracking_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(tracking_libs
|
||||||
|
PUBLIC
|
||||||
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -69,14 +69,22 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
|
||||||
|
if(${has_string_view})
|
||||||
target_compile_definitions(core_monitor
|
target_compile_definitions(core_monitor
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(core_monitor
|
||||||
|
PUBLIC
|
||||||
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(core_monitor
|
set_target_properties(core_monitor
|
||||||
|
@ -162,12 +162,20 @@ target_link_libraries(core_receiver
|
|||||||
pvt_adapters
|
pvt_adapters
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Fix for Boost Asio < 1.70
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
|
||||||
|
if(${has_string_view})
|
||||||
target_compile_definitions(core_receiver
|
target_compile_definitions(core_receiver
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(core_receiver
|
||||||
|
PUBLIC
|
||||||
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user