From 37a4a0c30b7fafda1261f78c2fae771c47eceef4 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 14 Mar 2024 09:37:08 +0100 Subject: [PATCH] chore: setup Singleton project --- Singleton/CMakeLists.txt | 21 +++++++++++++++++++++ Singleton/bootstrap.sh | 4 ++++ Singleton/build.sh | 3 +++ Singleton/main.cpp | 9 +++++++++ 4 files changed, 37 insertions(+) create mode 100644 Singleton/CMakeLists.txt create mode 100755 Singleton/bootstrap.sh create mode 100755 Singleton/build.sh create mode 100644 Singleton/main.cpp diff --git a/Singleton/CMakeLists.txt b/Singleton/CMakeLists.txt new file mode 100644 index 0000000..05f19b8 --- /dev/null +++ b/Singleton/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.20) + +project( + Singleton + VERSION 0.1.0 + LANGUAGES CXX) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../cmake") + +include(ExportCompileCommands) +include(sccache) + +add_executable(Singleton main.cpp) + +target_compile_features(Singleton PUBLIC cxx_std_20) + +set_target_properties( + Singleton + PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin") diff --git a/Singleton/bootstrap.sh b/Singleton/bootstrap.sh new file mode 100755 index 0000000..98b48ad --- /dev/null +++ b/Singleton/bootstrap.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +cmake -S . -B .build -G Ninja -D CMAKE_EXPORT_COMPILE_COMMANDS=ON +ln -s .build/compile_commands.json diff --git a/Singleton/build.sh b/Singleton/build.sh new file mode 100755 index 0000000..d26a5a3 --- /dev/null +++ b/Singleton/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +cmake --build .build diff --git a/Singleton/main.cpp b/Singleton/main.cpp new file mode 100644 index 0000000..98187e8 --- /dev/null +++ b/Singleton/main.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char *argv[]) { + + std::cout << "Singleton" << std::endl; + + return EXIT_SUCCESS; +}