aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-26 17:04:30 +0100
committerGitHub <noreply@github.com>2018-01-26 17:04:30 +0100
commit174d1aa81bac9d8795e7047686d51c5b7e75d578 (patch)
tree458948d437a5d32d1a2d1907674ec7f0ef301231
parentab738256ac3cdaadb33dcd6d59accc876c45a51a (diff)
parente5dacbae5d0ee2a712e6426440685ed3f73d4fbe (diff)
Merge pull request #585 from agx/meson
meson: add tags and ctags targets
-rw-r--r--meson.build28
1 files changed, 28 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b86030a6..55b07efa 100644
--- a/meson.build
+++ b/meson.build
@@ -180,3 +180,31 @@ pkgconfig.generate(
name: meson.project_name(),
description: 'Wayland compositor library',
)
+
+git = find_program('git', required: false)
+if git.found()
+ all_files = run_command(
+ git,
+ ['--git-dir=@0@/.git'.format(meson.source_root()),
+ 'ls-files',
+ ':/*.[ch]'])
+ all_files = files(all_files.stdout().split())
+
+ etags = find_program('etags', required: false)
+ if etags.found() and all_files.length() > 0
+ custom_target('etags',
+ build_by_default: true,
+ input: all_files,
+ output: 'TAGS',
+ command: [etags.path(), '-o', 'TAGS'] + all_files)
+ endif
+
+ ctags = find_program('ctags', required: false)
+ if ctags.found() and all_files.length() > 0
+ custom_target('ctags',
+ build_by_default: true,
+ input: all_files,
+ output: 'tags',
+ command: [ctags.path(), '-o', 'tags'] + all_files)
+ endif
+endif