🎉 meson c++ project.

main
bog 2023-10-24 23:09:38 +02:00
parent 1ceb7db908
commit e16b406e6e
5 changed files with 53 additions and 34 deletions

38
.gitignore vendored
View File

@ -1,34 +1,4 @@
# ---> C++
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
build
.cache
*~*
*\#*

8
Makefile Normal file
View File

@ -0,0 +1,8 @@
.PHONY: build
build:
meson setup build
meson compile -C build
install: build
meson install -C build

27
meson.build Normal file
View File

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

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

@ -0,0 +1,6 @@
#ifndef ml_CONF_HPP
#define ml_CONF_HPP
#define ML_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 << "Mornelune v" << ML_VERSION << std::endl;
return 0;
}