diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -207,6 +207,14 @@ ) endif() +# Enable LFS (Large File Support) on targets that don't have it natively. +# This should be defined before the libraries are included as leveldb need the +# definition to be set. +if(NOT HAVE_LARGE_FILE_SUPPORT) + add_compile_definitions(_FILE_OFFSET_BITS=64) + add_linker_flags(-Wl,--large-address-aware) +endif() + # Create a target for OpenSSL include(BrewHelper) find_brew_prefix(OPENSSL_ROOT_DIR openssl) @@ -331,12 +339,6 @@ target_sources(util PRIVATE compat/glibc_compat.cpp) endif() -# Enable LFS (Large File Support) on targets that don't have it natively. -if(NOT HAVE_LARGE_FILE_SUPPORT) - add_compiler_flags(-D_FILE_OFFSET_BITS=64) - add_linker_flags(-Wl,--large-address-aware) -endif() - # Target specific configs if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(Boost_USE_STATIC_LIBS ON)