mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
meson: add support for ctags
This is a squash of casync commits02fbbdb2b9
(by Silvio Fricke) andb687a94b1e
. Instead of checking during every meson config whether etags are available, just try to call them and error out if not. This has the advantage that the target is always available (if git is installed), and the error message gives a hint what needs to be installed. The naming is confusing, but etags(1) is pretty clear: - emacs expects TAGS file in etags format - vi expects tags file in ctags format and automake docs are pretty clear too: - tags target generates TAGS file - ctags target generates tags file
This commit is contained in:
parent
25fb19da67
commit
0700e8ba71
11
meson.build
11
meson.build
@ -451,7 +451,6 @@ awk = find_program('awk')
|
|||||||
m4 = find_program('m4')
|
m4 = find_program('m4')
|
||||||
stat = find_program('stat')
|
stat = find_program('stat')
|
||||||
git = find_program('git', required : false)
|
git = find_program('git', required : false)
|
||||||
etags = find_program('etags', required : false)
|
|
||||||
|
|
||||||
meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
|
meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
|
||||||
mkdir_p = 'mkdir -p $DESTDIR/@0@'
|
mkdir_p = 'mkdir -p $DESTDIR/@0@'
|
||||||
@ -2321,7 +2320,7 @@ endforeach
|
|||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
if git.found() and etags.found()
|
if git.found()
|
||||||
all_files = run_command(
|
all_files = run_command(
|
||||||
git,
|
git,
|
||||||
['--git-dir=@0@/.git'.format(meson.source_root()),
|
['--git-dir=@0@/.git'.format(meson.source_root()),
|
||||||
@ -2330,9 +2329,13 @@ if git.found() and etags.found()
|
|||||||
all_files = files(all_files.stdout().split())
|
all_files = files(all_files.stdout().split())
|
||||||
|
|
||||||
run_target(
|
run_target(
|
||||||
'TAGS',
|
'tags',
|
||||||
input : all_files,
|
input : all_files,
|
||||||
command : [etags, '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
|
command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
|
||||||
|
run_target(
|
||||||
|
'ctags',
|
||||||
|
input : all_files,
|
||||||
|
command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if git.found()
|
if git.found()
|
||||||
|
Loading…
Reference in New Issue
Block a user