Update minimum iOS version to 7.0 for shared_ptr/unordered_map.

- In order to correctly detect shared_ptr (& unordered_map)
  the iOS version must be >= 7.0 (Xcode 5.0+).  This only affects the
  SIMULATOR(64) platform builds, as the OS (device) build uses the
  latest SDK which is now likely 8.0+.

Change-Id: Iefec8f03408b8cdc7a495f442ebba081f800adb0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25234ef..b2cb280 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,14 +149,14 @@
 # Use ios-cmake to build a static library for iOS
 #
 # We need to add isysroot to force cmake to find the toolchains from the iOS SDK
-# instead of using the standard ones. And add flag mios-simulator-version so clang
-# knows we are building for ios simulator but not mac.
+# instead of using the standard ones. And add flag mios-simulator-version so
+# clang knows we are building for ios simulator but not mac.
 #
-# You can build for OS (armv7, armv7s, arm64), SIMULATOR (i386) or SIMULATOR64 (x86_64)
-# separately and use lipo to merge them into one static library.
+# You can build for OS (armv7, armv7s, arm64), SIMULATOR (i386) or SIMULATOR64
+# (x86_64) separately and use lipo to merge them into one static library.
 #
 # There are some features/algorithms are not available in iOS version and the
-# minimum supported iOS version is 6.0 now.
+# minimum supported iOS version is now 7.0.
 #
 # Use cmake ../ceres-solver -DCMAKE_TOOLCHAIN_FILE=../ceres-solver/cmake/iOS.cmake \
 # -DIOS_PLATFORM=PLATFORM -DEIGEN_INCLUDE_DIR=/path/to/eigen/header
@@ -179,11 +179,12 @@
   UPDATE_CACHE_VARIABLE(GFLAGS OFF)
   UPDATE_CACHE_VARIABLE(OPENMP OFF)
 
-  # Apple claims that the BLAS call dsyrk_ is a private API, and will not allow you
-  # to submit to the Apple Store if the symbol is present.
+  # Apple claims that the BLAS call dsyrk_ is a private API, and will not allow
+  # you to submit to the Apple Store if the symbol is present.
   UPDATE_CACHE_VARIABLE(LAPACK OFF)
 
-  MESSAGE(STATUS "Building for iOS: SuiteSparse, CXSparse, LAPACK, gflags, and OpenMP are not available.")
+  MESSAGE(STATUS "Building for iOS: SuiteSparse, CXSparse, LAPACK, gflags, "
+    "and OpenMP are not available.")
 
   UPDATE_CACHE_VARIABLE(BUILD_EXAMPLES OFF)
   MESSAGE(STATUS "Building for iOS, will not build examples.")
@@ -191,9 +192,13 @@
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-abi-version=2 -fobjc-arc -isysroot ${CMAKE_OSX_SYSROOT}")
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-abi-version=2 -fobjc-arc -isysroot ${CMAKE_OSX_SYSROOT}")
 
-  IF (${IOS_PLATFORM} STREQUAL "SIMULATOR" OR ${IOS_PLATFORM} STREQUAL "SIMULATOR64")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=6.0")
-  ENDIF()
+   IF (${IOS_PLATFORM} STREQUAL "SIMULATOR" OR
+       ${IOS_PLATFORM} STREQUAL "SIMULATOR64")
+     # By default, the minimum version is < 7.0, which causes problems with
+     # detection of shared_ptr & unordered_map as pre-7.0 used libstdc++
+     # but 7.0+ uses libc++ (also LLVM-GCC was removed from Xcode 5).
+     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=7.0")
+   ENDIF()
 ENDIF (IOS)
 
 # Prior to October 2013, Ceres used some non-CMake standardised variables to
diff --git a/docs/source/building.rst b/docs/source/building.rst
index 2e61ea6..fe3def3 100644
--- a/docs/source/building.rst
+++ b/docs/source/building.rst
@@ -440,7 +440,7 @@
 
 .. NOTE::
 
-   You need iOS version 6.0 or higher to build Ceres Solver.
+   You need iOS version 7.0 or higher to build Ceres Solver.
 
 To build Ceres for iOS, we need to force ``CMake`` to find the toolchains from
 the iOS SDK instead of using the standard ones. For example: