Skip to content

Fix debug and git issues#1173

Open
KvanTTT wants to merge 2 commits intolightvector:masterfrom
KvanTTT:debug-and-git-issues
Open

Fix debug and git issues#1173
KvanTTT wants to merge 2 commits intolightvector:masterfrom
KvanTTT:debug-and-git-issues

Conversation

@KvanTTT
Copy link
Contributor

@KvanTTT KvanTTT commented Mar 21, 2026

-O2 makes the debugging less convenient because some variable values become hidden. -O0 resolved this problem.

KvanTTT added 2 commits March 21, 2026 14:01
It's a default directory for cmake builds
when user doesn't specify the build directory

(cherry picked from commit 31c0b7d)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -pedantic -Wall -Wextra -Wno-sign-compare -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Wmissing-declarations -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=1 -Wswitch-default -Wfloat-conversion -Wunused")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-sign-compare -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Wmissing-declarations -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=1 -Wswitch-default -Wfloat-conversion -Wunused")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g3 -O0 -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -g -O2 -DNDEBUG")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, the more aggressive optimization mode -O3 can be considered.

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.

1 participant