Skip to content

Conversation

@RaymiiOrg
Copy link
Collaborator

@RaymiiOrg RaymiiOrg commented Oct 30, 2020

These are two small things I like in my cmakelists:

  • one to have specific Debug and Release builds, with specific optimalisations (O2/O0) and the ability for specific flags/options per build type
  • a message showing the current compile flags.

I'm unsure how clang handles the -ggdb flag since I've not yet worked with clang, only GCC.

@lenticularis39
Copy link
Owner

I'm unsure how clang handles the -ggdb flag since I've not yet worked with clang, only GCC.

Clang should support -ggdb according to its documentation, so it should be fine.

Copy link
Owner

@lenticularis39 lenticularis39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: CMake sets -O3 -DNDEBUG by itself when building with the Release build type, but these don't show up in CMAKE_lang_FLAGS (and when specified there manually they aren't duplicated, so that's fine).

@lenticularis39 lenticularis39 merged commit 0bad320 into lenticularis39:main Oct 30, 2020
@RaymiiOrg RaymiiOrg deleted the cmakelists_debug_release_flags branch November 17, 2020 14:28
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.

2 participants