Skip to content

Commit 5f418d4

Browse files
acozzettejtattermusch
authored andcommitted
Require C++11 and pass -std=c++11
This commit updates the Autotools build to require a C++11 compiler and explicitly pass -std=c++11. This seems to be necessary for enabling C++11 support in older compilers.
1 parent f8262db commit 5f418d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
8888
# Protocol Buffers contains several checks that are intended to be used only
8989
# for debugging and which might hurt performance. Most users are probably
9090
# end users who don't want these checks, so add -DNDEBUG by default.
91-
CXXFLAGS="$CXXFLAGS -DNDEBUG"
91+
CXXFLAGS="$CXXFLAGS -std=c++11 -DNDEBUG"
9292
9393
AC_MSG_RESULT([use default: $PROTOBUF_OPT_FLAG $CXXFLAGS])
9494
],[
@@ -207,7 +207,7 @@ case "$target_os" in
207207
esac
208208
AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
209209

210-
AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
210+
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
211211

212212
# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
213213
# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock

0 commit comments

Comments
 (0)