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

Using find_package(Chrono) in any project taints CMAKE_CXX_FLAGS even for targets not being linked to Chrono #509

Open
roncapat opened this issue Aug 1, 2024 · 1 comment

Comments

@roncapat
Copy link

roncapat commented Aug 1, 2024

First of all, I want to express my gratitude in developing and maintaining this project.

I've noticed a little side effect of your CMake scripts; in particular, variables like CMAKE_CXX_FLAGS are set in chrono-config.cmake (maybe instead of using modern target_compile_options/target_link_options for each module?).

When in a CMakeLists.txt I use find_package(Chrono...), CMAKE_CXX_FLAGS gets overridden by the ones defined at Chrono build stage. This influences all the targets later defined: even if a target does NOT link against the Chrono target, it will be influenced by the fact that Chrono has been imported.

Is there something that could be done to solve this?

@rserban
Copy link
Member

rserban commented Aug 1, 2024

Patrick, we are aware of this problem, but unfortunately we do not have the bandwidth to clean up the entire Chrono CMake hierarchy.

Switching to modern CMake is on our todo list and I hope we will eventually get to it.

Of course, we would always welcome help in the form of a PR!

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

No branches or pull requests

2 participants