Skip to content

feat: Add debug support for VS Code #116

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

Merged
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/.history
/.vs
/.vscode
/bin
/lib
/_Base
@@ -82,3 +81,4 @@
/examples/cmake_example/ALL_BUILD.vcxproj
/examples/cmake_example/Win32
/examples/cmake_example/Debug
compile_commands.json
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "googletest.failed",
"settings": {
"foreground": "#f00"
}
},
{
"scope": "googletest.passed",
"settings": {
"foreground": "#0f0"
}
},
{
"scope": "googletest.run",
"settings": {
"foreground": "#0f0"
}
}
]
},
"gtest-adapter.debugConfig": [
"Debug Tests"
],
"gtest-adapter.supportLocation": true
}
19 changes: 19 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"tasks": [
{
"type": "shell",
"label": "build_tests",
"command": "cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build .",
"args": [],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"version": "2.0.0"
}
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -16,6 +16,10 @@ if (MSVC)
-DNOMINMAX
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
endif()

# clone submodules
@@ -30,8 +34,8 @@ execute_process(

if(ENABLE_CLANG_TIDY)

find_program(CLANG_TIDY_BIN clang-tidy-5.0)
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-5.0.py)
find_program(CLANG_TIDY_BIN clang-tidy-6.0)
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py)

if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
message(FATAL_ERROR "unable to locate clang-tidy-5.0")