aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2018-08-22 21:32:24 +1200
committerScott Anderson <scott@anderso.nz>2018-08-23 14:19:59 +1200
commitf41c411980c7451083b3cd2f168f29ad065eb0d7 (patch)
tree1747ffb4083ca70f3d8b1af07ce283f3f61801b5 /include
parent653ea512c2a44260394c0c3a8d5aecd028c0e188 (diff)
Use input file for configure_file
This is so we can potentially add comments to it, and so if a user looks at the installed header, they can see the /* #undef WLR_HAS_FEATURE */ line to see every option, even if not available.
Diffstat (limited to 'include')
-rw-r--r--include/wlr/config.h.in19
-rw-r--r--include/wlr/meson.build5
-rw-r--r--include/wlr/version.h.in16
3 files changed, 37 insertions, 3 deletions
diff --git a/include/wlr/config.h.in b/include/wlr/config.h.in
new file mode 100644
index 00000000..750ad3b7
--- /dev/null
+++ b/include/wlr/config.h.in
@@ -0,0 +1,19 @@
+#ifndef WLR_CONFIG_H
+#define WLR_CONFIG_H
+
+#mesondefine WLR_HAS_LIBCAP
+
+#mesondefine WLR_HAS_SYSTEMD
+#mesondefine WLR_HAS_ELOGIND
+
+#mesondefine WLR_HAS_X11_BACKEND
+
+#mesondefine WLR_HAS_XWAYLAND
+
+#mesondefine WLR_HAS_XCB_ERRORS
+#mesondefine WLR_HAS_XCB_ICCCM
+#mesondefine WLR_HAS_XCB_XKB
+
+#mesondefine WLR_HAS_POSIX_FALLOCATE
+
+#endif
diff --git a/include/wlr/meson.build b/include/wlr/meson.build
index 14551cb4..43b5aec9 100644
--- a/include/wlr/meson.build
+++ b/include/wlr/meson.build
@@ -4,14 +4,13 @@ version_data.set_quoted('WLR_VERSION_STR', meson.project_version())
version_data.set('WLR_VERSION_MAJOR', version_array[0])
version_data.set('WLR_VERSION_MINOR', version_array[1])
version_data.set('WLR_VERSION_MICRO', version_array[2])
-version_data.set('WLR_VERSION_NUM', '(WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO')
version_data.set('WLR_VERSION_API_CURRENT', so_version[0])
version_data.set('WLR_VERSION_API_REVISION', so_version[1])
version_data.set('WLR_VERSION_API_AGE', so_version[2])
install_headers(
- configure_file(output: 'config.h', configuration: conf_data),
- configure_file(output: 'version.h', configuration: version_data),
+ configure_file(input: 'config.h.in', output: 'config.h',configuration: conf_data),
+ configure_file(input: 'version.h.in', output: 'version.h', configuration: version_data),
'backend.h',
'xcursor.h',
subdir: 'wlr'
diff --git a/include/wlr/version.h.in b/include/wlr/version.h.in
new file mode 100644
index 00000000..cdc0fd75
--- /dev/null
+++ b/include/wlr/version.h.in
@@ -0,0 +1,16 @@
+#ifndef WLR_VERSION_H
+#define WLR_VERSION_H
+
+#mesondefine WLR_VERSION_STR
+
+#mesondefine WLR_VERSION_MAJOR
+#mesondefine WLR_VERSION_MINOR
+#mesondefine WLR_VERSION_MICRO
+
+#define WLR_VERSION_NUM ((WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO)
+
+#mesondefine WLR_VERSION_API_CURRENT
+#mesondefine WLR_VERSION_API_REVISION
+#mesondefine WLR_VERSION_API_AGE
+
+#endif