-
Notifications
You must be signed in to change notification settings - Fork 456
CDRIVER-3091 add VERSIONINFO to dlls #1451
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with two minor whitespace suggestions
Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>
It results in equivalent output when comparing before/after using: `dumpbin /RAWDATA /SECTION:.rsrc`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment
src/libbson/CMakeLists.txt
Outdated
add_library(bson_shared SHARED) | ||
target_link_libraries(bson_shared PRIVATE $<BUILD_INTERFACE:bson_obj_pic>) | ||
if(WIN32) | ||
set_property(TARGET bson_shared APPEND PROPERTY SOURCES libbson.rc) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_library(bson_shared SHARED) | |
target_link_libraries(bson_shared PRIVATE $<BUILD_INTERFACE:bson_obj_pic>) | |
if(WIN32) | |
set_property(TARGET bson_shared APPEND PROPERTY SOURCES libbson.rc) | |
endif() | |
add_library(bson_shared SHARED $<$<PLATFORM_ID:Windows>:libbson.rc>) | |
target_link_libraries(bson_shared PRIVATE $<BUILD_INTERFACE:bson_obj_pic>) |
Same in libmongoc
Summary
Add VERSIONINFO resource to bson-1.0.dll and mongoc-1.0.dll.
Background & Motivation
The VERSIONINFO resource enables checking version information by inspecting the .dll file.
The version info can be viewed from Explorer:
Powershell can be used to inspect. This notably includes the
Debug
flag for debug builds:Applying to static libraries
The resource file is only applied to the shared libraries (.dll) and not the static libraries (.lib). This PR assumes the resource file is not applicable to the static libraries.
Applying the
.rc
file to the static target did not change the output ofGet-ItemProperty .\cmake-build\src\libbson\Debug\bson-static-1.0.lib VersionInfo
.libcurl similarly only applies
libcurl.rc
to the shared library.