diff options
author | Chris Robinson <[email protected]> | 2019-09-22 11:17:31 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-22 11:17:31 -0700 |
commit | 9c95f62e95a76059548762f2e7d2e9bb0e8d4631 (patch) | |
tree | 016c8ecbdd7be4a00cbb23b89ae99b0aeea064fe | |
parent | 5f6a35c960da4174670640fc9a805186968694df (diff) |
Remove large file macros
Large file offsets aren't being utilized, and C++ seems to use to 64-bit
offsets anyway.
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | cmake/CheckFileOffsetBits.c | 9 | ||||
-rw-r--r-- | cmake/CheckFileOffsetBits.cmake | 39 |
3 files changed, 0 insertions, 61 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 81eb25bf..b9087e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckTypeSize) include(CheckStructHasMember) -include(CheckFileOffsetBits) include(GNUInstallDirs) @@ -150,18 +149,6 @@ if(NOT WIN32) UNSET(OLD_REQUIRED_FLAGS) ENDIF() -# 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 ) CHECK_CXX_SOURCE_COMPILES("int *__restrict foo; diff --git a/cmake/CheckFileOffsetBits.c b/cmake/CheckFileOffsetBits.c deleted file mode 100644 index de98296e..00000000 --- a/cmake/CheckFileOffsetBits.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <sys/types.h> - -#define KB ((off_t)(1024)) -#define MB ((off_t)(KB*1024)) -#define GB ((off_t)(MB*1024)) -int tb[((GB+GB+GB) > GB) ? 1 : -1]; - -int main() -{ return 0; } diff --git a/cmake/CheckFileOffsetBits.cmake b/cmake/CheckFileOffsetBits.cmake deleted file mode 100644 index 1dc154e4..00000000 --- a/cmake/CheckFileOffsetBits.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# - Check if the _FILE_OFFSET_BITS macro is needed for large files -# CHECK_FILE_OFFSET_BITS() -# -# The following variables may be set before calling this macro to -# modify the way the check is run: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# Copyright (c) 2009, Chris Robinson -# -# Redistribution and use is allowed according to the terms of the LGPL license. - - -MACRO(CHECK_FILE_OFFSET_BITS) - - IF(NOT DEFINED _FILE_OFFSET_BITS) - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files") - TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64 - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CheckFileOffsetBits.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) - IF(NOT __WITHOUT_FILE_OFFSET_BITS_64) - TRY_COMPILE(__WITH_FILE_OFFSET_BITS_64 - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CheckFileOffsetBits.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64) - ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64) - - IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - 64") - ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - not needed") - ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - ENDIF(NOT DEFINED _FILE_OFFSET_BITS) - -ENDMACRO(CHECK_FILE_OFFSET_BITS)
\ No newline at end of file |