Add a workaround for an Android NDK compiler bug.
On certain NDK build configurations, one of the innermost
parts of the Schur eliminator would get compiled
incorrectly. The compiler changed a -= to a +=.
The normal Ceres unit tests caught the problem; however,
since it is not possible to build the tests with the NDK
(only with the standalone toolchain) this was difficult to
track down. Finding the issue involved pasting the schur
eliminator unit test inside of solver_impl.cc and other such
hacks.
Change-Id: Ie91bb545d74fe39f0c8cbd1a6eb69ee4d8b25fb2
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73893bd..4152ecc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -479,9 +479,10 @@
ENDIF ("${UNIX}" AND NOT ${BUILD_ANDROID})
# Disable threads in mutex.h. Someday, after there is OpenMP support in
-# Android, this can get removed.
+# Android, this can get removed. Also turn on a workaround for an NDK bug.
IF (${BUILD_ANDROID})
ADD_DEFINITIONS(-DCERES_NO_THREADS)
+ ADD_DEFINITIONS(-DCERES_WORK_AROUND_ANDROID_NDK_COMPILER_BUG)
ENDIF (${BUILD_ANDROID})
OPTION(DISABLE_TR1