Convert cmake targets to plain libraries to fix linker error#68
Merged
dirk-thomas merged 1 commit intoros-visualization:kinetic-develfrom Sep 30, 2019
Merged
Conversation
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
sloretz
added a commit
to sloretz/catkin
that referenced
this pull request
Aug 3, 2019
FindBoost.cmake blindly adds `${CMAKE_THREAD_LIBS_INIT}` to
`${Boost_LIBRARIES}` when the component `thread` is found.
On Debian buster the `FindThreads.cmake` sets that to `-pthread`.
This breaks a bunch of stuff becakse `-pthread` is a linker flag, not a
library.
There were earlier fixes for `-lpthread`.
This PR expands upon them.
First this PR modifies the fix from ros#998 to not add `-l` to any linker flag.
Second it adds to the fix in ros#975 to make sure `-pthread` is passed to
downstream users.
There's no standard cmake variable for linker flags, so this PR opts to
create an interface target with just the flag, and add that to
`${PROJECT_NAME}_LIBRARIES` instead.
Both this PR and ros-visualization/python_qt_binding#68 are required to strip or `qt_gui_cpp` will fail at link time.
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Contributor
|
Thanks for the fix. |
dirk-thomas
pushed a commit
to ros/catkin
that referenced
this pull request
Oct 7, 2019
* Fix -pthread handling in Debian buster
FindBoost.cmake blindly adds `${CMAKE_THREAD_LIBS_INIT}` to
`${Boost_LIBRARIES}` when the component `thread` is found.
On Debian buster the `FindThreads.cmake` sets that to `-pthread`.
This breaks a bunch of stuff becakse `-pthread` is a linker flag, not a
library.
There were earlier fixes for `-lpthread`.
This PR expands upon them.
First this PR modifies the fix from #998 to not add `-l` to any linker flag.
Second it adds to the fix in #975 to make sure `-pthread` is passed to
downstream users.
There's no standard cmake variable for linker flags, so this PR opts to
create an interface target with just the flag, and add that to
`${PROJECT_NAME}_LIBRARIES` instead.
Both this PR and ros-visualization/python_qt_binding#68 are required to strip or `qt_gui_cpp` will fail at link time.
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* math() output actually used
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* dummyN -> wrapped-linker-optionsN
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Fix pre-3.13.0 target property setting
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Add test for propagation of linker options
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Force add CMakeLists.txt
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Indent using 2 spaces
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Increment until target is unique
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
${PROJECT_NAME}_LIBRARIEScontains an imported cmake target, this command will blindly add it to the Makefile with a-loption in front. This PR uses a catkin function to extract the library path from imported cmake targets before passing it to the command.