diff --git a/configure b/configure index 1cc233dfa2..9e3b20f6b7 100755 --- a/configure +++ b/configure @@ -20186,6 +20186,10 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi + + if test "$HAVE_CXX11" = "1" ; then + OBJCXXFLAGS="$OBJCXXFLAGS $switch" + fi fi if test "x$SUNCXX" != xyes; then @@ -20415,7 +20419,8 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then fi if test "$HAVE_CXX11" = "1" ; then - CXXFLAGS="$CXXFLAGS -stdlib=libc++" + CXXFLAGS="$CXXFLAGS -stdlib=libc++" + OBJCXXFLAGS="$OBJCXXFLAGS -stdlib=libc++" LDFLAGS="$LDFLAGS -stdlib=libc++" fi diff --git a/configure.in b/configure.in index 8457112a47..6804f244bc 100644 --- a/configure.in +++ b/configure.in @@ -1065,6 +1065,12 @@ if test "$wxUSE_CXX11" = "yes"; then dnl We still continue even if C++11 support is not available, would it be dnl better to stop with an error in this case? AX_CXX_COMPILE_STDCXX(11,,optional) + + if test "$HAVE_CXX11" = "1" ; then + dnl The standard macro above doesn't set Objective-C++ flags, but we do + dnl need them too. + OBJCXXFLAGS="$OBJCXXFLAGS $switch" + fi fi dnl ar command @@ -1233,8 +1239,10 @@ fi if test "$HAVE_CXX11" = "1" ; then dnl We also need to use libc++ standard library instead of libstdc++ for - dnl C++11 support, both when compiling and when linking. + dnl C++11 support, both when compiling (for both C++ and Objective-C++) and + dnl when linking. CXXFLAGS="$CXXFLAGS -stdlib=libc++" + OBJCXXFLAGS="$OBJCXXFLAGS -stdlib=libc++" LDFLAGS="$LDFLAGS -stdlib=libc++" fi