🎉 C++ meson project.

main
bog 2023-11-13 20:50:58 +01:00
parent e04623d6b9
commit 92887779ba
6 changed files with 68 additions and 0 deletions

4
.gitignore vendored Normal file
View File

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

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
.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 \
src

0
assets/.keep Normal file
View File

33
meson.build Normal file
View File

@ -0,0 +1,33 @@
project(
'rest-in-dust',
'cpp',
version: '0.0.0',
default_options: [
'warning_level=3',
'cpp_std=c++17',
]
)
datadir = get_option('prefix') / get_option('datadir') / 'rest_in_dust'
conf = configuration_data()
conf.set('version', meson.project_version())
conf.set('datadir', datadir)
configure_file(
input: 'src/conf.in.hpp',
output: 'conf.hpp',
configuration: conf
)
executable(
'rest-in-dust',
sources: [
'src/main.cpp',
],
dependencies: [
],
install: true
)
install_subdir('assets', install_dir: datadir)

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

@ -0,0 +1,10 @@
#ifndef rid_CONF_HPP
#define rid_CONF_HPP
#define RID_VERSION std::string("@version@")
#define RID_DATADIR std::filesystem::path("@datadir@")
#include <filesystem>
#include <string>
#endif

8
src/main.cpp Normal file
View File

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