From 8a8039f61888a51e2508a15c5af7ab3afa5756ab Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 13 Sep 2024 18:37:20 +0200 Subject: WIP --- .gitmodules | 5 +++++ CMakeLists.txt | 13 +++++++++++++ docs/.gitignore | 1 + docs/class-diag.puml | 8 ++++++++ docs/makefile | 8 ++++++++ lazy.mk | 33 +++++++++++++++++++++++++++++++++ lib/SDL | 1 + license | 21 +++++++++++++++++++++ main.cpp | 4 ++++ 9 files changed, 94 insertions(+) create mode 100644 .gitmodules create mode 100644 CMakeLists.txt create mode 100644 docs/.gitignore create mode 100644 docs/class-diag.puml create mode 100644 docs/makefile create mode 100644 lazy.mk create mode 160000 lib/SDL create mode 100644 license create mode 100644 main.cpp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8c7dbb0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,5 @@ +[submodule "lib/SDL"] + path = lib/SDL + url = https://github.com/libsdl-org/SDL + branch = release-2.30.x + shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e4f76a5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.28) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) +set(CMAKE_BUILD_TYPE Debug) + +project(main C CXX) + +add_executable(main + main.cpp +) + diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..756b22f --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +*.svg diff --git a/docs/class-diag.puml b/docs/class-diag.puml new file mode 100644 index 0000000..7db3bd3 --- /dev/null +++ b/docs/class-diag.puml @@ -0,0 +1,8 @@ +@startuml + +!theme plain +skinparam linetype ortho +skinparam classAttributeIconSize 0 + + +@enduml diff --git a/docs/makefile b/docs/makefile new file mode 100644 index 0000000..0bbe6e1 --- /dev/null +++ b/docs/makefile @@ -0,0 +1,8 @@ +all: class-diag.svg + +%.svg: %.puml + plantuml -tsvg $< + +clean: + git clean -fxdi + diff --git a/lazy.mk b/lazy.mk new file mode 100644 index 0000000..a591fd5 --- /dev/null +++ b/lazy.mk @@ -0,0 +1,33 @@ +# NOTE: CMAKE IS THE PRIMARY BUILD SYSTEM FOR THIS PROJECT. THIS FILE IS +# PROVIDED PURELY FOR CONVENIENCE, AND SHOULD NOT BECOME AN ESSENTIAL PART OF +# THE BUILD SYSTEM! + +BUILD_DIR ?= build +TARGET ?= $(BUILD_DIR)/main + +# always generate fresh build rules when cmake is re-run +CMFLAGS += --fresh +# make cmake shut up +CMFLAGS += --log-level WARNING +CMFLAGS += -Wno-deprecated + +.PHONY: FORCE + +all: FORCE $(TARGET) + +$(BUILD_DIR)/build.ninja: CMakeLists.txt + @mkdir -p $(BUILD_DIR) + @cmake -B $(BUILD_DIR) -G Ninja $(CMFLAGS) + +$(TARGET): $(BUILD_DIR)/build.ninja FORCE + @ninja -C $(BUILD_DIR) + +clean: FORCE + $(RM) -r $(BUILD_DIR) + +# Forward any unknown targets to Ninja +ifneq ($(MAKECMDGOALS),) +%:: + @ninja -C $(BUILD_DIR) $@ +endif + diff --git a/lib/SDL b/lib/SDL new file mode 160000 index 0000000..e9efcfb --- /dev/null +++ b/lib/SDL @@ -0,0 +1 @@ +Subproject commit e9efcfb428c6cf4ee49b249fb099981445685e0d diff --git a/license b/license new file mode 100644 index 0000000..5fe3518 --- /dev/null +++ b/license @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Loek Le Blansch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..1846bfb --- /dev/null +++ b/main.cpp @@ -0,0 +1,4 @@ +int main() { + return 0; +} + -- cgit v1.2.3