[geany/geany-plugins] 1f8bb8: Merge pull request #947 from b4n/cppcheck-include
Colomban Wendling
git-noreply at xxxxx
Fri Feb 7 18:54:50 UTC 2020
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Fri, 07 Feb 2020 18:54:50 UTC
Commit: 1f8bb80fff647fb031211f3bf1f470304a3c2c14
https://github.com/geany/geany-plugins/commit/1f8bb80fff647fb031211f3bf1f470304a3c2c14
Log Message:
-----------
Merge pull request #947 from b4n/cppcheck-include
cppcheck: Set Geany include path for it to find header files
Modified Paths:
--------------
build/compat.m4
build/cppcheck.m4
build/cppcheck.mk
Modified: build/compat.m4
18 lines changed, 18 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,18 @@
+dnl taken from Autoconf's m4sh.m4, GPLv3+
+m4_ifndef([AS_VAR_COPY], [
+m4_define([AS_VAR_COPY],
+[AS_LITERAL_WORD_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
+])
+
+dnl taken from pkg-config's pkg.m4, GPLv2+
+m4_ifndef([PKG_CHECK_VAR], [
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+])
Modified: build/cppcheck.m4
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -21,4 +21,8 @@ AC_DEFUN([GP_CHECK_CPPCHECK],
AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$gp_have_cppcheck" = xyes])
GP_STATUS_BUILD_FEATURE_ADD([Static code checking],
[$gp_have_cppcheck])
+
+ GP_GEANY_PKG_CONFIG_PATH_PUSH
+ PKG_CHECK_VAR([GEANY_INCLUDEDIR], [geany], [includedir], [], [])
+ GP_GEANY_PKG_CONFIG_PATH_POP
])
Modified: build/cppcheck.mk
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -4,6 +4,7 @@ if HAVE_CPPCHECK
check-cppcheck: $(srcdir)
$(CPPCHECK) \
-q --template gcc --error-exitcode=2 \
+ -I$(GEANY_INCLUDEDIR)/geany \
$(AM_CPPCHECKFLAGS) $(CPPCHECKFLAGS) \
$(srcdir)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list