aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-06 19:15:09 -0800
committerChris Robinson <[email protected]>2018-11-06 19:15:09 -0800
commitbf63c3d3d8224e2aea6177087e3436db6a046623 (patch)
tree539cfc43917645acb0f23d28245870c2565feb5e /CMakeLists.txt
parent27fbccfb23bf6212c8e4a3ecf4bd61ff764fbfd4 (diff)
Don't set _FILE_OFFSET_BITS on Android
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 11 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 414fd956..567b3d20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,14 +146,17 @@ if(NOT WIN32)
UNSET(OLD_REQUIRED_FLAGS)
ENDIF()
-# Set defines for large file support
-CHECK_FILE_OFFSET_BITS()
-IF(_FILE_OFFSET_BITS)
- SET(CPP_DEFS ${CPP_DEFS} "_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}")
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}")
-ENDIF()
-SET(CPP_DEFS ${CPP_DEFS} _LARGEFILE_SOURCE _LARGE_FILES)
-SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_LARGEFILE_SOURCE -D_LARGE_FILES")
+# Set defines for large file support. Don't set this for Android targets. See:
+# https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html
+IF(NOT ANDROID)
+ CHECK_FILE_OFFSET_BITS()
+ IF(_FILE_OFFSET_BITS)
+ SET(CPP_DEFS ${CPP_DEFS} "_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}")
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}")
+ ENDIF()
+ SET(CPP_DEFS ${CPP_DEFS} _LARGEFILE_SOURCE _LARGE_FILES)
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_LARGEFILE_SOURCE -D_LARGE_FILES")
+ENDIF()
# C99 has restrict, but C++ does not, so we can only utilize __restrict.
SET(RESTRICT_DECL )