diff --git a/CheckExperimentalMemoryResource.cmake b/CheckExperimentalMemoryResource.cmake new file mode 100644 index 0000000..d006106 --- /dev/null +++ b/CheckExperimentalMemoryResource.cmake @@ -0,0 +1,16 @@ +include(CheckCXXSourceCompiles) + +# The libc++ implementation that ships with clang < v16 still +# has the memory_resource header under experimental. +# +# This functions checks if we are using such a standard library +# implementation. +# +function(check_experimental_memory_resource success) + check_cxx_source_compiles(" +#include + int main() { + return 0; + } + " ${success}) +endfunction() diff --git a/CheckLibcpp.cmake b/CheckLibcpp.cmake new file mode 100644 index 0000000..f01c522 --- /dev/null +++ b/CheckLibcpp.cmake @@ -0,0 +1,18 @@ +include(CheckCXXSourceCompiles) + +# Checks if libc++ is being used +# +function(check_libcpp success) + check_cxx_source_compiles(" + #include + int a = + #ifdef _LIBCPP_VERSION + 1; + #else + kdfasfdl + #endif + int main() { + return 0; + } + " ${success}) +endfunction()