Skip to content

Fix debug and git issues - #1173

Closed
KvanTTT wants to merge 2 commits into
lightvector:masterfrom
KvanTTT:debug-and-git-issues
Closed

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

Conversation

@KvanTTT

@KvanTTT KvanTTT commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

-O2 makes the debugging less convenient because some variable values become hidden. -O0 resolves 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)
Comment thread cpp/CMakeLists.txt
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
Copy Markdown
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.

@lightvector

Copy link
Copy Markdown
Owner

Thanks! I took this idea and handled it instead as c353064

@KvanTTT

KvanTTT commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! My .gitignore change was not merged, however it's no more reproducable for some reason. Now I don't see git changes despite the existing cmake-build-debug-metal and other similar directories inside cpp.

@KvanTTT KvanTTT closed this Apr 22, 2026
@KvanTTT
KvanTTT deleted the debug-and-git-issues branch April 22, 2026 16:38
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