From dc405f4c99300e6590d0f47e038ef645465cf1a8 Mon Sep 17 00:00:00 2001 From: Daniel Henry Date: Tue, 26 Aug 2025 11:48:07 -0500 Subject: [PATCH] Initial Commit Signed-off-by: Daniel Henry --- .clang-format | 40 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 9 +++++++++ .ignore | 8 ++++++++ CMakeLists.txt | 17 +++++++++++++++++ README.md | 6 ++++++ 5 files changed, 80 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 .ignore create mode 100644 CMakeLists.txt create mode 100644 README.md diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..c25f662 --- /dev/null +++ b/.clang-format @@ -0,0 +1,40 @@ +# /.clang-format +BasedOnStyle: LLVM +IndentWidth: 2 +TabWidth: 2 +UseTab: Never + +# Stop collapsing things to one line +# AllowShortFunctionsOnASingleLine: None # or 'Empty' if you want only {} allowed +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortBlocksOnASingleLine: false + +# Top-level switches +AlignTrailingComments: true # align // comments across consecutive lines + +# Align declarations in neat columns +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignFunctionDeclarations: true # optional, aligns return types for funcs + AlignFunctionPointers: true # optional + +# Align assignments too (and pad short ops so columns line up) +AlignConsecutiveAssignments: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: true # include +=, -=, etc. + PadOperators: true # only valid here + +SortIncludes: true +IncludeBlocks: Merge +IncludeCategories: + - Regex: '^".*"' + Priority: 1 + - Regex: '^<.*>' + Priority: 2 + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e37180c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +* + +!CMakeLists.txt +!.ignore +!.gitignore + +!README.md + +!.clang-format diff --git a/.ignore b/.ignore new file mode 100644 index 0000000..14b5203 --- /dev/null +++ b/.ignore @@ -0,0 +1,8 @@ +.cache +.ignore +compile_commands.json + +build/ +obj/ +bin/ +.git/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ce1361c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.22) + +project( + cpp_boilerplate + VERSION 1.0.0 + LANGUAGES CXX +) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + + +# Main executable +add_executable(${PROJECT_NAME} src/main.cpp) diff --git a/README.md b/README.md new file mode 100644 index 0000000..9666bf1 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +``` +# from the project root +cmake -S . -B build -G Ninja +cmake --build build +./build/cpp_boilerplate +```