Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 0 additions & 20 deletions .devcontainer/Dockerfile-alpine

This file was deleted.

21 changes: 0 additions & 21 deletions .devcontainer/Dockerfile-ubuntu

This file was deleted.

43 changes: 13 additions & 30 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,24 @@
"workspaceFolder": "/app",
"build": {
"context": "..",
"dockerfile": "Dockerfile-ubuntu"
"dockerfile": "docker-ubuntu"
},
"onCreateCommand": "chmod +x .devcontainer/onCreateCommand.sh && ./.devcontainer/onCreateCommand.sh",
"remoteUser": "root",
"features": {},
"customizations": {
"vscode": {
"vscode":
{
"extensions": [
// Clangd: code complete, compile error, clang-format etc
"llvm-vs-code-extensions.vscode-clangd",
// Format all files in the workspace
"jbockle.jbockle-format-files",
// Cmake syntax highlighting
"twxs.cmake",
// Check grammar in text and Markdown
"znck.grammarly",
// Spelling check in code
"streetsidesoftware.code-spell-checker"
"Codeium.codeium",
// Extension for command variables in tasks.json.
"rioj7.command-variable",
// Adds a "Task Runner" view to run project tasks.
"SanaAjani.taskrunnercode",
// Bundle extensions
"ms-vscode.cpptools-extension-pack"
],
"settings": {
"clangd.path": "/usr/bin/clangd",
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build",
"-std=c++23"
],
"clang-format.executable": "clang-format",
"clang-format.style": "file",
"clang-format.fallbackStyle": "Microsoft",
"clang-format.formatOnSave": true,
"clang-format.formatOnType": true,
"clang-format.arguments": [
"-assume-filename=${workspaceFolder}/.clang-format"
],
"formatFiles.excludedFolders": [ "node_modules", ".vscode", ".git", "dist", ".chrome", ".cache", "build"]
}
}
}
},
"postCreateCommand": "chmod +x ${containerWorkspaceFolder}/.vscode/*.sh"

}
38 changes: 38 additions & 0 deletions .devcontainer/docker-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM alpine:3.20

WORKDIR /opt

# Install necessary packages and dependencies
RUN apk update && apk add --no-cache \
ninja-build \
cmake \
musl-dev \
linux-headers \
bash \
gcc \
g++ \
clang \
clang-extra-tools \
vim \
git \
build-base \
cmake \
pkgconfig \
ninja \
curl \
zip \
unzip \
tar \
ca-certificates \
doxygen \
graphviz

RUN apk add --no-cache python3 py3-pip && \
pip install --no-cache-dir --break-system-packages pipx && \
pipx ensurepath && \
pipx install conan

ENV PATH="/opt/vcpkg:$PATH"

