add cmake files

This commit is contained in:
Nicholas Orlowsky 2024-05-10 06:13:31 -05:00
parent 734e37de37
commit 207015c944
Signed by: nickorlow
GPG key ID: 838827D8C4611687
2 changed files with 48 additions and 0 deletions

12
src/.gitignore vendored Normal file
View file

@ -0,0 +1,12 @@
CMakeLists.txt.user
anthracite-bin
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

36
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
project(anthracite)
add_custom_target(build-supplemental
COMMAND cd ./build && ./version.sh && python3 ./error_gen.py
)
add_custom_target(lint
COMMAND clang-tidy *.cpp
)
add_custom_target(lint-fix
COMMAND clang-tidy *.cpp -fix -fix-errors
)
add_custom_target(format
COMMAND clang-format *.cpp -i
)
add_custom_target(build-docker
COMMAND docker build .. -t anthracite
)
add_custom_target(run
COMMAND anthracite-bin
DEPENDS anthracite-bin
WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
)
add_executable(anthracite-bin main.cpp)
add_dependencies(anthracite-bin build-supplemental)