From 28693db66c42bf48b9d748aba869d4fe149b6b44 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Sun, 16 Jul 2017 12:22:32 -0400 Subject: [PATCH] Use CXXFLAGS when compiling parsers (#197) ANTLR generates C files that we compile with the C++ compiler. To do so, we set CC=CXX in the `Makefile.am`s of the parsers. Previously, we did not copy the CXXFLAGS to the CFLAGS, which could result in problems, e.g. when using -std=gnu++11 in the CXXFLAGS, compiling the parsers would fail if they used C++11 features (configure.ac usually modifies CXX to include the -std=gnu++11 flag but if it is included in CXXFLAGS, the CXX is not changed). --- src/parser/cvc/Makefile.am | 3 ++- src/parser/smt1/Makefile.am | 1 + src/parser/smt2/Makefile.am | 1 + src/parser/tptp/Makefile.am | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parser/cvc/Makefile.am b/src/parser/cvc/Makefile.am index 8f084ba34..ff3308d89 100644 --- a/src/parser/cvc/Makefile.am +++ b/src/parser/cvc/Makefile.am @@ -4,8 +4,9 @@ AM_CPPFLAGS = \ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) $(WNO_PARENTHESES) $(WNO_TAUTOLOGICAL_COMPARE) -Wno-unused-function -Wno-unused-variable $(WNO_UNINITIALIZED) $(WNO_CONVERSION_NULL) # Compile generated C files using C++ compiler -CC=$(CXX) AM_CFLAGS = $(AM_CXXFLAGS) +CFLAGS=$(CXXFLAGS) +CC=$(CXX) ANTLR_OPTS = diff --git a/src/parser/smt1/Makefile.am b/src/parser/smt1/Makefile.am index ae49d0659..f5320002d 100644 --- a/src/parser/smt1/Makefile.am +++ b/src/parser/smt1/Makefile.am @@ -5,6 +5,7 @@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) $(WNO_PARENTH # Compile generated C files using C++ compiler AM_CFLAGS = $(AM_CXXFLAGS) +CFLAGS=$(CXXFLAGS) CC=$(CXX) ANTLR_OPTS = diff --git a/src/parser/smt2/Makefile.am b/src/parser/smt2/Makefile.am index fece5e5e8..995e442e6 100644 --- a/src/parser/smt2/Makefile.am +++ b/src/parser/smt2/Makefile.am @@ -5,6 +5,7 @@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) $(WNO_PARENTH # Compile generated C files using C++ compiler AM_CFLAGS = $(AM_CXXFLAGS) +CFLAGS=$(CXXFLAGS) CC=$(CXX) ANTLR_OPTS = diff --git a/src/parser/tptp/Makefile.am b/src/parser/tptp/Makefile.am index eab01103f..43bbc595d 100644 --- a/src/parser/tptp/Makefile.am +++ b/src/parser/tptp/Makefile.am @@ -5,6 +5,7 @@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) $(WNO_PARENTH # Compile generated C files using C++ compiler AM_CFLAGS = $(AM_CXXFLAGS) +CFLAGS=$(CXXFLAGS) CC=$(CXX) ANTLR_OPTS = -- 2.30.2