meson.build

changeset 41066
00e6bda3ef95
parent 41060
965750033e86
child 41078
84e48180ef67
--- a/meson.build	Fri Oct 01 01:04:00 2021 -0500
+++ b/meson.build	Fri Oct 01 01:06:04 2021 -0500
@@ -75,6 +75,9 @@
     output : 'package_revision.h',
     fallback : meson.project_version())
 
+# For running `meson devenv`.
+devenv = environment()
+
 # For man pages.
 man_conf.set('VERSION', meson.project_version())
 man_conf.set('prefix', get_option('prefix'))
@@ -666,6 +669,16 @@
 configure_file(output : 'config.h',
     configuration : conf)
 
+if meson.version().version_compare('>=0.58.0')
+	config_home = get_option('devenv-config-dir')
+	if config_home == ''
+		config_home = meson.build_root() / 'config'
+	endif
+	devenv.set('XDG_CONFIG_HOME', config_home)
+
+	meson.add_devenv(devenv)
+endif
+
 summary({
     'prefix': get_option('prefix'),
     'bindir': get_option('bindir'),

mercurial