@@ -167,6 +167,8 @@ xmllint_exe = find_program('xmllint', required: false)
167
167
pip_compile_exe = find_program (' pip-compile' , required : false )
168
168
install_exe = find_program (' install' , required : true )
169
169
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 )
170
172
171
173
if python_exe.found()
172
174
PYTHON = python_exe.full_path()
@@ -648,6 +650,69 @@ else
648
650
report_conf_data.set(' GTEST_LIBDIR' , ' unknown' )
649
651
endif
650
652
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
+
651
716
#### Configuration Files
652
717
653
718
config_report_sh = configure_file (
@@ -656,6 +721,12 @@ config_report_sh = configure_file(
656
721
configuration : report_conf_data,
657
722
)
658
723
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
+
659
730
# TODO: Change to config.h.in when autotools are removed.
660
731
configure_file (
661
732
input : ' meson-config.h.in' ,
@@ -674,68 +745,6 @@ configure_file(
674
745
install_dir : ' include/kea' ,
675
746
)
676
747
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
-
739
748
#### Build Starts Here
740
749
741
750
LIBS_BUILT_SO_FAR = []
@@ -749,6 +758,13 @@ if have_premium
749
758
subdir (' premium' )
750
759
endif
751
760
761
+ #### More Custom Targets
762
+
763
+ alias_target (' messages' , TARGETS_GEN_MESSAGES)
764
+ alias_target (' parser' , TARGETS_GEN_PARSER)
765
+
766
+ #### Installation
767
+
752
768
top_docs = [
753
769
' AUTHORS' ,
754
770
' CONTRIBUTING.md' ,
@@ -761,14 +777,3 @@ top_docs = [
761
777
]
762
778
install_data (top_docs, install_dir : ' share/doc/kea' )
763
779
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