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

Add debug & release build options and information message #15

Merged

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.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
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