Skip to content

CXX-2803 Fix build type for mongocxx library's ABI tag #1093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
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
17 changes: 6 additions & 11 deletions cmake/MongocxxUtil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@ function(mongocxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
string(APPEND abi_tag "-v${soversion}")
endif()

# Build type. Inherit from bsoncxx.
if(1)
get_target_property(build_type ${bsoncxx_target} INTERFACE_BSONCXX_ABI_TAG_BUILD_TYPE)

set_target_properties(${TARGET} PROPERTIES
BSONCXX_ABI_TAG_BUILD_TYPE ${build_type}
INTERFACE_BSONCXX_ABI_TAG_BUILD_TYPE ${build_type}
)

string(APPEND abi_tag "-${build_type}")
endif()
# Build type (same as bsoncxx):
# - 'd' for debug.
# - 'r' for release (including RelWithDebInfo and MinSizeRel).
# - 'u' for unknown (e.g. to allow user-defined configurations).
# Compatibility is handled via CMake's IMPORTED_CONFIGURATIONS rather than interface properties.
string(APPEND abi_tag "-$<IF:$<CONFIG:Debug>,d,$<IF:$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>,r,u>>")

# Link type with libmongoc. Inherit from bsoncxx.
if(1)
Expand Down