build: Add feature flag FAIRMQ_HAS_STD_PMR

Currently Clang (libc++) does not implement <memory_resource>.
This commit is contained in:
Dennis Klein 2022-08-19 13:04:45 +02:00 committed by Alexey Rybalchenko
parent 904037d9be
commit 6eb973235a
2 changed files with 13 additions and 1 deletions

View File

@ -174,3 +174,12 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
else() else()
set(FAIRMQ_HAS_STD_FILESYSTEM 1) set(FAIRMQ_HAS_STD_FILESYSTEM 1)
endif() endif()
if(NOT DEFINED FAIRMQ_HAS_STD_PMR)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang (to be more precise: libc++) currently does not implement <memory_resource>
set(FAIRMQ_HAS_STD_PMR 0)
else()
set(FAIRMQ_HAS_STD_PMR 1)
endif()
endif()

View File

@ -187,7 +187,10 @@ if(BUILD_FAIRMQ)
if(BUILD_OFI_TRANSPORT) if(BUILD_OFI_TRANSPORT)
target_compile_definitions(${target} PRIVATE BUILD_OFI_TRANSPORT) target_compile_definitions(${target} PRIVATE BUILD_OFI_TRANSPORT)
endif() endif()
target_compile_definitions(${target} PUBLIC FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM}) target_compile_definitions(${target} PUBLIC
FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM}
FAIRMQ_HAS_STD_PMR=${FAIRMQ_HAS_STD_PMR}
)
####################### #######################