Commit 55a524cf authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

org: detect C++ errors

* doc/org/g++wrap.in: Save error messages.
* doc/Makefile.am: Display them at the end of the compilation.
parent f9eefdc2
......@@ -57,9 +57,12 @@ dist_pkgdata_DATA = $(srcdir)/spot.tag
.PHONY: org org-man
org:
cd $(top_builddir) && $(MAKE) doc/org/init.el
rm -rf $(srcdir)/userdoc
rm -rf $(srcdir)/userdoc $(builddir)/org/org.errors
$(MAKE) org-man org/plantuml.jar
$(EMACS) --batch -Q -l org/init.el
if test -s $(builddir)/org/org.errors; then \
cat $(builddir)/org/org.errors; exit 1; \
else :; fi
org/plantuml.jar:
wget http://downloads.sourceforge.net/project/plantuml/plantuml.jar -O org/plantuml.jar || curl http://downloads.sourceforge.net/project/plantuml/plantuml.jar -o org/plantuml.jar
......
#!/bin/sh
# This is a wrapper around the compiler, to ensure that the code
# example run from the org-mode file are all linked with Spot.
exec @top_builddir@/libtool link @CXX@ -std=c++11 -Wall \
-I@abs_top_builddir@ -I@abs_top_srcdir@ -I@abs_top_srcdir@/buddy/src \
"$@" @abs_top_builddir@/spot/libspot.la
#
# Also we save errors to org.errors, so that we can detect issues
# after org-mode has exported everything. Otherwise these errors
# would go undetected.
@top_builddir@/libtool link @CXX@ @CXXFLAGS@ -Wall -Werror \
-I@abs_top_builddir@ -I@abs_top_srcdir@ -I@abs_top_srcdir@/buddy/src \
"$@" @abs_top_builddir@/spot/libspot.la 2> errors.$$
code=$?
if test $code -ne 0 && test -s errors.$$; then
cat errors.$$ >>org.errors
cat errors.$$ >&2
fi
rm -f errors.$$
exit $code
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment