boilerplate
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
build/**
|
||||||
15
.gitmodules
vendored
Normal file
15
.gitmodules
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[submodule "SkywardGradeChecker"]
|
||||||
|
path = SkywardGradeChecker
|
||||||
|
url = https://git.keshavanand.net/KeshavAnandCode/SkywardGradeChecker
|
||||||
|
[submodule "external/spdlog"]
|
||||||
|
path = external/spdlog
|
||||||
|
url = https://github.com/gabime/spdlog
|
||||||
|
[submodule "external/cpr"]
|
||||||
|
path = external/cpr
|
||||||
|
url = https://github.com/libcpr/cpr
|
||||||
|
[submodule "external/clickhouse-cpp"]
|
||||||
|
path = external/clickhouse-cpp
|
||||||
|
url = https://github.com/ClickHouse/clickhouse-cpp
|
||||||
|
[submodule "external/tomlplusplus"]
|
||||||
|
path = external/tomlplusplus
|
||||||
|
url = https://github.com/marzer/tomlplusplus
|
||||||
79
CMakeLists.txt
Normal file
79
CMakeLists.txt
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Force Clang before project() is called
|
||||||
|
# -----------------------------
|
||||||
|
if(NOT DEFINED CMAKE_C_COMPILER)
|
||||||
|
set(CMAKE_C_COMPILER clang CACHE STRING "" FORCE)
|
||||||
|
endif()
|
||||||
|
if(NOT DEFINED CMAKE_CXX_COMPILER)
|
||||||
|
set(CMAKE_CXX_COMPILER clang++ CACHE STRING "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Project setup
|
||||||
|
# -----------------------------
|
||||||
|
project(mainframe LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Dependencies (local submodules / cloned repos)
|
||||||
|
# -----------------------------
|
||||||
|
add_subdirectory(external/spdlog)
|
||||||
|
add_subdirectory(external/cpr)
|
||||||
|
add_subdirectory(external/clickhouse-cpp)
|
||||||
|
add_subdirectory(external/tomlplusplus)
|
||||||
|
# -----------------------------
|
||||||
|
# Executable
|
||||||
|
# -----------------------------
|
||||||
|
add_executable(${PROJECT_NAME} src/main.cpp)
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Auto-discover include dirs under src/
|
||||||
|
# -----------------------------
|
||||||
|
file(GLOB_RECURSE SRC_SUBDIRS LIST_DIRECTORIES true "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
|
||||||
|
set(SRC_INCLUDES "")
|
||||||
|
foreach(dir ${SRC_SUBDIRS})
|
||||||
|
if(IS_DIRECTORY ${dir})
|
||||||
|
list(APPEND SRC_INCLUDES ${dir})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Auto-discover all .cpp files except main.cpp
|
||||||
|
# -----------------------------
|
||||||
|
file(GLOB_RECURSE ALL_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
||||||
|
list(REMOVE_ITEM ALL_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Apply sources and includes
|
||||||
|
# -----------------------------
|
||||||
|
target_sources(${PROJECT_NAME} PRIVATE ${ALL_CPP})
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${SRC_INCLUDES})
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Link libraries
|
||||||
|
# -----------------------------
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
spdlog::spdlog
|
||||||
|
cpr::cpr
|
||||||
|
clickhouse-cpp-lib
|
||||||
|
tomlplusplus::tomlplusplus
|
||||||
|
)
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Compiler warnings (Clang/GCC)
|
||||||
|
# -----------------------------
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
|
||||||
|
add_compile_options(
|
||||||
|
-Wall -Wextra -Wpedantic
|
||||||
|
-Wconversion -Wshadow
|
||||||
|
-Wnull-dereference
|
||||||
|
-Wdouble-promotion
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
1
SkywardGradeChecker
Submodule
1
SkywardGradeChecker
Submodule
Submodule SkywardGradeChecker added at 8f01eaacb5
1
external/clickhouse-cpp
vendored
Submodule
1
external/clickhouse-cpp
vendored
Submodule
Submodule external/clickhouse-cpp added at 3c94b44894
1
external/cpr
vendored
Submodule
1
external/cpr
vendored
Submodule
Submodule external/cpr added at 53e2d28696
1
external/spdlog
vendored
Submodule
1
external/spdlog
vendored
Submodule
Submodule external/spdlog added at 0209b12c50
1
external/tomlplusplus
vendored
Submodule
1
external/tomlplusplus
vendored
Submodule
Submodule external/tomlplusplus added at e7aaccca3f
Reference in New Issue
Block a user