🎉 c++ meson project.

main
bog 2023-10-19 22:38:40 +02:00
parent e0f0b3b311
commit 9475388e20
5 changed files with 70 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.cache
build
*~*
*\#*

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
.PHONY: build tests
build:
meson setup build
meson compile -C build
tests: build
build/snaketests
install: tests
meson install -C build
check:
@cppcheck --language=c++ --enable=all -q \
--suppress=missingIncludeSystem \
src lang

42
meson.build Normal file
View File

@ -0,0 +1,42 @@
project(
'snakefile',
'cpp',
version: '0.0.0',
default_options: [
'prefix=/usr',
'warning_level=3',
'cpp_std=c++20'
]
)
lang = static_library(
'snakelang',
sources: [
]
)
executable(
'snake',
sources: [
'src/main.cpp',
],
dependencies: [
],
link_with: [
lang
],
install: true
)
executable(
'snaketests',
sources: [
'tests/main.cpp',
],
dependencies: [
dependency('catch2')
],
link_with: [
lang
]
)

6
src/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main(int, char**)
{
return 0;
}

2
tests/main.cpp Normal file
View File

@ -0,0 +1,2 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>