Skip to content

Be able to build examples with static client #51

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

Merged

Conversation

stcai
Copy link
Contributor

@stcai stcai commented Jan 3, 2019

Be able to build examples while cmake option "BUILD_ROCKETMQ_SHARED" is turned off.

# target_link_libraries (${basename} rocketmq_static ${deplibs})
#endif()
else()
target_link_libraries (${basename} rocketmq_static ${deplibs} ${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think boost libraries, libevent, and jsonncpp library don't need to be linked again, as they are linked to rocketmq_static before.
Could you please remove "${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES}" and have a test on it?

Copy link
Contributor Author

@stcai stcai Jan 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested ”PullConsumer“。
I know why these libraries didn't automaically add to dependent library list while compiling PullConsumer linking static mqclient, it's because we didn't link these object while compiling static mqclient.
By the way, I just learn that when we use 'target_link_libraries' on static library, cmake dosn't really link these library on target library, it just remember the dependency of the target library on its own.
https://stackoverflow.com/questions/52038439/static-libraries-linked-against-other-static-libraries-with-cmake-one-works-o

@stcai stcai force-pushed the be-able-to-build-example-with-static-client branch from b40c5a4 to 87768ee Compare January 4, 2019 07:58
@stcai stcai changed the title be able to build examples with static client Be able to build examples with static client Jan 4, 2019
@ShannonDing ShannonDing merged commit 77264ec into apache:master Jan 4, 2019
@ShannonDing ShannonDing added the enhancement New feature or request label Jan 21, 2019
@ShannonDing ShannonDing added this to the 1.2.1 milestone Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants