Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4f15b2e
Add BSONCXX_USE_POLY_IMPLS to configuration
eramongodb Jan 23, 2024
a69b3e3
Formatting
eramongodb Jan 23, 2024
966a23f
Restore stdlib selection for make_unique.hpp
eramongodb Jan 23, 2024
d8296bc
Restore polyfill selection for string_view.hpp
eramongodb Jan 23, 2024
0f165a8
CXX-641 fix usage of common flags in abidiff-test.sh
eramongodb Jan 23, 2024
57acd57
Disable string_view tests for external library polyfills
eramongodb Jan 23, 2024
ea7309f
Add changelog entry for ENABLE_BSONCXX_USE_POLY_IMPLS
eramongodb Jan 23, 2024
e3d08d5
CXX-2797 Document ENABLE_BSONCXX_POLY_USE_IMPLS and deprecate externa…
eramongodb Jan 23, 2024
f773f30
CXX-2746 Ignore detail namespaces in abi-compliance-check-test.sh
eramongodb Jan 23, 2024
c274948
Add deprecation warnings for external polyfill library configurations
eramongodb Jan 23, 2024
3bac3d6
Tweak wording of deprecation message to state _recommended_ behavior
eramongodb Jan 23, 2024
dd23ba6
Add impls to list of mutually exclusive polyfill options
eramongodb Jan 24, 2024
75ad387
Fix endif comment in make_unique.hpp
eramongodb Jan 24, 2024
b44f70c
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Feb 14, 2024
552550b
Formatting
eramongodb Feb 13, 2024
e184c3f
Avoid including external symbols in v_noabi abidiff reports
eramongodb Feb 12, 2024
852ce18
Restore polyfill selection for optional.hpp
eramongodb Feb 12, 2024
27f7054
Ignore warnings for symbols unreferenced by debug info
eramongodb Feb 12, 2024
f9d9076
Fix scoped_bson_t ambiguous overloads for views and values
eramongodb Feb 12, 2024
7a23d4a
Add missing include in catch.hh
eramongodb Feb 12, 2024
5c343f8
Disable optional tests for external library polyfills
eramongodb Feb 12, 2024
d0f910c
Conditionally disable convertible ctor static assertion
eramongodb Feb 12, 2024
8bdf1ed
Fix missing std::in_place equivalent for Boost before 1.63
eramongodb Feb 12, 2024
39979f6
Improve quality of error messages for type trait assertions
eramongodb Feb 12, 2024
2318708
Relax trait equality assertions for stdlib implementations
eramongodb Feb 13, 2024
26257b9
Declare BUILD_TESTING as a CMake option variable
eramongodb Feb 13, 2024
0b44dd8
Fix CCACHE_BASEDIR for Windows distros
eramongodb Feb 13, 2024
2c12fbd
Update documentation comments for consistency
eramongodb Feb 14, 2024
1b39989
Tweak description of ENABLE_BSONCXX_POLY_USE_IMPLS to mention "by def…
eramongodb Feb 14, 2024
d6eafaa
Tweak ordering of polyfills for consistency
eramongodb Feb 14, 2024
26d2436
Add missing macro guards for BSONCXX_POLY_USE_STD
eramongodb Feb 14, 2024
2039aac
Revert reintroduction of documentation for experimental stdlib polyfill
eramongodb Feb 14, 2024
bbf5dd5
Merge remote-tracking branch 'upstream/master' into cxx-2796
eramongodb Feb 14, 2024
8715b73
Move common polyfill selection documentation into separate page
eramongodb Feb 20, 2024
7c06aed
Tweak wording to recommend ENABLE_BSONCXX_POLY_USE_IMPLS=ON by default
eramongodb Feb 20, 2024
2c43b52
Move polyfill-selection file to consistent directory placement
eramongodb Feb 20, 2024
7cff319
Update references to polyfill-selection page
eramongodb Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ option(BUILD_SHARED_LIBS_WITH_STATIC_MONGOC
OFF
)

# Allow the user to opt into using bsoncxx implementations for C++17 polyfills.
option(ENABLE_BSONCXX_POLY_USE_IMPLS "Enable using bsoncxx implementations of C++17 polyfills for pre-C++17 configurations" OFF)

if(DEFINED CACHE{ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES} AND NOT MSVC)
message(WARNING "ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES is an MSVC-only option and will be ignored by the current configuration")
unset(ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES CACHE)
Expand Down Expand Up @@ -456,6 +459,10 @@ if(NOT(TARGET dist OR TARGET distcheck))
list(APPEND polyfill_flags "-DBOOST_ROOT=${BOOST_ROOT}")
endif()

if(NOT "${BSONCXX_POLY_USE_IMPLS}" STREQUAL "")
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_IMPLS=${BSONCXX_POLY_USE_IMPLS}")
endif()

if(NOT "${BSONCXX_POLY_USE_MNMLSTC}" STREQUAL "")
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_MNMLSTC=${BSONCXX_POLY_USE_MNMLSTC}")
endif()
Expand Down
10 changes: 5 additions & 5 deletions cmake/BsoncxxUtil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
endif()

# Library used for C++17 polyfills:
# - 'i' for bsoncxx implementations.
# - 'm' for mnmlstc/core.
# - 'b' for Boost.
# - 'x' for experimental standard library.
# - 'i' for bsoncxx implementations.
# - 's' for standard library (no polyfill).
if(1)
if(BSONCXX_POLY_USE_MNMLSTC)
if(BSONCXX_POLY_USE_IMPLS)
set(polyfill "i")
elseif(BSONCXX_POLY_USE_MNMLSTC)
set(polyfill "m")
elseif(BSONCXX_POLY_USE_BOOST)
set(polyfill "b")
elseif(BSONCXX_POLY_USE_STD_EXPERIMENTAL)
set(polyfill "x")
elseif(0) # CXX-2796: reserved for bsoncxx implementations as polyfill.
set(polyfill "i")
elseif(BSONCXX_POLY_USE_STD)
set(polyfill "s")
else()
message(FATAL_ERROR "could not determine polyfill library: must be one of [mbxis]")
message(FATAL_ERROR "could not determine polyfill library: must be one of [imbxs]")
endif()

set_target_properties(${TARGET} PROPERTIES INTERFACE_BSONCXX_ABI_TAG_POLYFILL_LIBRARY ${polyfill})
Expand Down
3 changes: 3 additions & 0 deletions cmake/make_dist/MakeDistCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function (RUN_DIST_CHECK PACKAGE_PREFIX EXT)
if (NOT "${BOOST_ROOT}" STREQUAL "")
list(APPEND polyfill_flags "-DBOOST_ROOT=${BOOST_ROOT}")
endif ()
if (NOT "${BSONCXX_POLY_USE_IMPLS}" STREQUAL "")
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_IMPLS=${BSONCXX_POLY_USE_IMPLS}")
endif()
if (NOT "${BSONCXX_POLY_USE_MNMLSTC}" STREQUAL "")
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_MNMLSTC=${BSONCXX_POLY_USE_MNMLSTC}")
endif()
Expand Down
5 changes: 5 additions & 0 deletions src/bsoncxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$
set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA})
message(STATUS "bsoncxx version: ${BSONCXX_VERSION}")

option(BSONCXX_POLY_USE_IMPLS "Use bsoncxx implementations for stdx polyfills" OFF)
option(BSONCXX_POLY_USE_MNMLSTC "Use MNMLSTC/core for stdx polyfills" OFF)
option(BSONCXX_POLY_USE_STD_EXPERIMENTAL "Use std::experimental for stdx polyfills" OFF)
option(BSONCXX_POLY_USE_SYSTEM_MNMLSTC "Obtain mnmlstc/core from system" OFF)
Expand All @@ -46,6 +47,10 @@ elseif(BSONCXX_POLY_OPTIONS_SET EQUAL 0)
# If we are in C++17 mode, use the C++17 versions
set(BSONCXX_POLY_USE_STD ON)
message(STATUS "Auto-configuring bsoncxx to use C++17 std library polyfills since C++17 is active and user didn't specify otherwise")
elseif(ENABLE_BSONCXX_POLY_USE_IMPLS)
# If enabled, use bsoncxx implementations instead of external libraries.
set(BSONCXX_POLY_USE_IMPLS ON)
message(STATUS "Auto-configuring bsoncxx to use its own polyfill implementations since C++17 is inactive")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Otherwise, since MSVC can't handle MNMLSTC, default to boost
set(BSONCXX_POLY_USE_BOOST ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ BSONCXX_POP_WARNINGS();
#pragma pop_macro("BSONCXX_INLINE_NAMESPACE_BEGIN")
#undef BSONCXX_INLINE_NAMESPACE_END
#pragma pop_macro("BSONCXX_INLINE_NAMESPACE_END")
#undef BSONCXX_POLY_USE_IMPLS
#pragma pop_macro("BSONCXX_POLY_USE_IMPLS")
#undef BSONCXX_POLY_USE_MNMLSTC
#pragma pop_macro("BSONCXX_POLY_USE_MNMLSTC")
#undef BSONCXX_POLY_USE_STD_EXPERIMENTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#undef BSONCXX_INLINE_NAMESPACE_BEGIN
#pragma push_macro("BSONCXX_INLINE_NAMESPACE_END")
#undef BSONCXX_INLINE_NAMESPACE_END
#pragma push_macro("BSONCXX_POLY_USE_IMPLS")
#undef BSONCXX_POLY_USE_MNMLSTC
#pragma push_macro("BSONCXX_POLY_USE_MNMLSTC")
#undef BSONCXX_POLY_USE_MNMLSTC
#pragma push_macro("BSONCXX_POLY_USE_STD_EXPERIMENTAL")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#cmakedefine BSONCXX_POLY_USE_IMPLS
#cmakedefine BSONCXX_POLY_USE_STD_EXPERIMENTAL
#cmakedefine BSONCXX_POLY_USE_MNMLSTC
#cmakedefine BSONCXX_POLY_USE_SYSTEM_MNMLSTC
Expand Down
1 change: 1 addition & 0 deletions src/bsoncxx/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if(ENABLE_MACRO_GUARD_TESTS)
BSONCXX_CALL
BSONCXX_INLINE_NAMESPACE_BEGIN # config.hpp (generated by CMake)
BSONCXX_INLINE_NAMESPACE_END
BSONCXX_POLY_USE_IMPLS
BSONCXX_POLY_USE_MNMLSTC
BSONCXX_POLY_USE_STD_EXPERIMENTAL
BSONCXX_POLY_USE_SYSTEM_MNMLSTC
Expand Down