Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/libbson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ if(ENABLE_STATIC)
endif()

if(ENABLE_SHARED)
add_library(bson_shared SHARED)
add_library(bson_shared SHARED $<$<PLATFORM_ID:Windows>:libbson.rc>)
target_link_libraries(bson_shared PRIVATE $<BUILD_INTERFACE:bson_obj_pic>)
list(APPEND bson_libs bson_shared)
endif()
Expand Down
43 changes: 43 additions & 0 deletions src/libbson/libbson.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Defines Version Information to include in DLL on Windows.
// Refer: https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
#include <winver.h> // Defines VS_VERSION_INFO
#define BSON_COMPILATION // Tell bson-version.h it is part of compilation.
#include <bson/bson-version.h> // Defines BSON_MAJOR_VERSION and other version macros.
#undef BSON_COMPILATION

VS_VERSION_INFO VERSIONINFO
FILEVERSION BSON_MAJOR_VERSION,BSON_MINOR_VERSION,BSON_MICRO_VERSION,0
PRODUCTVERSION BSON_MAJOR_VERSION,BSON_MINOR_VERSION,BSON_MICRO_VERSION,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0L
#endif
// Set FILEOS to VOS_UNKNOWN. There is no documented value for 64-bit builds.
FILEOS VOS_UNKNOWN
FILETYPE VFT_DLL
// Set FILESUBTYPE to VFT2_UNKNOWN. There is no applicable value.
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
// Use langID `0409` for "US English". Use charsetID `04b0` for "Unicode"
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "MongoDB, Inc"
VALUE "FileDescription", "A BSON Library for C"
VALUE "FileVersion", BSON_VERSION_S
VALUE "InternalName", "bson-1.0"
VALUE "OriginalFilename", "bson-1.0.dll"
VALUE "ProductName", "MongoDB C Driver"
VALUE "ProductVersion", BSON_VERSION_S
VALUE "LegalCopyright", "Copyright (C) 2023-present MongoDB, Inc."
END
END
BLOCK "VarFileInfo"
BEGIN
// Use langID `0x0409` for "U.S. English". Use charsetID `1200` for "Unicode".
VALUE "Translation", 0x409, 1200
END
END
2 changes: 1 addition & 1 deletion src/libmongoc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ if (MONGOC_ENABLE_STATIC_BUILD)
set_target_properties (mcd_rpc PROPERTIES OUTPUT_NAME "mcd-rpc")
endif ()

add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING} $<$<PLATFORM_ID:Windows>:libmongoc.rc>)
set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES} mongo::detail::c_dependencies)
target_include_directories (mongoc_shared PRIVATE ${ZLIB_INCLUDE_DIRS})
Expand Down
41 changes: 41 additions & 0 deletions src/libmongoc/libmongoc.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Defines Version Information to include in DLL on Windows.
// Refer: https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
#include <winver.h> // Defines VS_VERSION_INFO
#include <mongoc/mongoc-version.h> // Defines MONGOC_MAJOR_VERSION and other version macros.

VS_VERSION_INFO VERSIONINFO
FILEVERSION MONGOC_MAJOR_VERSION,MONGOC_MINOR_VERSION,MONGOC_MICRO_VERSION,0
PRODUCTVERSION MONGOC_MAJOR_VERSION,MONGOC_MINOR_VERSION,MONGOC_MICRO_VERSION,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0L
#endif
// Set FILEOS to VOS_UNKNOWN. There is no documented value for 64-bit builds.
FILEOS VOS_UNKNOWN
FILETYPE VFT_DLL
// Set FILESUBTYPE to VFT2_UNKNOWN. There is no applicable value.
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
// Use langID `0409` for "US English". Use charsetID `04b0` for "Unicode"
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "MongoDB, Inc"
VALUE "FileDescription", "MongoDB Client Library for C"
VALUE "FileVersion", MONGOC_VERSION_S
VALUE "InternalName", "mongoc-1.0"
VALUE "OriginalFilename", "mongoc-1.0.dll"
VALUE "ProductName", "MongoDB C Driver"
VALUE "ProductVersion", MONGOC_VERSION_S
VALUE "LegalCopyright", "Copyright (C) 2023-present MongoDB, Inc."
END
END
BLOCK "VarFileInfo"
BEGIN
// Use langID `0x0409` for "U.S. English". Use charsetID `1200` for "Unicode".
VALUE "Translation", 0x409, 1200
END
END