-
Notifications
You must be signed in to change notification settings - Fork 445
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
Enable selection of static vs shared builds #595
base: master
Are you sure you want to change the base?
Conversation
By removing the hard-coded `SHARED` flag in `ADD_LIBRARY` and setting the `ARCHIVE DESTINATION` to the library install path, you can choose which type of build you want by passing a `BUILD_SHARED_LIBS` flag when configuring.
@kino-dome thanks for the contribution but we'd need some documentation added to README.md to cover this option as we as confirmation that default build hasn't changed if no action is taken. |
I can add that to the docs, no problem. Also if you want to force a default type, we can do it using cmake's |
I believe the current default is to build both. |
The default was to build @AdamLaurie Let me know if I should add the mentioned |
This would be very useful to have for static building of executables. The proposed change looks good to me, this is how many CMake projects do it. @kino-dome I propose to also improve |
By removing the hard-coded
SHARED
flag inADD_LIBRARY
and setting theARCHIVE DESTINATION
to the library install path, you can choose which type of build you want by passing aBUILD_SHARED_LIBS
flag when configuring.