@@ -82,6 +82,7 @@ project_source_root = meson.current_source_dir()
# Cleanup the leftover config.h files to avoid conflicts with the meson
# generated config.h
git = find_program('git', required : false)
+env = find_program('env')
if git.found()
run_command('clean_config.sh',
env : 'GIT_DIR=@0@/.git'.format(project_source_root),
@@ -111,6 +112,24 @@ else
)
endif
+if git.found()
+ all_files = run_command(
+ env, '-u', 'GIT_WORK_TREE',
+ git, '--git-dir=@0@/.git'.format(project_source_root),
+ 'ls-files', ':/*.[ch]',
+ check : false)
+ if all_files.returncode() == 0
+ all_files = files(all_files.stdout().split())
+ custom_target(
+ 'tags',
+ output : 'tags',
+ command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
+ run_target(
+ 'ctags',
+ command : [env, 'ctags', '-o', '@0@/tags'.format(project_source_root)] + all_files)
+ endif
+endif
+
versiondep = declare_dependency(
compile_args: ['-include', 'version.h'],
sources: version_h
Copy the systemd approach to generating tags with a file listing from git. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- meson.build | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)