fix stl getting not included on msvc when C++23 is enabled

This commit is contained in:
Arthur LAURENT
2025-10-26 18:15:44 +01:00
committed by Martin Leitner-Ankerl
parent 942bb1d2b6
commit 8ab51b8511
3 changed files with 7 additions and 4 deletions

View File

@@ -51,8 +51,9 @@ if(ANKERL_ENABLE_EXAMPLE)
if(ANKERL_ENABLE_MODULES)
target_link_libraries(example PRIVATE unordered_dense::unordered_dense_module)
# force no std module as cmake support is experimental
set_target_properties(example
PROPERTIES COMPILE_DEFINITIONS MODULES)
PROPERTIES COMPILE_DEFINITIONS MODULES ANKERL_UNOREDERED_DENSE_STD_MODULE=0)
endif()
endif()

View File

@@ -86,7 +86,7 @@
#else
# if !defined(ANKERL_UNORDERED_DENSE_STD_MODULE)
# if defined(__cpp_modules) && __cpp_modules >= 201907L && defined(__cpp_lib_modules) && __cpp_lib_modules >= 202207L
# if defined(ANKERL_UNORDERED_DENSE_IN_MODULE) && defined(__cpp_modules) && __cpp_modules >= 201907L && defined(__cpp_lib_modules) && __cpp_lib_modules >= 202207L
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
# define ANKERL_UNORDERED_DENSE_STD_MODULE 1
# else

View File

@@ -12,18 +12,20 @@ module;
#if !defined(ANKERL_UNORDERED_DENSE_STD_MODULE)
# if defined(__cpp_modules) && __cpp_modules >= 201907L && defined(__cpp_lib_modules) && __cpp_lib_modules >= 202207L
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
# define ANKERL_UNORDERED_DENSE_STD_MODULE 1
# else
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
# define ANKERL_UNORDERED_DENSE_STD_MODULE 0
# endif
#else
#error "BBBBBBBBBBBBB"
#endif
#if ANKERL_UNORDERED_DENSE_STD_MODULE
import std;
#endif
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define ANKERL_UNORDERED_DENSE_IN_MODULE
#include <ankerl/unordered_dense.h>
export module ankerl.unordered_dense;