🎉 C++ meson project.
parent
aecc22bcba
commit
ae91f57f93
|
@ -0,0 +1,4 @@
|
||||||
|
*\#*
|
||||||
|
*~*
|
||||||
|
.cache
|
||||||
|
build
|
|
@ -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
|
|
@ -0,0 +1,31 @@
|
||||||
|
project('bloody-gun',
|
||||||
|
'cpp',
|
||||||
|
version: '0.0.0',
|
||||||
|
default_options: [
|
||||||
|
'warning_level=3',
|
||||||
|
'cpp_std=c++17'
|
||||||
|
])
|
||||||
|
|
||||||
|
datadir = get_option('prefix') / get_option('datadir') / 'bloody_gun'
|
||||||
|
|
||||||
|
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(
|
||||||
|
'bloody-gun',
|
||||||
|
sources: [
|
||||||
|
'src/main.cpp',
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
],
|
||||||
|
install: true
|
||||||
|
)
|
||||||
|
|
||||||
|
install_subdir('assets', install_dir: datadir)
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef bg_COMMONS_HPP
|
||||||
|
#define bg_COMMONS_HPP
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include "conf.hpp"
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef bg_CONF_HPP
|
||||||
|
#define bg_CONF_HPP
|
||||||
|
|
||||||
|
#define BG_VERSION std::string("@version@")
|
||||||
|
#define BG_DATADIR std::filesystem::path("@datadir@")
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include "commons.hpp"
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
std::cout << "Bloody Gun v" << BG_VERSION << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue