Skip to content

Commit

Permalink
Proper check for C++ compiler (from Fabio)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissie-c committed Sep 17, 2018
1 parent 4aa9d08 commit cf6c346
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
fi

AC_PROG_CXX
AM_CONDITIONAL(HAVE_GXX, [test "x$GXX" = xyes])
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
Expand Down
9 changes: 7 additions & 2 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ check: check-headers
.PHONY: check-headers
check-headers: $(auto_c_files:.c=.o) $(auto_c_files:.c=.opp)

# this is to attest basic sanity for using libqb from C++ code when possible
# this is to check basic sanity of using libqb from C++ code, if possible
%.opp: %.c
@which $(CXX) >/dev/null && $(CXX) $(AM_CPPFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
if HAVE_GXX
$(AM_V_GEN)$(CXX) $(AM_CPPFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
else
@echo "C++ compatibility tests not run"
endif

CLEANFILES += ${auto_c_files:.c=.opp}

distclean-local:
Expand Down

0 comments on commit cf6c346

Please sign in to comment.