- Notifications
You must be signed in to change notification settings - Fork425
Enable build of cpp-netlib as shared libraries#165
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Add options to CMake to enable build of cpp-netlib as shared libraries.New options are: BUILD_SHARED_LIBS (default OFF) BUILD_TESTS (default ON) BUILD_EXAMPLES (default ON)As the current (CMakeLists-)setup of the tests and examples does notwork with a shared cpp-netlib build, those get not build then.Specify with `cmake -D<OPTION>=<ON|OFF>`
keeping those lines will break previously introduced options
The unit tests will compile and run now as well for cpp-netlib compiledas shared libraries.
'cppnetlib-utils-thread_pool' had to be added to the list of linkedlibraries for 'cppnetlib-http-server'. For the static case this was nota problem but in the shared case symbols were missing.Listing external shared or static libraries in 'add_dependencies' is notrequired. This CMake command is for adding dependencies betweendifferent targets defined by 'add_executable', 'add_library' or'add_custom_target'.
CMakeLists.txt Outdated
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've always meant to upgrade this to 1.51 -- would you mind changing this to 1.51 now?
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.
Nothing easier than that. I've only tested with Boost 1.51.0 though.
deanberris commentedNov 4, 2012
This one looks very good to me. Let me know if you can make the upgrade to 1.51 too. 👍 |
deanberris commentedNov 4, 2012
Awesome stuff, thanks Torbjörn! I'm merging this in now. |
Enable build of cpp-netlib as shared libraries
As proposed by@deanberris onGoogle Groups, this patch adds an additionalCMake option
BUILD_SHARED_LIBSto buildcpp-netlib as shared libraries.As a side effect, two furtherCMake options are introduced to selectively enable or disable build of the unit tests and examples:
BUILD_TESTSandBUILD_EXAMPLES.Some minor modifications to the preprocessor part of the unit tests were necessary to achieve successful build and execution of the unit tests with cpp-netlib as shared libraries.
I tested these modifications with CMake 2.8.9 and 2.8.10 with GCC 4.7 on Linux 64bit. Unfortunately I cannot test on other platforms as OSX or Windows.