Merge pull request #67 from chaorunrun/compile-for-c++17
Fix errors on compilation with c++17
This commit is contained in:
commit
3afe7193fa
@ -45,11 +45,9 @@ endif()
|
||||
# Using span from std
|
||||
if (NOT UUID_USING_CXX20_SPAN)
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gsl>
|
||||
$<INSTALL_INTERFACE:include/gsl>)
|
||||
if(UUID_ENABLE_INSTALL)
|
||||
install(DIRECTORY gsl DESTINATION include)
|
||||
endif()
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
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 ()
|
||||
endif ()
|
||||
|
||||
@ -16,7 +16,21 @@
|
||||
#include <chrono>
|
||||
#include <numeric>
|
||||
#include <atomic>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||
# define LIBUUID_CPP20_OR_GREATER
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LIBUUID_CPP20_OR_GREATER
|
||||
#include <span>
|
||||
#else
|
||||
#include <gsl/span>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@ -950,4 +964,4 @@ namespace std
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* STDUUID_H */
|
||||
#endif /* STDUUID_H */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user