更新: 更好的调试策略

This commit is contained in:
huangsimin 2020-04-01 10:26:05 +08:00
parent ee6e09acea
commit 8863c2ff2a
3 changed files with 7 additions and 7 deletions

2
.vscode/launch.json vendored
View File

@ -29,7 +29,7 @@
"name": "(gdb) gtest bug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/gtest/build/vbt_test",
"program": "${fileDirname}/build/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",

6
.vscode/tasks.json vendored
View File

@ -6,7 +6,7 @@
{
"type": "shell",
"label": "cmake main debug",
"command": "/usr/bin/bash",
"command": "bash",
"args": [
"-c",
"cd ${workspaceFolder}/build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
@ -22,10 +22,10 @@
{
"type": "shell",
"label": "cmake test debug",
"command": "/usr/bin/bash",
"command": "bash",
"args": [
"-c",
"cd ${workspaceFolder}/gtest && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
"cd ${fileDirname} && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
],
"options": {
"cwd": "/bin"

View File

@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.5.0)
cmake_minimum_required(VERSION 3.0.0)
project(orderly VERSION 0.1.0)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
include(CTest)
enable_testing()
# include(CTest)
# enable_testing()
include_directories(
${CMAKE_CURRENT_LIST_DIR}/src