File tree Expand file tree Collapse file tree 6 files changed +42
-0
lines changed
include/bsoncxx/v_noabi/bsoncxx/stdx Expand file tree Collapse file tree 6 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
117
117
DEFINE_SYMBOL BSONCXX_EXPORT
118
118
)
119
119
120
+ if (BSONCXX_API_OVERRIDE_DEFAULT_ABI )
121
+ target_compile_definitions (${TARGET} PUBLIC BSONCXX_API_OVERRIDE_DEFAULT_ABI )
122
+ endif ()
123
+
120
124
if (ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES )
121
125
set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}${abi_tag} )
122
126
else ()
Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ function(mongocxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
79
79
DEFINE_SYMBOL MONGOCXX_EXPORTS
80
80
)
81
81
82
+ if (MONGOCXX_API_OVERRIDE_DEFAULT_ABI )
83
+ target_compile_definitions (${TARGET} PUBLIC MONGOCXX_API_OVERRIDE_DEFAULT_ABI )
84
+ endif ()
85
+
82
86
if (ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES )
83
87
set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}${abi_tag} )
84
88
else ()
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ message(STATUS "bsoncxx version: ${BSONCXX_VERSION}")
23
23
option (BSONCXX_POLY_USE_IMPLS "Use bsoncxx implementations for stdx polyfills" OFF )
24
24
option (BSONCXX_POLY_USE_STD "Use C++17 std library for stdx polyfills" OFF )
25
25
26
+ option (BSONCXX_API_OVERRIDE_DEFAULT_ABI "The default ABI namespace to use for root namespace redeclarations" OFF )
27
+ mark_as_advanced (BSONCXX_API_OVERRIDE_DEFAULT_ABI )
28
+ if (BSONCXX_API_OVERRIDE_DEFAULT_ABI )
29
+ message (WARNING "BSONCXX_API_OVERRIDE_DEFAULT_ABI is an experimental feature" )
30
+ endif ()
31
+
26
32
set (BSONCXX_OUTPUT_BASENAME "bsoncxx" CACHE STRING "Output bsoncxx library base name" )
27
33
28
34
# Count how many polyfill options are true-ish
Original file line number Diff line number Diff line change @@ -34,13 +34,26 @@ using v1::stdx::optional;
34
34
namespace bsoncxx {
35
35
namespace stdx {
36
36
37
+ #if defined(BSONCXX_API_OVERRIDE_DEFAULT_ABI)
38
+
39
+ using v1::stdx::in_place;
40
+ using v1::stdx::in_place_t ;
41
+ using v1::stdx::make_optional;
42
+ using v1::stdx::nullopt;
43
+ using v1::stdx::nullopt_t ;
44
+ using v1::stdx::optional;
45
+
46
+ #else
47
+
37
48
using v_noabi::stdx::in_place;
38
49
using v_noabi::stdx::in_place_t ;
39
50
using v_noabi::stdx::make_optional;
40
51
using v_noabi::stdx::nullopt;
41
52
using v_noabi::stdx::nullopt_t ;
42
53
using v_noabi::stdx::optional;
43
54
55
+ #endif // defined(BSONCXX_API_OVERRIDE_DEFAULT_ABI)
56
+
44
57
} // namespace stdx
45
58
} // namespace bsoncxx
46
59
Original file line number Diff line number Diff line change @@ -30,9 +30,18 @@ using v1::stdx::string_view;
30
30
namespace bsoncxx {
31
31
namespace stdx {
32
32
33
+ #if defined(BSONCXX_API_OVERRIDE_DEFAULT_ABI)
34
+
35
+ using v1::stdx::basic_string_view;
36
+ using v1::stdx::string_view;
37
+
38
+ #else
39
+
33
40
using v_noabi::stdx::basic_string_view;
34
41
using v_noabi::stdx::string_view;
35
42
43
+ #endif // defined(BSONCXX_API_OVERRIDE_DEFAULT_ABI)
44
+
36
45
} // namespace stdx
37
46
} // namespace bsoncxx
38
47
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ message(STATUS "mongocxx version: ${MONGOCXX_VERSION}")
23
23
option (MONGOCXX_ENABLE_SSL "Enable SSL - if the underlying C driver offers it" ON )
24
24
option (MONGOCXX_ENABLE_SLOW_TESTS "Run slow tests when invoking the the test target" OFF )
25
25
26
+ option (MONGOCXX_API_OVERRIDE_DEFAULT_ABI "The default ABI namespace to use for root namespace redeclarations" OFF )
27
+ mark_as_advanced (MONGOCXX_API_OVERRIDE_DEFAULT_ABI )
28
+ if (MONGOCXX_API_OVERRIDE_DEFAULT_ABI )
29
+ message (WARNING "MONGOCXX_API_OVERRIDE_DEFAULT_ABI is an experimental feature" )
30
+ endif ()
31
+
26
32
set (MONGOCXX_OUTPUT_BASENAME "mongocxx" CACHE STRING "Output mongocxx library base name" )
27
33
28
34
set (MONGOCXX_PKG_DEP "" ) # Required by mongocxx-config.cmake.in.
You can’t perform that action at this time.
0 commit comments