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
12
12
src /build
13
13
cmake-build- *
14
14
docpages /example_code /build
15
+ mlspp /include /namespace.h
15
16
16
17
# tests
17
18
test
Original file line number Diff line number Diff line change 20
20
************************************************************************************/
21
21
22
22
#pragma once
23
+
24
+ #include < dpp/export.h>
25
+
23
26
#ifndef DPP_NO_CORO
24
27
25
28
#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 33
33
#error "D++ Requires a C++17 compatible C++ compiler. Please ensure that you have enabled C++17 in your compiler flags."
34
34
#endif
35
35
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
+
36
45
#ifndef DPP_STATIC
37
46
/* Dynamic linked build as shared object or dll */
38
47
#ifdef DPP_BUILD
Original file line number Diff line number Diff line change @@ -403,14 +403,16 @@ if(NOT DPP_NO_CORO)
403
403
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0 )
404
404
message ("${BoldRed} Clang with stdc++ and coroutines requires version 12.0.0 or above. Forcing coroutines off.${ColourReset} " )
405
405
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" )
406
409
endif ()
407
- message ("-- ${Yellow} Detected stdc++ - enabling mock std::experimental namespace${ColourReset} " )
408
- target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" )
409
410
else ()
410
411
message ("-- ${Yellow} Detected libc++ - using <experimental/coroutine>${ColourReset} " )
411
412
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0.0 )
412
413
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts" )
413
414
endif ()
415
+ target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" "DPP_CORO" )
414
416
endif ()
415
417
message ("-- ${Yellow} Note - coroutines in clang < 14 are experimental, upgrading is recommended${ColourReset} " )
416
418
endif ()
@@ -421,6 +423,7 @@ if(NOT DPP_NO_CORO)
421
423
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0 )
422
424
message ("-- ${Yellow} Note - coroutines in g++10 are experimental, upgrading to g++11 or above is recommended${ColourReset} " )
423
425
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines" )
426
+ target_compile_definitions (dpp PUBLIC "STDCORO_GLIBCXX_COMPAT" "DPP_CORO" )
424
427
endif ()
425
428
endif ()
426
429
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