Initial commit

This commit is contained in:
Martin Pander
2026-02-23 21:45:13 +01:00
commit 395a70b759
10 changed files with 560 additions and 0 deletions

77
cpp/.gitignore vendored Normal file
View File

@@ -0,0 +1,77 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Linker files
*.ilk
# Debugger Files
*.pdb
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
*.so.*
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Build directories
build/
Build/
build-*/
# CMake generated files
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
# Temporary files
*.tmp
*.log
*.bak
*.swp
# vcpkg
vcpkg_installed/
# debug information files
*.dwo
# test output & cache
Testing/
.cache/

52
cpp/flake.nix Normal file
View File

@@ -0,0 +1,52 @@
{
description = "A C++ project flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.default = pkgs.stdenv.mkDerivation {
pname = "my-cpp-app";
version = "0.1.0";
src = ./.;
# Build-time dependencies (compilers, build systems)
nativeBuildInputs = with pkgs; [
cmake
ninja
pkg-config
];
# Runtime dependencies (libraries your code links against)
buildInputs = with pkgs; [
# boost
# fmt
];
# Optional: Configure CMake flags
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
];
};
devShells.default = pkgs.mkShell {
inputsFrom = [ self'.packages.default ];
packages = with pkgs; [
gdb
clang-tools # Includes clang-format and clangd (LSP)
valgrind
];
shellHook = ''
'';
};
};
};
}