Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1cd7ce

Browse files
committed
Integrate cpluspluscheck into build system.
Previously cpluspluscheck wouldn't work in vpath builds, this commitfixes that. To make it easier to invoke, there's a top-levelcpluspluscheck target.Discussion:https://postgr.es/20190530220244.kiputcbl4gkl2oo6@alap3.anarazel.de
1 parent72b6223 commitb1cd7ce

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

‎GNUmakefile.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,7 @@ distcheck: dist
128128
rm -rf $(distdir) $(dummy)
129129
@echo "Distribution integrity checks out."
130130

131+
cpluspluscheck: submake-generated-headers
132+
$(top_srcdir)/src/tools/pginclude/cpluspluscheck $(top_srcdir) $(abs_top_builddir)
133+
131134
.PHONY: dist distdir distcheck docs install-docs world check-world install-world installcheck-world

‎src/tools/pginclude/cpluspluscheck

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
#!/bin/sh
22

33
# Check all exported PostgreSQL include files for C++ compatibility.
4-
# Run this from the top-level source directory after performing a build.
4+
#
5+
# Argument 1 is the top-level source directory, argument 2 the
6+
# top-level build directory (they might be the same). If not set, they
7+
# default to the current directory.
8+
#
9+
# Needs to be run after all generated headers are created.
10+
#
511
# No output if everything is OK, else compiler errors.
612

13+
if [-z"$1" ];then
14+
srcdir="."
15+
else
16+
srcdir="$1"
17+
fi
18+
19+
if [-z"$2" ];then
20+
builddir="$."
21+
else
22+
builddir="$2"
23+
fi
24+
725
me=`basename$0`
826

927
tmp=`mktemp -d /tmp/$me.XXXXXX`
@@ -22,7 +40,7 @@ trap 'rm -rf $tmp' 0 1 2 3 15
2240
# which itself contains C++ code and so won't compile with a C++
2341
# compiler under extern "C" linkage.
2442

25-
forfin`find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name'*.h' -print| \
43+
forfin`cd"$srcdir"&&find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name'*.h' -print| \
2644
grep -v -e ^src/include/port/ \
2745
-e ^src/include/rusagestub.h -e ^src/include/regex/regerrs.h \
2846
-e ^src/include/access/rmgrlist.h \
@@ -36,5 +54,7 @@ do
3654
echo'};'
3755
}>$tmp/test.cpp
3856

39-
${CXX:-g++} -I. -I src/interfaces/libpq -I src/include -fsyntax-only -Wall -c$tmp/test.cpp
57+
${CXX:-g++} -I$srcdir -I$srcdir/src/interfaces/libpq -I$srcdir/src/include \
58+
-I$builddir -I$builddir/src/interfaces/libpq -I$builddir/src/include \
59+
-fsyntax-only -Wall -c$tmp/test.cpp
4060
done

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp