Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// .devcontainer/devcontainer.json
{
"name": "ModernCppStarter",
"context": "..",
"dockerFile": "../Dockerfile",
"customizations": {
"vscode": {
"settings": {
"C_Cpp.default.compilerPath": "/usr/bin/clang++",
"cmake.generator": "Ninja"
},
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"twxs.cmake"
]
}
}
}
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use official Ubuntu image
FROM ubuntu:22.04
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use current LTS 24.04?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for taking a look. Good point - that's been updated to 24.04.


# Install dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
cmake \
ninja-build \
git \
curl \
gdb \
lldb \
python3 \
python3-pip \
python3-jinja2 \
clang \
clang-tidy \
lcov \
doxygen \
meson \
libpsl-dev \
sudo \
pkg-config \
&& apt-get clean

RUN pip3 install clang-format==14.0.6 cmake_format==0.6.11 pyyaml

# Load shell.
CMD ["/bin/bash"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ Additional arguments can be passed to the analyzers by setting the `CLANG_TIDY_A

Ccache can be enabled by configuring with `-DUSE_CCACHE=<ON | OFF>`.

#### Devcontainer

The project includes a dockerfile along with a devcontainer file which allows for development in a docker container. Open the project folder in VS Code and you should be prompted to reopen the project in a container.

## FAQ

> Can I use this for header-only libraries?
Expand Down