diff --git a/CMakeLists.txt b/CMakeLists.txt index fffb92c..b80668d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ endif() # Using span from std if (NOT UUID_USING_CXX20_SPAN) target_include_directories(${PROJECT_NAME} INTERFACE - $ - $) + $ + $) install(DIRECTORY gsl DESTINATION include) endif () @@ -70,4 +70,4 @@ export(EXPORT ${PROJECT_NAME}-targets if (UUID_BUILD_TESTS) enable_testing() add_subdirectory(test) -endif () \ No newline at end of file +endif () diff --git a/include/uuid.h b/include/uuid.h index b75c9b5..af2d8c5 100644 --- a/include/uuid.h +++ b/include/uuid.h @@ -16,7 +16,21 @@ #include #include #include + +#ifdef __cplusplus + +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define LIBUUID_CPP20_OR_GREATER +# endif + +#endif + + +#ifdef LIBUUID_CPP20_OR_GREATER #include +#else +#include +#endif #ifdef _WIN32 @@ -950,4 +964,4 @@ namespace std }; } -#endif /* STDUUID_H */ \ No newline at end of file +#endif /* STDUUID_H */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cefe4af..eb3b0b3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -28,4 +28,4 @@ set_tests_properties("test_${PROJECT_NAME}" FAIL_REGULAR_EXPRESSION "Failed \\d+ test cases") set_tests_properties("test_${PROJECT_NAME}" PROPERTIES - TIMEOUT 120) \ No newline at end of file + TIMEOUT 120)