-
Notifications
You must be signed in to change notification settings - Fork 164
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
Separate building static and shared libs #219
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.
Hi, @Jihadist, thank you for contribution! Few notes:
- Please provide motivation for the change in PR description.
- It is not clear which version is now used in CI/CD testing, could you please add job to test both static and shared build?
- Any reason (besides final binary file name) to keep both targets:
clickhouse-cpp-lib-static
andclickhouse-cpp-lib
? From my perspective, only one is going to be built every time.
IMO, for static builds only, we'd better add an alias: clickhouse-cpp-lib-static
(and also make sure that output binary name stays clickhouse-cpp-lib-static
. Everywhere else just use a clickhouse-cpp-lib
. This is not to break user's code.
Ok, @Enmk
|
Regarding the CI/CD testing: IMO you might want to add another matrix parameter, like here. matrix:
compiler: [clang-6, gcc-7, gcc-8, gcc-9]
ssl: [ssl_ON, ssl_OFF]
+ build_type: [static, shared]
include:
...
+ - build_type: shared
+ CMAKE_BUILD_TYPE_FLAG: -BUILD_SHARED_LIBS=ON etc. |
Also, if you wish to add |
I did this but looks like windows shared build is broken |
If someone can help with windows shared build with export all, it will be nice |
Addressed in #226 |
Another attempt to fix windows build here: #227 227 |
d4f3370
to
e2856dc
Compare
e2856dc
to
3359603
Compare
@Enmk I dropped support for shared builds for windows and macos due to platforms require exporting symbols. Also @1261385937 will close his draft #226 (comment) |
Do not use target_link_libraries with alias
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
Introduce separating building static and shared libs, depends on cmake out-of-the-box option BUILD_SHARED_LIBS https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html. Also creates alias target for transparently linking to static or shared lib.