Skip to content

Commit bb06ab4

Browse files
committed
Enhance C++ development environment by adding gdb and ccache support
1 parent e309de6 commit bb06ab4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get update && apt-get -y install software-properties-common
55

66
# Install C++ tools and libraries
77
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get -y update && apt-get -y install \
8-
git cmake ninja-build libidn11-dev ragel yasm protobuf-compiler \
8+
git gdb cmake ninja-build libidn11-dev ragel yasm protobuf-compiler \
99
protobuf-compiler-grpc libprotobuf-dev libgrpc++-dev libgrpc-dev libgrpc++1 libgrpc10 \
1010
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev libgtest-dev libgmock-dev \
1111
libbz2-dev libdouble-conversion-dev libstdc++-13-dev liblz4-dev libssl-dev \

.devcontainer/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ WORKSPACE_FOLDER=$1
44
cd $1
55
mkdir -p build
66
git submodule update --init --recursive
7-
cmake --preset release-test -DCMAKE_EXPORT_COMPILE_COMMANDS=1
7+
cmake --preset release-test-with-ccache-basedir -DCMAKE_EXPORT_COMPILE_COMMANDS=1

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
// Use 'forwardPorts' to make a list of ports inside the container available locally.
2020
"forwardPorts": [],
21-
"initializeCommand": "cd \"${localWorkspaceFolder}\" && git config --local user.email \"$(git config user.email)\" && git config --local user.name \"$(git config user.name)\"",
21+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.ccache && cd \"${localWorkspaceFolder}\" && git config --local user.email \"$(git config user.email)\" && git config --local user.name \"$(git config user.name)\"",
2222
// Use 'postCreateCommand' to run commands after the container is created.
2323
"postCreateCommand": ".devcontainer/configure.sh ${containerWorkspaceFolder}",
2424
// Configure tool-specific properties.
@@ -33,6 +33,9 @@
3333
]
3434
}
3535
},
36+
"mounts": [
37+
"source=${localEnv:HOME}/.ccache,target=/root/.ccache,type=bind,consistency=cached"
38+
],
3639
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
3740
"remoteUser": "root"
3841
}

0 commit comments

Comments
 (0)