Skip to content
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

Enhance static library build #179

Merged
merged 5 commits into from
Jun 7, 2016

Conversation

lancechentw
Copy link
Contributor

  1. Fix a build fail which is caused by a lack of source object in libmosquitto.
  2. Add an CMake option BUILD_STATIC_LIBRARY to allow control over building static libraries or not.
  3. Add an CMake option WITH_PIC to allow control over building static libraries with PIC or not.
  4. Add build configuration to build CPP static library.

The shared library fails to link to `handle*` functions
implementd in lib/handle_* because these source file
definitions seem to be removed accidentally in commit
3499c09.

Signed-off-by: Lance Chen <[email protected]>
The BUILD_STATIC_LIBRARY option is default to ON.

Signed-off-by: Lance Chen <[email protected]>
The option WITH_PIC is default to OFF.

By default, the static library is built from the
source code directly. If WITH_PIC is enabled, the
static library is built with the same set of
object libraries that the shared library uses.

To link Mosquitto static library into a shared
library, one must enable WITH_PIC to make the
piece of code locatable.

Signed-off-by: Lance Chen <[email protected]>
The CPP static library respects options
BUILD_STATIC_LIBRARY and WITH_PIC as well.

Signed-off-by: Lance Chen <[email protected]>
@lancechentw
Copy link
Contributor Author

I was wondering if you guys prefer

  1. the CPP static library a superset of the C static library, or
  2. the CPP static library only contains object file of mosquittopp.cpp, and requires users to link both the CPP static library and the C static library to their programs?

This pull request goes with 1)

@ralight
Copy link
Contributor

ralight commented May 31, 2016

I don't have any strong feelings on the CPP library, let's see if anybody else chimes in.

Thanks, this generally looks good, I'll give it a test later.

to conform to the bare Makefiles

Signed-off-by: Lance Chen <[email protected]>
@lancechentw lancechentw force-pushed the enhance-static-library-build branch from f2fcd86 to 97847fa Compare June 2, 2016 17:59
@ralight ralight merged commit 6c87f7a into eclipse:develop Jun 7, 2016
@lancechentw
Copy link
Contributor Author

Thank you!

@lancechentw lancechentw deleted the enhance-static-library-build branch June 8, 2016 02:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants