-
Notifications
You must be signed in to change notification settings - Fork 173
fix(c): Generate versioned DLLs and import LIBs when building with MSVC #2858
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
Changes from all commits
a01b836
4a2394a
3ae75c3
b8ad1f2
c2254ee
cc41040
f87b1d4
563cfd4
cf87023
fa7e0f6
9f73ec3
2a5a1eb
08f96db
d0ebe48
112599a
4cefd77
12f66b7
aab31a1
81e9ea5
10c3776
81b6db7
622a066
3575619
413d069
6179a26
c3c3108
104d04f
9c043c0
72c3668
d061a5a
d68a05e
8f98346
82806b8
9db5d09
7390176
14b96ae
98e6f97
14a1d2d
9745dac
7f402ad
d6db78e
6898d9d
12ccdfd
d82407c
3445e4f
2227c55
4d62b37
d4c1a00
02e752b
d713f66
841de71
caaac41
d6ebdf0
6712c63
acc86a6
adfeff5
8516f78
2a43333
2ad78b4
6bb7d89
2281a5f
507c6ee
b7eb629
b80104e
f7f5f53
6fc466b
8c539ad
6928a6a
5c5620a
a8bdc9f
824b3d5
88972ae
9acf729
e249134
a132035
a995837
d1c4510
a162178
4721561
a3d695e
fc9b29f
04d1af2
a6dbf1d
23d77ae
8d36f26
a71ee95
6e09c0c
e67aa1c
e50f520
49c2537
ccd0bd2
7f654f7
82550c2
a6aeedc
a02ba04
d3e54b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,6 +241,17 @@ function(ADD_ARROW_LIB LIB_NAME) | |
| VERSION "${ADBC_FULL_SO_VERSION}" | ||
| SOVERSION "${ADBC_SO_VERSION}") | ||
|
|
||
| if(WIN32) | ||
| # Binaries generated on Windows need file version information, otherwise when the binary is part of a Windows installer | ||
| # the installer won't know to update a previously installed version. | ||
| set(VERSION_RC_TEMPLATE "${CMAKE_SOURCE_DIR}/version.rc.in") | ||
| configure_file("${VERSION_RC_TEMPLATE}" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_version.rc" @ONLY) | ||
|
|
||
| target_sources(${LIB_NAME}_shared | ||
| PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_version.rc") | ||
| endif() | ||
|
|
||
| # https://github.com/apache/arrow-adbc/issues/81 | ||
| target_compile_features(${LIB_NAME}_shared PRIVATE cxx_std_11) | ||
|
|
||
|
|
@@ -289,6 +300,19 @@ function(ADD_ARROW_LIB LIB_NAME) | |
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| INCLUDES | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
|
||
| # If we're building on Windows using vcpkg, ensure the runtime dependencies of binaries are copied to the install folder. | ||
| # TODO(https://github.com/apache/arrow-adbc/issues/3826): auto-detect this | ||
| if(ADBC_BUILD_VCPKG) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this automatically be detected somehow? e.g. by checking CMake's platform property and something the vcpkg-cmake integration sets?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm had a quick look but can't see a better way at the moment. The problem is that runtime dependencies copying doesn't work for other builds like python/conda etc. Maybe we can spend more time investigating in a separate PR if that's OK?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. |
||
| install(TARGETS ${LIB_NAME}_shared | ||
| RUNTIME_DEPENDENCIES | ||
| PRE_EXCLUDE_REGEXES | ||
| "api-ms-win-.*" | ||
| "ext-ms-.*" | ||
| POST_EXCLUDE_REGEXES | ||
| ".*system32.*" | ||
| RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}) | ||
| endif() | ||
| endif() | ||
|
|
||
| if(BUILD_STATIC) | ||
|
|
||
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.
I assume this has to be updated periodically?
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.
Yes. We can always get the latest, but I think it's safer pinning the version and updating manually.