From f27b99f9292fbab03d8c2caa877fddd8a2a16dce Mon Sep 17 00:00:00 2001 From: NukeBird Date: Fri, 14 Feb 2025 21:01:46 +0300 Subject: [PATCH] init --- .clang-format | 5 +++++ .gitignore | 3 +++ CMakeLists.txt | 22 ++++++++++++++++++++++ clang_profile | 18 ++++++++++++++++++ conanfile.txt | 10 ++++++++++ tests/zecsy.cpp | 7 +++++++ zecsy.hpp | 2 ++ 7 files changed, 67 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 clang_profile create mode 100644 conanfile.txt create mode 100644 tests/zecsy.cpp create mode 100644 zecsy.hpp diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..f62feeb --- /dev/null +++ b/.clang-format @@ -0,0 +1,5 @@ +BasedOnStyle: LLVM +BreakBeforeBraces: Allman +AccessModifierOffset: -4 +IndentWidth: 4 +AlwaysBreakTemplateDeclarations: Yes diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2a8066 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +.cache/ +CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b684381 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.22.0) + +set(PROJECT_NAME zecsy) + +project(${PROJECT_NAME}) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +find_package(nlohmann_json) + +add_library(zecsy STATIC zecsy.hpp) +target_link_libraries(zecsy ${PROJECT_DEPS} nlohmann_json::nlohmann_json) +set_target_properties(zecsy PROPERTIES LINKER_LANGUAGE CXX) + +####################################################### +find_package(Catch2 REQUIRED) +file(GLOB TEST_SRC ./tests/*.cpp ./tests/*.hpp ./tests/*.h) +add_executable(tests ${TEST_SRC}) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain zecsy) + +include(CTest) +include(Catch) +catch_discover_tests(tests) diff --git a/clang_profile b/clang_profile new file mode 100644 index 0000000..ef6d2d2 --- /dev/null +++ b/clang_profile @@ -0,0 +1,18 @@ +[settings] +os=Windows +arch=x86_64 +build_type=Debug +compiler=clang +compiler.version=19 +compiler.cppstd=gnu20 +compiler.runtime=static +compiler.runtime_type=Debug +compiler.runtime_version=v143 + +[buildenv] +CC=clang +CXX=clang +RC=clang + +[conf] +tools.cmake.cmaketoolchain:generator=Ninja diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..696b019 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,10 @@ +[requires] +nlohmann_json/3.11.3 +catch2/3.8.0 + +[generators] +CMakeDeps +CMakeToolchain + +[layout] +cmake_layout diff --git a/tests/zecsy.cpp b/tests/zecsy.cpp new file mode 100644 index 0000000..ffb589a --- /dev/null +++ b/tests/zecsy.cpp @@ -0,0 +1,7 @@ +#define CATCH_CONFIG_MAIN +#include + +TEST_CASE("dumb") +{ + REQUIRE(true); +} diff --git a/zecsy.hpp b/zecsy.hpp new file mode 100644 index 0000000..863f475 --- /dev/null +++ b/zecsy.hpp @@ -0,0 +1,2 @@ +//oh hi +int foo() {}