Skip to content

Commit 8057117

Browse files
fxdupontandrei-pavel
authored andcommitted
[#3730] Update meson.build
1 parent a4f48dc commit 8057117

File tree

4 files changed

+87
-80
lines changed

4 files changed

+87
-80
lines changed

doc/devel/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ configure_file(
1313
configuration: make_devel_conf_data,
1414
)
1515
make_devel = f'@current_build_dir@/make-devel.sh'
16-
MAKE_DEVEL = run_target('make-devel', command: [CD_AND_RUN, current_source_dir, make_devel])
16+
run_target('devel', command: [CD_AND_RUN, current_source_dir, make_devel])

doc/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ make_grammar = configure_file(
9696
output: 'make-grammar.sh',
9797
configuration: {'TOP_SOURCE_DIR': TOP_SOURCE_DIR},
9898
)
99-
MAKE_GRAMMAR = run_target('make-grammar', command: [make_grammar])
99+
run_target('grammar', command: [make_grammar])

doc/sphinx/meson.build

+7-5
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,13 @@ mandir = get_option('mandir')
120120
mandir8 = f'@PREFIX@/@mandir@/man8/'
121121
make_conf_data.set('mandir8', mandir8)
122122

123-
MAKE_DOC = disabler()
124123
if sphinx_exe.found()
125124
make_doc = configure_file(
126125
input: 'make-doc.sh.in',
127126
output: 'make-doc.sh',
128127
configuration: make_conf_data,
129128
)
130-
MAKE_DOC = run_target('make-doc', command: [make_doc])
129+
run_target('doc', command: [make_doc])
131130
endif
132131
make_install = configure_file(
133132
input: 'make-install.sh.in',
@@ -149,7 +148,10 @@ make_update_python_dependencies = configure_file(
149148
output: 'make-update-python-dependencies.sh',
150149
configuration: make_conf_data,
151150
)
151+
run_target('mes-doc', command: [make_mes_doc])
152+
run_target('uml', command: [make_uml])
153+
run_target(
154+
'update-python-dependencies',
155+
command: [make_update_python_dependencies],
156+
)
152157
meson.add_install_script(make_install)
153-
MAKE_MES_DOC = run_target('make-mes-doc', command: [make_mes_doc])
154-
MAKE_UML = run_target('make-uml', command: [make_uml])
155-
MAKE_UPDATE_PYTHON_DEPENDENCIES = run_target('make-update-python-dependencies', command: [make_update_python_dependencies])

meson.build

+78-73
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ xmllint_exe = find_program('xmllint', required: false)
167167
pip_compile_exe = find_program('pip-compile', required: false)
168168
install_exe = find_program('install', required: true)
169169
valgrind_exe = find_program('valgrind', required: false)
170+
cppcheck_exe = find_program('cppcheck', required: false)
171+
cppcheck_htmlreport_exe = find_program('cppcheck-htmlreport', required: false)
170172

171173
if python_exe.found()
172174
PYTHON = python_exe.full_path()
@@ -648,6 +650,69 @@ else
648650
report_conf_data.set('GTEST_LIBDIR', 'unknown')
649651
endif
650652

653+
#### Custom Targets
654+
655+
run_target(
656+
'add-changelog-entry',
657+
command: [f'@TOP_SOURCE_DIR@/changelog_unreleased/.add-entry.sh'],
658+
)
659+
660+
# todo: remove redirections
661+
if cppcheck_exe.found()
662+
run_target(
663+
'cppcheck',
664+
command: [
665+
cppcheck_exe,
666+
'-I.',
667+
'-I./src/lib',
668+
'-I./src/bin',
669+
'--error-exitcode=1',
670+
'--inline-suppr',
671+
'--quiet',
672+
'--max-configs=256',
673+
f'--suppressions-list=@TOP_SOURCE_DIR@/src/cppcheck-suppress.lst',
674+
'--template={file}:{line}: check_fail: {message} ({severity},{id})',
675+
'--xml',
676+
'--xml-version=2',
677+
'.',
678+
'>',
679+
'cppcheck-result.xml',
680+
'2>&1',
681+
],
682+
)
683+
endif
684+
685+
if cppcheck_htmlreport_exe.found()
686+
run_target(
687+
'cppcheck-report',
688+
command: [
689+
cppcheck_htmlreport_exe,
690+
'--file',
691+
'./cppcheck-result.xml',
692+
'--report-dir',
693+
'./report',
694+
'--title',
695+
'"cppcheck report"',
696+
],
697+
)
698+
endif
699+
700+
if valgrind_exe.found()
701+
add_test_setup(
702+
'valgrind',
703+
exe_wrapper: [
704+
valgrind_exe,
705+
'--child-silent-after-fork=yes',
706+
'--fullpath-after=',
707+
'--leak-check=full',
708+
'--num-callers=64',
709+
'--quiet',
710+
'--show-leak-kinds=all',
711+
'--suppressions=src/valgrind.supp',
712+
],
713+
)
714+
endif
715+
651716
#### Configuration Files
652717

653718
config_report_sh = configure_file(
@@ -656,6 +721,12 @@ config_report_sh = configure_file(
656721
configuration: report_conf_data,
657722
)
658723

724+
CONFIG_REPORT = custom_target(
725+
output: 'config.report',
726+
depend_files: [config_report_sh],
727+
command: [f'@TOP_BUILD_DIR@/config-report.sh'],
728+
)
729+
659730
# TODO: Change to config.h.in when autotools are removed.
660731
configure_file(
661732
input: 'meson-config.h.in',
@@ -674,68 +745,6 @@ configure_file(
674745
install_dir: 'include/kea',
675746
)
676747

677-
#### Custom Targets
678-
679-
run_target(
680-
'add-changelog-entry',
681-
command: ['changelog_unreleased/.add-entry.sh'],
682-
)
683-
684-
CONFIG_REPORT = custom_target(
685-
output: 'config.report',
686-
depend_files: [config_report_sh],
687-
command: [f'@TOP_BUILD_DIR@/config-report.sh'],
688-
)
689-
690-
run_target(
691-
'cppcheck',
692-
command: [
693-
'cppcheck',
694-
'-I.',
695-
'-I./src/lib',
696-
'-I./src/bin',
697-
'--error-exitcode=1',
698-
'--inline-suppr',
699-
'--quiet',
700-
'--max-configs=256',
701-
f'--suppressions-list=@TOP_SOURCE_DIR@/src/cppcheck-suppress.lst',
702-
'--template={file}:{line}: check_fail: {message} ({severity},{id})',
703-
'--xml',
704-
'--xml-version=2',
705-
'.',
706-
'>',
707-
'cppcheck-result.xml',
708-
'2>&1',
709-
],
710-
)
711-
712-
run_target(
713-
'cppcheck-report',
714-
command: [
715-
'cppcheck-htmlreport',
716-
'--file',
717-
'./cppcheck-result.xml',
718-
'--report-dir',
719-
'./report',
720-
'--title',
721-
'"cppcheck report"',
722-
],
723-
)
724-
725-
add_test_setup(
726-
'valgrind',
727-
exe_wrapper: [
728-
valgrind_exe,
729-
'--child-silent-after-fork=yes',
730-
'--fullpath-after=',
731-
'--leak-check=full',
732-
'--num-callers=64',
733-
'--quiet',
734-
'--show-leak-kinds=all',
735-
'--suppressions=src/valgrind.supp',
736-
],
737-
)
738-
739748
#### Build Starts Here
740749

741750
LIBS_BUILT_SO_FAR = []
@@ -749,6 +758,13 @@ if have_premium
749758
subdir('premium')
750759
endif
751760

761+
#### More Custom Targets
762+
763+
alias_target('messages', TARGETS_GEN_MESSAGES)
764+
alias_target('parser', TARGETS_GEN_PARSER)
765+
766+
#### Installation
767+
752768
top_docs = [
753769
'AUTHORS',
754770
'CONTRIBUTING.md',
@@ -761,14 +777,3 @@ top_docs = [
761777
]
762778
install_data(top_docs, install_dir: 'share/doc/kea')
763779
install_emptydir('var/run/kea')
764-
765-
#### More Custom Targets
766-
767-
alias_target('doc', MAKE_DOC)
768-
alias_target('devel', MAKE_DEVEL)
769-
alias_target('grammar', MAKE_GRAMMAR)
770-
alias_target('messages', TARGETS_GEN_MESSAGES)
771-
alias_target('mes-doc', MAKE_MES_DOC)
772-
alias_target('parser', TARGETS_GEN_PARSER)
773-
alias_target('uml', MAKE_UML)
774-
alias_target('update-python-dependencies', MAKE_UPDATE_PYTHON_DEPENDENCIES)

0 commit comments

Comments
 (0)