-
-
Notifications
You must be signed in to change notification settings - Fork 403
Use cmake to build librdkafka, add helper function for SPCConfigUtil #955
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 11 commits
5cb6a75
7a4f28e
0b17ce9
944e314
589a4a9
fc118d7
aa5c829
f34ecf9
4d5641f
08362fb
6d1c6d7
463a98b
2c590e5
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 |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| namespace SPC\builder\unix\library; | ||
|
|
||
| use SPC\store\FileSystem; | ||
| use SPC\util\executor\UnixAutoconfExecutor; | ||
| use SPC\util\executor\UnixCMakeExecutor; | ||
|
|
||
| trait librdkafka | ||
| { | ||
|
|
@@ -26,34 +26,18 @@ public function patchBeforeBuild(): bool | |
|
|
||
| protected function build(): void | ||
| { | ||
| UnixAutoconfExecutor::create($this) | ||
| ->appendEnv(['CFLAGS' => '-Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-variable']) | ||
|
Collaborator
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. please test with zig and clang on linux, both failed witho -Wno-int-conversion last time
Owner
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. Just tested with |
||
| ->optionalLib( | ||
| 'zstd', | ||
| function ($lib) { | ||
| putenv("STATIC_LIB_libzstd={$lib->getLibDir()}/libzstd.a"); | ||
| return ''; | ||
| }, | ||
| '--disable-zstd' | ||
| UnixCMakeExecutor::create($this) | ||
| ->optionalLib('zstd', ...cmake_boolean_args('WITH_ZSTD')) | ||
| ->optionalLib('curl', ...cmake_boolean_args('WITH_CURL')) | ||
| ->optionalLib('openssl', ...cmake_boolean_args('WITH_SSL')) | ||
| ->optionalLib('zlib', ...cmake_boolean_args('WITH_ZLIB')) | ||
| ->addConfigureArgs( | ||
| '-DWITH_SASL=OFF', | ||
| '-DRDKAFKA_BUILD_STATIC=ON', | ||
| '-DRDKAFKA_BUILD_EXAMPLES=OFF', | ||
| '-DRDKAFKA_BUILD_TESTS=OFF', | ||
| '-DENABLE_LZ4_EXT=OFF', | ||
| ) | ||
| ->removeConfigureArgs( | ||
| '--with-pic', | ||
| '--enable-pic', | ||
| ) | ||
| ->configure( | ||
| '--disable-curl', | ||
| '--disable-sasl', | ||
| '--disable-valgrind', | ||
| '--disable-zlib', | ||
| '--disable-ssl', | ||
| ) | ||
| ->make(); | ||
|
|
||
| $this->patchPkgconfPrefix(['rdkafka.pc', 'rdkafka-static.pc', 'rdkafka++.pc', 'rdkafka++-static.pc']); | ||
| // remove dynamic libs | ||
| shell() | ||
| ->exec("rm -rf {$this->getLibDir()}/*.so.*") | ||
| ->exec("rm -rf {$this->getLibDir()}/*.so") | ||
| ->exec("rm -rf {$this->getLibDir()}/*.dylib"); | ||
| ->build(); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.