summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2024-03-03 12:55:11 +0100
committerThomas E. Dickey <dickey@his.com>2024-03-07 00:42:09 +0000
commit1ffcb516954add31a225d38675adad1df8fa5d21 (patch)
tree56cc45fae8fbe7fd0b185191ac0789505fc8ca25 /meson.build
parent451e1b036d3dd0fddcf54733b5616169ed5ad570 (diff)
Add meson as alternative build system
Add a note to the readme file to clarify that the default build system is still automake. Signed-off-by: Tim Wiederhake <twied@gmx.net>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build46
1 files changed, 46 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..b560add
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,46 @@
+project(
+ 'twm',
+ 'c',
+ default_options: [
+ 'warning_level=3',
+ 'werror=true',
+ ],
+ version: '1.0.12',
+)
+
+add_project_arguments(
+ '-DAPP_VERSION="@0@"'.format(meson.project_version()),
+ language: 'c',
+)
+
+add_project_arguments(
+ '-DDATA_DIR="@0@"'.format(get_option('datadir')),
+ language: 'c',
+)
+
+if meson.get_compiler('c').has_function('mkstemp')
+ add_project_arguments(
+ '-DHAVE_MKSTEMP=1',
+ language: 'c',
+ )
+endif
+
+twm_dependencies = [
+ dependency('x11'),
+ dependency('xext'),
+ dependency('xt'),
+ dependency('xmu'),
+ dependency('ice'),
+ dependency('sm'),
+ dependency('xproto', version:'>=7.0.17'),
+]
+
+xrandr = dependency('xrandr', required: false)
+if xrandr.found()
+ twm_dependencies += xrandr
+
+ add_project_arguments('-DHAVE_XRANDR', language: 'c')
+endif
+
+subdir('src')
+subdir('man')