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

Use default flags for RelWithDebInfo #418

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions cmake/GzSetCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ macro(_gz_setup_gcc_or_clang)
# We use the default flags for Release
set(CUSTOM_RELEASE_FLAGS "")

# -UNDEBUG: Undefine the NDEBUG symbol so that assertions get triggered in
# RelWithDebInfo mode
# NOTE: Always make -UNDEBUG the first flag in this list so that it appears
# immiediately after cmake's automatically provided -DNDEBUG flag.
# Keeping them next to each other should make it more clear that the
# -DNDEBUG flag is being canceled out.
set(CUSTOM_RELWITHDEBINFO_FLAGS "-UNDEBUG")
# We use the default flags for RelWithDebInfo
set(CUSTOM_RELWITHDEBINFO_FLAGS "")

# We use the default flags for MinSizeRel
set(CUSTOM_MINSIZEREL_FLAGS "")
Expand Down Expand Up @@ -304,8 +299,8 @@ macro(_gz_setup_msvc)
# GL: Enable Whole Program Optimization
set(MSVC_RELEASE_FLAGS "${MSVC_DEBUG_FLAGS} /GL")

# UNDEBUG: Undefine NDEBUG so that assertions can be triggered
set(MSVC_RELWITHDEBINFO_FLAGS "${MSVC_RELEASE_FLAGS} /UNDEBUG")
# Use Release flags for RelWithDebInfo
set(MSVC_RELWITHDEBINFO_FLAGS "${MSVC_RELEASE_FLAGS}")

# INCREMENTAL:NO fix LNK4075 warning
# LTCG: need when using /GL above
Expand Down