diff --git a/CMakeLists.txt b/CMakeLists.txt index 87fca3f..73b5658 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,11 +45,9 @@ endif() # Using span from std if (NOT UUID_USING_CXX20_SPAN) target_include_directories(${PROJECT_NAME} INTERFACE - $ - $) - if(UUID_ENABLE_INSTALL) - install(DIRECTORY gsl DESTINATION include) - endif() + $ + $) + install(DIRECTORY gsl DESTINATION include) endif () if(UUID_ENABLE_INSTALL) @@ -81,4 +79,4 @@ endif() 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..d48059d 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 */