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

Update build system to allow overriding CXX flags and using clang on Linux #621

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

azeey
Copy link
Collaborator

@azeey azeey commented Jul 9, 2021

🎉 New feature

Summary

Before this, CMAKE_CXX_FLAGS were unset by the main CMakeLists.txt in https://github.com/ignitionrobotics/sdformat/blob/8fca2f1409fca6e4867178346590b1c628745315/CMakeLists.txt#L164
This makes it impossible to pass additional flags at build time, such as the ones needed for building with ASAN. If there's a particular reason I'm not aware of for unsetting CMAKE_CXX_FLAGS, I leave it to those with more CMake knowledge to tell me.

This PR also updates the logic to add the -stdlib=libc++ flag only on macOS.

Test it

Build with cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang- -DCMAKE_CXX_FLAGS="-fsanitize=address"

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

…Linux

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey self-assigned this Jul 9, 2021
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Jul 9, 2021
@azeey azeey merged commit 8a5cd48 into gazebosim:sdf9 Jul 13, 2021
@azeey azeey deleted the cxx_flags_override branch July 13, 2021 22:16
jennuine pushed a commit that referenced this pull request Jul 29, 2021
…Linux (#621)

This makes it impossible to pass additional flags at build time, such as the ones needed for building with ASAN

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Jenn Nguyen <jenn@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants