🎉 meson cpp project.

main
bog 2023-10-28 22:08:25 +02:00
parent 8f2e087250
commit 5fec2c0045
5 changed files with 58 additions and 0 deletions

4
.gitignore vendored Normal file
View File

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

14
Makefile Normal file
View File

@ -0,0 +1,14 @@
.PHONY: build
build:
meson setup build
meson compile -C build
install: build
meson install -C build
check:
@cppcheck --language=c++ --enable=all -q \
--suppress=missingInclude \
--suppress=missingIncludeSystem \
src

26
meson.build Normal file
View File

@ -0,0 +1,26 @@
project('duck2d',
'cpp',
version: '0.0.0',
default_options: [
'prefix=/usr',
'warning_level=3',
'cpp_std=c++17',
])
conf = configuration_data()
conf.set('version', meson.project_version())
configure_file(
input: 'src/conf.in.hpp',
output: 'conf.hpp',
configuration: conf
)
executable('d2d',
sources: [
'src/main.cpp',
],
dependencies: [
],
install: true)

6
src/conf.in.hpp Normal file
View File

@ -0,0 +1,6 @@
#ifndef d2_CONF_HPP
#define d2_CONF_HPP
#define DUCK_VERSION std::string("@version@")
#endif

8
src/main.cpp Normal file
View File

@ -0,0 +1,8 @@
#include <iostream>
#include "conf.hpp"
int main(int, char**)
{
std::cout << "Duck2D " << DUCK_VERSION << std::endl;
return 0;
}