1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Check if the compiler has the <span> header

This commit is contained in:
Carles Fernandez 2019-06-29 01:58:12 +02:00
parent 751f54990c
commit 9b3fd32f43
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -92,7 +92,15 @@ else()
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system) target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
endif() endif()
if(NOT (CMAKE_CXX_STANDARD VERSION_LESS 20)) include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <span>
int main()
{ std::span<float> sv; }"
has_span
)
if(${has_span})
target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1) target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1)
else() else()
target_include_directories(algorithms_libs target_include_directories(algorithms_libs