mirror of
https://git.allpurposem.at/mat/WiggleWobble.git
synced 2025-12-23 13:01:28 +01:00
add meson infra
This commit is contained in:
parent
90283112bf
commit
e8903702b3
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
obj/
|
compile_commands.json
|
||||||
|
/build
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
[example]
|
[example]
|
||||||
description = "Example plugin"
|
description = "Example plugin"
|
||||||
version = "1.0.0"
|
|
||||||
author = "YOU"
|
author = "YOU"
|
||||||
|
## NOTE: version is omitted here because I don't like having multiple places
|
||||||
|
## to update the version string. Feel free to add it back in.
|
||||||
|
#
|
||||||
|
# version = "v0.0.0"
|
||||||
|
|
||||||
[example.build]
|
[example.build]
|
||||||
output = "example.so"
|
output = "build/src/example.so"
|
||||||
steps = [
|
steps = [
|
||||||
"make all",
|
"meson setup build",
|
||||||
|
"meson compile -Cbuild"
|
||||||
]
|
]
|
||||||
|
|||||||
18
meson.build
Normal file
18
meson.build
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
project('example', 'cpp', 'c',
|
||||||
|
# we always take the VERSION file as the single source of truth
|
||||||
|
version: run_command('cat', join_paths(meson.project_source_root(), 'VERSION'), check: true).stdout().strip(),
|
||||||
|
default_options: ['buildtype=release'],
|
||||||
|
)
|
||||||
|
|
||||||
|
cpp_compiler = meson.get_compiler('cpp')
|
||||||
|
if cpp_compiler.has_argument('-std=c++23')
|
||||||
|
add_global_arguments('-std=c++23', language: 'cpp')
|
||||||
|
elif cpp_compiler.has_argument('-std=c++2b')
|
||||||
|
add_global_arguments('-std=c++2b', language: 'cpp')
|
||||||
|
else
|
||||||
|
error('Could not configure current C++ compiler (' + cpp_compiler.get_id() + ' ' + cpp_compiler.version() + ') with required C++ standard (C++23)')
|
||||||
|
endif
|
||||||
|
|
||||||
|
hyprland_headers = dependency('hyprland')
|
||||||
|
|
||||||
|
subdir('src')
|
||||||
1
src/VERSION
Normal file
1
src/VERSION
Normal file
@ -0,0 +1 @@
|
|||||||
|
v0.0.0
|
||||||
@ -1,6 +1,8 @@
|
|||||||
#define WLR_USE_UNSTABLE
|
#define WLR_USE_UNSTABLE
|
||||||
|
|
||||||
#include "globals.hpp"
|
#include "globals.hpp"
|
||||||
|
// version.hpp will be generated by meson
|
||||||
|
#include "version.hpp"
|
||||||
|
|
||||||
#include <hyprland/src/Window.hpp>
|
#include <hyprland/src/Window.hpp>
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
|
|||||||
24
src/meson.build
Normal file
24
src/meson.build
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
subdir('gestures')
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'version.hpp.in',
|
||||||
|
output: 'version.hpp',
|
||||||
|
configuration: {
|
||||||
|
'PLUGIN_VERSION': meson.project_version()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
shared_module('example',
|
||||||
|
'main.cpp',
|
||||||
|
cpp_args: ['-DWLR_USE_UNSTABLE'],
|
||||||
|
link_with: [gestures],
|
||||||
|
# sometimes you need to add other hyprland dependencies yourself
|
||||||
|
dependencies: [
|
||||||
|
dependency('pixman-1'),
|
||||||
|
dependency('libinput'),
|
||||||
|
dependency('wayland-server'),
|
||||||
|
dependency('xkbcommon'),
|
||||||
|
dependency('libdrm'),
|
||||||
|
hyprland_headers
|
||||||
|
],
|
||||||
|
install: true)
|
||||||
2
src/version.hpp.in
Normal file
2
src/version.hpp.in
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// "@PLUGIN_VERSION@" will be replaced with the actual version via meson
|
||||||
|
#define PLUGIN_VERSION "@PLUGIN_VERSION@"
|
||||||
Loading…
Reference in New Issue
Block a user