🎉 meson C++ project.
parent
7deda1940a
commit
774be1e651
|
@ -0,0 +1,4 @@
|
||||||
|
*~*
|
||||||
|
*\#*
|
||||||
|
build
|
||||||
|
.cache
|
19
LICENSE
19
LICENSE
|
@ -2,8 +2,21 @@ MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 bog
|
Copyright (c) 2023 bog
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
.PHONY: build install
|
||||||
|
|
||||||
|
build:
|
||||||
|
meson setup build
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
install: build
|
||||||
|
meson install -C build
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef maze_COMMON_HPP
|
||||||
|
#define maze_COMMON_HPP
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <string>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <functional>
|
||||||
|
#include <optional>
|
||||||
|
#include <any>
|
||||||
|
|
||||||
|
#define MAZE_GEN_ENUM(X) X
|
||||||
|
#define MAZE_GEN_STRING(X) #X
|
||||||
|
|
||||||
|
#define MAZE_ENUM(PREFIX, KINDS) \
|
||||||
|
enum PREFIX { KINDS(MAZE_GEN_ENUM) }; \
|
||||||
|
constexpr char const* PREFIX ## Str [] = { KINDS(MAZE_GEN_STRING) }
|
||||||
|
|
||||||
|
#define MAZE_ERROR(ERR) \
|
||||||
|
struct ERR : public std::runtime_error { \
|
||||||
|
ERR (std::string const& what): std::runtime_error(what) {} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef m4ze_CONFIG_HPP
|
||||||
|
#define m4ze_CONFIG_HPP
|
||||||
|
|
||||||
|
#define M4ZE_VERSION std::string("@version@")
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include "config.hpp"
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
std::cout << "M4ZE: v" << M4ZE_VERSION << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
project('m4ze',
|
||||||
|
'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: 'game/config.in.hpp',
|
||||||
|
output: 'config.hpp',
|
||||||
|
configuration: conf
|
||||||
|
)
|
||||||
|
|
||||||
|
m4ze_core_lib = static_library(
|
||||||
|
'm4ze-core',
|
||||||
|
sources: [
|
||||||
|
],
|
||||||
|
include_directories: [
|
||||||
|
'core/',
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
m4ze_core_dep = declare_dependency(
|
||||||
|
link_with: [m4ze_core_lib],
|
||||||
|
include_directories: ['core/']
|
||||||
|
)
|
||||||
|
|
||||||
|
executable(
|
||||||
|
'm4ze',
|
||||||
|
sources: [
|
||||||
|
'game/main.cpp',
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
m4ze_core_dep
|
||||||
|
],
|
||||||
|
install: true
|
||||||
|
)
|
Reference in New Issue