From 586287dcfaeb69ce545e427e67b582430d09c57e Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 3 Nov 2024 19:37:07 +0000 Subject: [PATCH] Create project skeleton --- .clang-format | 21 +++++++++++++++++++++ .gitignore | 1 + CMakeLists.txt | 16 ++++++++++++++++ main.c | 9 +++++++++ 4 files changed, 47 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 main.c diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..e8ba46c --- /dev/null +++ b/.clang-format @@ -0,0 +1,21 @@ +--- +BasedOnStyle: WebKit +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: DontAlign +AlignOperands: false +AlignTrailingComments: false +TabWidth: 4 +UseTab: ForIndentation +DerivePointerAlignment: false +PointerAlignment: Right +BinPackArguments: true +BinPackParameters: true +ExperimentalAutoDetectBinPacking: false +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortFunctionsOnASingleLine: None +ColumnLimit: 77 +... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..915582c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) + +project(maze-thing LANGUAGES C) + +option(SANITIZERS "Enable undefined behaviour and address sanitizers" ON) + +add_executable(maze-thing main.c) + +set_property(TARGET maze-thing PROPERTY C_STANDARD 11) +set_property(TARGET maze-thing PROPERTY C_EXTENSIONS OFF) +target_compile_options(maze-thing PRIVATE -Wall -Wextra -pedantic) + +if(${SANITIZERS}) + target_compile_options(maze-thing PRIVATE -fsanitize=address,undefined) + target_link_options(maze-thing PRIVATE -fsanitize=address,undefined) +endif() diff --git a/main.c b/main.c new file mode 100644 index 0000000..b18075b --- /dev/null +++ b/main.c @@ -0,0 +1,9 @@ +/* + * Copyright (c) Camden Dixie O'Brien + * SPDX-License-Identifier: AGPL-3.0-only + */ + +int main(void) +{ + return EXIT_SUCCESS; +}