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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants