File tree Expand file tree Collapse file tree 5 files changed +22
-6
lines changed
Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ buildtools/composer.phar
1212src /build
1313cmake-build- *
1414docpages /example_code /build
15+ mlspp /include /namespace.h
1516
1617# tests
1718test
Original file line number Diff line number Diff line change 2020 ************************************************************************************/
2121
2222#pragma once
23+
24+ #include < dpp/export.h>
25+
2326#ifndef DPP_NO_CORO
2427
2528#if (defined(_LIBCPP_VERSION) and !defined(__cpp_impl_coroutine)) // if libc++ experimental implementation (LLVM < 14)
Original file line number Diff line number Diff line change 3333 #error "D++ Requires a C++17 compatible C++ compiler. Please ensure that you have enabled C++17 in your compiler flags."
3434#endif
3535
36+ /* If not using c++20, define DPP_CPP17_COMPAT and DPP_NO_CORO.
37+ */
38+ #if !(defined(__cplusplus) && __cplusplus >= 202002L) && !(defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
39+ # define DPP_CPP17_COMPAT
40+ # if !defined(DPP_CORO) || !DPP_CORO // Allow overriding this because why not
41+ # define DPP_NO_CORO
42+ # endif
43+ #endif
44+
3645#ifndef DPP_STATIC
3746 /* Dynamic linked build as shared object or dll */
3847 #ifdef DPP_BUILD
Original file line number Diff line number Diff line change @@ -403,14 +403,16 @@ if(NOT DPP_NO_CORO)
403403 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0)
404404 message ("${BoldRed} Clang with stdc++ and coroutines requires version 12.0.0 or above. Forcing coroutines off.${ColourReset} " )
405405 set (DPP_NO_CORO ON )
406+ else ()
407+ message ("-- ${Yellow} Detected stdc++ - enabling mock std::experimental namespace${ColourReset} " )
408+ target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" "DPP_CORO" )
406409 endif ()
407- message ("-- ${Yellow} Detected stdc++ - enabling mock std::experimental namespace${ColourReset} " )
408- target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" )
409410 else ()
410411 message ("-- ${Yellow} Detected libc++ - using <experimental/coroutine>${ColourReset} " )
411412 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0.0)
412413 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts" )
413414 endif ()
415+ target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" "DPP_CORO" )
414416 endif ()
415417 message ("-- ${Yellow} Note - coroutines in clang < 14 are experimental, upgrading is recommended${ColourReset} " )
416418 endif ()
@@ -421,6 +423,7 @@ if(NOT DPP_NO_CORO)
421423 elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0)
422424 message ("-- ${Yellow} Note - coroutines in g++10 are experimental, upgrading to g++11 or above is recommended${ColourReset} " )
423425 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines" )
426+ target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" "DPP_CORO" )
424427 endif ()
425428 endif ()
426429 endif ()
Original file line number Diff line number Diff line change 1- #pragma once
2-
3- // Configurable top-level MLS namespace
4- #define MLS_NAMESPACE ../include/dpp/mlspp/ mls
1+ #pragma once
2+
3+ // Configurable top-level MLS namespace
4+ #define MLS_NAMESPACE mls
You can’t perform that action at this time.
0 commit comments