init
This commit is contained in:
commit
d24899e084
7 changed files with 89 additions and 0 deletions
14
.clang-format
Normal file
14
.clang-format
Normal file
|
@ -0,0 +1,14 @@
|
|||
BasedOnStyle: LLVM
|
||||
BreakBeforeBraces: Allman
|
||||
AccessModifierOffset: -4
|
||||
IndentWidth: 4
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
NamespaceIndentation: All
|
||||
SpaceAfterTemplateKeyword: false
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
SpaceAfterControlStatementKeyword: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
SpaceBeforeCtorInitializerColon: false
|
||||
SpaceBeforeInheritanceColon: false
|
||||
SpaceBeforeRangeBasedForLoopColon: false
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
build/
|
||||
.cache/
|
||||
CMakeUserPresets.json
|
31
CMakeLists.txt
Normal file
31
CMakeLists.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
cmake_minimum_required(VERSION 3.22.0)
|
||||
|
||||
set(PROJECT_NAME s2ga)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||
|
||||
project(${PROJECT_NAME})
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(BUILD_ZECSY_TESTS "Build tests?" ON)
|
||||
|
||||
add_library(s2ga STATIC s2ga.hpp)
|
||||
set_target_properties(s2ga PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
#######################################################
|
||||
if(${BUILD_ZECSY_TESTS})
|
||||
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 s2ga)
|
||||
|
||||
include(CTest)
|
||||
include(Catch)
|
||||
catch_discover_tests(tests)
|
||||
endif()
|
18
clang_profile
Normal file
18
clang_profile
Normal file
|
@ -0,0 +1,18 @@
|
|||
[settings]
|
||||
os=Windows
|
||||
arch=x86_64
|
||||
build_type=Release
|
||||
compiler=clang
|
||||
compiler.version=19
|
||||
compiler.cppstd=gnu20
|
||||
compiler.runtime=static
|
||||
compiler.runtime_type=Release
|
||||
compiler.runtime_version=v143
|
||||
|
||||
[buildenv]
|
||||
CC=clang
|
||||
CXX=clang
|
||||
RC=clang
|
||||
|
||||
[conf]
|
||||
tools.cmake.cmaketoolchain:generator=Ninja
|
9
conanfile.txt
Normal file
9
conanfile.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
[requires]
|
||||
catch2/3.8.0
|
||||
|
||||
[generators]
|
||||
CMakeDeps
|
||||
CMakeToolchain
|
||||
|
||||
[layout]
|
||||
cmake_layout
|
4
s2ga.hpp
Normal file
4
s2ga.hpp
Normal file
|
@ -0,0 +1,4 @@
|
|||
inline void foo()
|
||||
{
|
||||
|
||||
}
|
10
tests/test.cpp
Normal file
10
tests/test.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include "../s2ga.hpp"
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE("Should pass")
|
||||
{
|
||||
std::cout << "HI" << std::endl;
|
||||
REQUIRE_NOTHROW(foo());
|
||||
}
|
Loading…
Reference in a new issue