# Clean up
RUN rm -rf /var/cache/apk/*
45 changes: 45 additions & 0 deletions .devcontainer/docker-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:24.04

WORKDIR /opt

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y
RUN apt-get install -y --no-install-recommends\
gcc-14 \
g++-14 \
clang-18 \
clang-tools-18 \
vim \
git \
curl \
bash \
clangd \
build-essential \
pkg-config \
ninja-build \
zip \
unzip \
tar \
ca-certificates \
doxygen \
graphviz \
mscgen \
dia \
pipx && \
rm -rf /var/lib/apt/lists/*.

# Install a modern CMake (≥3.20) via pip, which bundles the Ninja Multi-Config support
RUN pipx ensurepath && pipx install cmake conan

# Install vcpkg package manager

ENV VCPKG_FORCE_SYSTEM_BINARIES=1

RUN git clone --depth 1 https://github.com/microsoft/vcpkg.git && \
cd vcpkg && \
./bootstrap-vcpkg.sh -disableMetrics -useSystemBinaries

RUN apt-get update && apt-get install -y \
autoconf autoconf-archive bison flex automake libtool pkg-config && \
rm -rf /var/lib/apt/lists/*
11 changes: 0 additions & 11 deletions .devcontainer/onCreateCommand.sh

This file was deleted.

18 changes: 1 addition & 17 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"recommendations": [
// Dev Containers
"ms-vscode-remote.remote-containers",
// Docker Explorer view to VS Code
"ms-azuretools.vscode-docker",
// Understanding of complex code
//"lvm-vs-code-extensions.vscode-clangd"
// Bundle the 4 next extensions
// "ms-vscode.cpptools-extension-pack",
// 1. Semantic colorization
// "ms-vscode.cpptools-themes",
// 2. Intellisense
// "ms-vscode.cpptools",
// 3. CMake syntax
// "twxs.cmake",
// 4. Cmake workflow
// "ms-vscode.cmake-tool",

]
}
}
26 changes: 0 additions & 26 deletions .vscode/launch.json

This file was deleted.

43 changes: 43 additions & 0 deletions .vscode/setup_compiler_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Exit on any error
set -e

# Color definitions for pretty print
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
CYAN="\033[0;36m"
RED="\033[0;31m"
RESET="\033[0m"

# Input arguments
COMPILER=$1
BUILD_MODE=$2

# Extract base and version from the compiler
BASE="${COMPILER%-*}"
VERSION="${COMPILER#*-}"

# Set CC and CXX based on the compiler
if [[ "$BASE" == "clang" ]]; then
export CC="/usr/bin/$COMPILER"
export CXX="${CC/clang/clang++}"
elif [[ "$BASE" == "gcc" ]]; then
export CC="/usr/bin/$COMPILER"
export CXX="${CC/gcc/g++}"
else
echo -e "${RED}Error: Unsupported compiler '${COMPILER}'${RESET}"
exit 1
fi

# Set the build type
export CMAKE_BUILD_TYPE="$BUILD_MODE"

# Pretty print the compiler environment
echo -e "${YELLOW}=== Compiler Environment Setup ===${RESET}"
echo -e "${CYAN}Compiler Base: ${GREEN}$BASE${RESET}"
echo -e "${CYAN}Compiler Version: ${GREEN}$VERSION${RESET}"
echo -e "${CYAN}Build Mode: ${GREEN}$CMAKE_BUILD_TYPE${RESET}"
echo -e "${CYAN}CC: ${GREEN}$CC${RESET}"
echo -e "${CYAN}CXX: ${GREEN}$CXX${RESET}"
echo -e "${YELLOW}===================================${RESET}"
57 changes: 57 additions & 0 deletions .vscode/setup_packager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Color definitions for pretty print
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
CYAN="\033[0;36m"
MAGENTA="\033[0;35m"
RED="\033[0;31m"
GREY="\033[2m"
RESET="\033[0m"

# Input arguments
COMPILER=$1
BUILD_MODE=$2
STD_VERSION=$3
PACKAGER=$4

BASE="${COMPILER%-*}"
VERSION="${COMPILER#*-}"

# Pretty print the build configuration
echo -e "${YELLOW}=== Package Manager Setup =========${RESET}"
echo -e "${CYAN}Compiler Base: ${GREEN}${BASE}${RESET}"
echo -e "${CYAN}Compiler Version: ${GREEN}${VERSION}${RESET}"
echo -e "${CYAN}Build Mode: ${GREEN}${BUILD_MODE}${RESET}"
echo -e "${CYAN}C++ Standard: ${GREEN}${STD_VERSION}${RESET}"
echo -e "${CYAN}Package Manager: ${GREEN}${PACKAGER}${RESET}"
echo -e "${YELLOW}===================================${RESET}"

# Check the package manager and execute corresponding commands
if [[ "$PACKAGER" == "vcpkg" ]]; then
echo -e "[INFO] Setting up vcpkg..."
if [ "$(uname -m)" != "x86_64" ]; then
echo -e "${MAGENTA}[INFO] Non-x86 platform detected.${RESET}"
echo -e "[INFO] VCPKG_FORCE_SYSTEM_BINARIES set to ${VCPKG_FORCE_SYSTEM_BINARIES}."
fi
echo -e "[COMMAND] vcpkg --version"
echo -e "${GREY}$(/opt/vcpkg/vcpkg --version)${RESET}"
echo -e "[INFO] vcpkg installation verification completed successfully.${RESET}"
elif [[ "$PACKAGER" == "conan" ]]; then
echo -e "${MAGENTA}Setting up conan...${RESET}"
if ! conan profile detect > /dev/null 2>&1; then
if [[ ! -f ~/.conan2/profiles/default ]]; then
conan profile detect > /dev/null 2>&1
fi
fi
conan install . -b missing -of build/conan \
-s compiler="$BASE" \
-s compiler.version="$VERSION" \
-s build_type="$BUILD_MODE" \
-s compiler.cppstd="$STD_VERSION"
else
echo -e "${RED}Error: Unknown package manager '${PACKAGER}'${RESET}"
exit 1
fi

echo -e "${GREEN}=== Package Manager Setup Complete ===${RESET}"
Loading
Loading