Skip to content

Commit 08e7916

Browse files
authored
CXX-2803 Fix build type for mongocxx library's ABI tag (#1093)
1 parent e21084e commit 08e7916

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

cmake/MongocxxUtil.cmake

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ function(mongocxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
3131
string(APPEND abi_tag "-v${soversion}")
3232
endif()
3333

34-
# Build type. Inherit from bsoncxx.
35-
if(1)
36-
get_target_property(build_type ${bsoncxx_target} INTERFACE_BSONCXX_ABI_TAG_BUILD_TYPE)
37-
38-
set_target_properties(${TARGET} PROPERTIES
39-
BSONCXX_ABI_TAG_BUILD_TYPE ${build_type}
40-
INTERFACE_BSONCXX_ABI_TAG_BUILD_TYPE ${build_type}
41-
)
42-
43-
string(APPEND abi_tag "-${build_type}")
44-
endif()
34+
# Build type (same as bsoncxx):
35+
# - 'd' for debug.
36+
# - 'r' for release (including RelWithDebInfo and MinSizeRel).
37+
# - 'u' for unknown (e.g. to allow user-defined configurations).
38+
# Compatibility is handled via CMake's IMPORTED_CONFIGURATIONS rather than interface properties.
39+
string(APPEND abi_tag "-$<IF:$<CONFIG:Debug>,d,$<IF:$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>,r,u>>")
4540

4641
# Link type with libmongoc. Inherit from bsoncxx.
4742
if(1)

0 commit comments

Comments
 (0)