-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/added-mingw-configuration
- Loading branch information
Showing
36 changed files
with
861 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Build directories and binary files | ||
build/ | ||
out/ | ||
cmake-build-*/ | ||
|
||
# User spesific settings | ||
CMakeUserPresets.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# [Choice] focal (20.04), jammy (22.04), lunar (23.04) | ||
ARG VARIANT="lunar" | ||
FROM ubuntu:${VARIANT} | ||
|
||
# Restate the variant to use it later on in the llvm and cmake installations | ||
ARG VARIANT | ||
ARG CMAKE_VERSION=3.28.3 | ||
ENV PATH="${PATH}:/cmake-${CMAKE_VERSION}-linux-x86_64/bin/:" | ||
|
||
# Install necessary packages available from standard repos | ||
RUN apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y --no-install-recommends \ | ||
software-properties-common wget apt-utils file zip \ | ||
openssh-client gpg-agent socat rsync \ | ||
make ninja-build git pipx \ | ||
python3 python3-pip python3-venv python3-setuptools | ||
|
||
# Ensure pipx is in PATH | ||
ENV PATH="${PATH}:/root/.local/bin" | ||
|
||
# Install conan | ||
RUN pipx install conan && conan --version | ||
|
||
# By default, anything you run in Docker is done as superuser. | ||
# Conan runs some install commands as superuser, and will prepend `sudo` to | ||
# these commands, unless `CONAN_SYSREQUIRES_SUDO=0` is in your env variables. | ||
ENV CONAN_SYSREQUIRES_SUDO 0 | ||
# Some packages request that Conan use the system package manager to install | ||
# a few dependencies. This flag allows Conan to proceed with these installations; | ||
# leaving this flag undefined can cause some installation failures. | ||
ENV CONAN_SYSREQUIRES_MODE enabled | ||
|
||
# User-settable versions: | ||
# This Dockerfile should support gcc-[10, 11, 12, 13] and clang-[10, 11, 12, 13, 14, 15, 16, 17] | ||
# Earlier versions of clang will require significant modifications to the IWYU section | ||
ARG GCC_VER="12" | ||
# Add gcc-${GCC_VER} | ||
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ | ||
apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc-${GCC_VER} g++-${GCC_VER} gdb | ||
|
||
# Set gcc-${GCC_VER} as default gcc | ||
RUN update-alternatives --install /usr/bin/gcc gcc $(which gcc-${GCC_VER}) 100 | ||
RUN update-alternatives --install /usr/bin/g++ g++ $(which g++-${GCC_VER}) 100 | ||
|
||
ARG LLVM_VER="15" | ||
# Add clang-${LLVM_VER} | ||
ARG LLVM_URL="http://apt.llvm.org/${VARIANT}/" | ||
ARG LLVM_PKG="llvm-toolchain-${VARIANT}-${LLVM_VER}" | ||
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - 2>/dev/null && \ | ||
add-apt-repository -y "deb ${LLVM_URL} ${LLVM_PKG} main" && \ | ||
apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y --no-install-recommends \ | ||
clang-${LLVM_VER} lldb-${LLVM_VER} lld-${LLVM_VER} clangd-${LLVM_VER} \ | ||
llvm-${LLVM_VER}-dev libclang-${LLVM_VER}-dev clang-tidy-${LLVM_VER} | ||
|
||
# Set the default clang-tidy, so CMake can find it | ||
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-${LLVM_VER}) 1 | ||
|
||
# Set clang-${LLVM_VER} as default clang | ||
RUN update-alternatives --install /usr/bin/clang clang $(which clang-${LLVM_VER}) 100 | ||
RUN update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-${LLVM_VER}) 100 | ||
|
||
# Add install cmake/ccmake | ||
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \ | ||
&& chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh \ | ||
&& ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --include-subdir --skip-license \ | ||
&& rm cmake-${CMAKE_VERSION}-linux-x86_64.sh | ||
|
||
# Install editors | ||
RUN apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y --no-install-recommends \ | ||
neovim emacs nano | ||
|
||
# Install optional dependecies | ||
RUN apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y --no-install-recommends \ | ||
doxygen graphviz ccache cppcheck xz-utils | ||
|
||
# Install include-what-you-use | ||
RUN mkdir iwyu && cd iwyu \ | ||
&& git clone --branch clang_${LLVM_VER} https://github.com/include-what-you-use/include-what-you-use.git \ | ||
&& mkdir build && cd build \ | ||
&& cmake -G "Ninja" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${LLVM_VER} ../include-what-you-use \ | ||
&& ninja install \ | ||
&& cd ../.. \ | ||
&& rm -rf iwyu | ||
|
||
## Cleanup cached apt data we don't need anymore | ||
RUN apt-get autoremove -y && apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
## Install ARM GCC toolchain | ||
RUN wget -O archive.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz?rev=7bd049b7a3034e64885fa1a71c12f91d&hash=732D909FA8F68C0E1D0D17D08E057619" && \ | ||
echo 84be93d0f9e96a15addd490b6e237f588c641c8afdf90e7610a628007fc96867 archive.tar.xz > /tmp/archive.sha256 && sha256sum -c /tmp/archive.sha256 && rm /tmp/archive.sha256 && \ | ||
tar xf archive.tar.xz -C /opt | ||
|
||
# Allow the user to set compiler defaults | ||
ARG USE_CLANG | ||
# if --build-arg USE_CLANG=1, set CC to 'clang' or set to null otherwise. | ||
ENV CC=${USE_CLANG:+"clang"} | ||
ENV CXX=${USE_CLANG:+"clang++"} | ||
# if CC is null, set it to 'gcc' (or leave as is otherwise). | ||
ENV CC=${CC:-"gcc"} | ||
ENV CXX=${CXX:-"g++"} | ||
|
||
# Include project | ||
#ADD . /workspaces/cpp_project | ||
#WORKDIR /workspaces/cpp_project | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/cpp | ||
{ | ||
"name": "C++", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick an Ubuntu OS version. Options: [focal, jammy, lunar]. Default: lunar | ||
// Update 'GCC_VER' to pick a gcc and g++ version. Options: [10, 11, 12, 13]. Default: 12 | ||
// Update 'LLVM_VER' to pick clang version. Options: [10, 11, 12, 13, 14, 15, 16, 17]. Default: 17 | ||
// Update 'USE_CLANG' to set clang as the default C and C++ compiler. Options: [1, null]. Default null | ||
// "args": { | ||
// "VARIANT": "focal", | ||
// "GCC_VER": "12", | ||
// "LLVM_VER": "15" | ||
// } | ||
}, | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"cmake.configureOnOpen": true, | ||
"editor.formatOnSave": true | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"customizations/vscode/extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cmake-tools", | ||
"twxs.cmake", | ||
"ms-vscode.cpptools-themes", | ||
"cschlosser.doxdocgen", | ||
"eamodio.gitlens", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"mutantdino.resourcemonitor" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
//"postCreateCommand": "uname -a", | ||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
//"remoteUser": "vscode", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind,consistency=delegated", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
"features": { | ||
"git": "latest", | ||
"git-lfs": "latest", | ||
"powershell": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.