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

Switch to modern ways to add compiler flags/link libraries #4430

Closed
PhysSong opened this issue Jun 17, 2018 · 0 comments · Fixed by #7255
Closed

Switch to modern ways to add compiler flags/link libraries #4430

PhysSong opened this issue Jun 17, 2018 · 0 comments · Fixed by #7255
Milestone

Comments

@PhysSong
Copy link
Member

Currently our CMake scripts use three ways(I don't know if there are more) to add compiler:

  • add_definition
  • set_target_properties with COMPILE_FLAGS property

And for link libraries:

  • set_target_properties with LINK_FLAGS property
  • target_link_libraries

Some compiler requires those flags to be placed in appropriate places, e.g. #4030 (comment). It seems like target_link_libraries has some advantages over LINK_FLAGS way.
Modern CMake (2.8.12 and newer) provides a new way to add compiler flags: target_compile_options. Using COMPILE_FLAGS has been deprecated since this one is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant