Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Do not overwrite default linker flags so that LDFLAGS environment variable is considered #2922

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

traversaro
Copy link
Collaborator

This fix emerged from conda-forge/gazebo-feedstock#38 (comment) but I then forgot to submit it upstream.

For specific build or packaging environment, it is a common practice to use the LDFLAGS environment variable to specify some desired linker flags. This mechanism is for example used by conda-build to handle the RPATH settings correctly, and it normally works well for most CMake projects. In the case of Gazebo, this mechanism was not working correctly, because what CMake does is to take the content of the LDFLAGS and put it in the CMAKE_***_LINKER_FLAGS, but then the Gazebo build script were overwriting those variables, effectively ignoring the value of LDFLAGS .

This PR fixes this problem (and a similar problem for the CFLAGS ) by appending the Gazebo-specific flags to the CMake variable, rather then overwriting them.

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.

3 participants