-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add boilerplate CMake project and Taskfile tasks to lint CMake…
… files. (#7)
- Loading branch information
1 parent
915a8a9
commit 03a98d9
Showing
6 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# yamllint disable-line rule:line-length | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json | ||
|
||
line_length: 100 | ||
list_expansion: "favour-expansion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# CMake 3.22.1 is the default on Ubuntu 22.04 | ||
cmake_minimum_required(VERSION 3.22.1) | ||
|
||
project( | ||
spider | ||
LANGUAGES | ||
C | ||
CXX | ||
VERSION 0.1.0 | ||
) | ||
|
||
# Enable exporting compile commands | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS | ||
ON | ||
CACHE BOOL | ||
"Enable/Disable output of compile commands during generation." | ||
FORCE | ||
) | ||
|
||
# Set the default build type to Release if not specified | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(SPIDER_DEFAULT_BUILD_TYPE "Release") | ||
message(STATUS "No build type specified. Setting to '${SPIDER_DEFAULT_BUILD_TYPE}'.") | ||
set(CMAKE_BUILD_TYPE | ||
"${SPIDER_DEFAULT_BUILD_TYPE}" | ||
CACHE STRING | ||
"Choose the type of build." | ||
FORCE | ||
) | ||
endif() | ||
|
||
add_executable(spider) | ||
target_compile_features(spider PRIVATE cxx_std_20) | ||
|
||
set(SPIDER_SOURCES src/spider/spider.cpp) | ||
target_sources(spider PRIVATE ${SPIDER_SOURCES}) | ||
|
||
target_include_directories(spider PRIVATE src/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
gersemi>=0.16.2 | ||
yamllint>=1.35.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello, world!" << std::endl; | ||
return 0; | ||
} |