-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Build static librdkafka_windows.a with travis #3130
Merged
edenhill
merged 25 commits into
confluentinc:master
from
neptoess:add-mingw-to-packaging
Apr 7, 2021
Merged
Changes from 16 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7fc6e2b
Build static librdkafka_windows.a with travis
6aedc13
Update paths to match Travis MinGW build script
914740e
Update DLL paths
fa37b37
Replace tabs with spaces
3202c00
Don't use msys2 rm, just use regular travis one
b6923bd
Add Win32 DLLs to MinGW C++ pkg-config
2fa3a83
Relocate MinGW target_link_libraries to allow building executables
3d714b7
Update CMakeLists.txt to include pkg-config for Windows DLLs for stat…
1a589f6
Write to librdkafka.a instead of librdkafka_windows.a
7bfe9b6
Update packing script for different .a file name
8b1233c
Separate MinGW static build and dynamic build
fff9182
Restore previous whitespace style in CMakeLists.txt
37794d5
CMakeLists.txt formatting
b3d1dc6
Undo CMakeLists.txt whitespace-only changes
e266bbd
Fix accidental tab characters in packaging/mingw-w64/travis-before-in…
fb17f94
Default WITH_PLUGINS to ON on Windows CMake builds
a2939dd
Modify CMAKE_FIND_LIBRARY_SUFFIXES instead of deleting .dll.a files
81428d0
Make use of Libs.private
d79ba78
Merge branch 'master' of https://github.com/edenhill/librdkafka into …
601c17e
Merge branch 'master' of https://github.com/edenhill/librdkafka into …
5108c01
Merge branch 'master' of https://github.com/edenhill/librdkafka into …
3ff3cb8
Fix a CMake check using WITH_PLUGINS when it should have been using W…
d393223
Add strip calls for MinGW static libraries
cbf9b16
Slight CMakeLists.txt refactor per SpaceIm comment
cc19265
Move CMAKE_FIND_LIBRARY_SUFFIXES from CMakeLists.txt to the Travis bu…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cmake \ | ||
-G "MinGW Makefiles" \ | ||
-D CMAKE_INSTALL_PREFIX="$PWD/dest/" \ | ||
-D RDKAFKA_BUILD_STATIC=ON \ | ||
. | ||
|
||
$mingw64 mingw32-make | ||
$mingw64 mingw32-make install | ||
|
||
# Bundle all the static dependencies with the static lib we just built | ||
mkdir mergescratch | ||
pushd mergescratch | ||
cp /C/tools/msys64/mingw64/lib/libzstd.a ./ | ||
cp /C/tools/msys64/mingw64/lib/libcrypto.a ./ | ||
cp /C/tools/msys64/mingw64/lib/liblz4.a ./ | ||
cp /C/tools/msys64/mingw64/lib/libssl.a ./ | ||
cp /C/tools/msys64/mingw64/lib/libz.a ./ | ||
cp ../src/librdkafka.a ./ | ||
|
||
# Have to rename because ar won't work with + in the name | ||
cp ../src-cpp/librdkafka++.a ./librdkafkacpp.a | ||
ar -M << EOF | ||
create librdkafka-static.a | ||
addlib librdkafka.a | ||
addlib libzstd.a | ||
addlib libcrypto.a | ||
addlib liblz4.a | ||
addlib libssl.a | ||
addlib libz.a | ||
save | ||
end | ||
EOF | ||
|
||
ar -M << EOF | ||
create librdkafkacpp-static.a | ||
addlib librdkafka-static.a | ||
addlib librdkafkacpp.a | ||
save | ||
end | ||
EOF | ||
|
||
cp ./librdkafka-static.a ../dest/lib/ | ||
cp ./librdkafkacpp-static.a ../dest/lib/librdkafka++-static.a | ||
popd | ||
rm -rf ./mergescratch | ||
|
||
export PATH="$PWD/dest/bin:/mingw64/bin/:${PATH}" | ||
cd tests | ||
./test-runner.exe -l -Q -p1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we really want to use libdl and not LoadLibrary on cygwin win32?
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.
This line just turns the
WITH_PLUGINS
CMake flag on. All this does is addrdkafka_plugin.c
to the build (see https://github.com/neptoess/librdkafka/blob/add-mingw-to-packaging/src/CMakeLists.txt#L82-L84).rdkafka_plugin.c
relies onrddl.c
for its functionality, and it looks likerddl.c
properly detects_WIN32
and handles plugin loading viaLoadLibrary
. If I'm misunderstanding this, let me know.