From 3f556a6e7639716a7254a4fcdf88e33ef3896fe8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 22 Mar 2021 19:13:34 -0700 Subject: [PATCH] Do the LFS checks before processing any subdirectories. That's necessary in order to make sure that the required -D flags show up when building code from all subdirectories. --- CMakeLists.txt | 63 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aa9c05e95..90d4bc1bcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,38 @@ if(WIN32) set(WILDCARD_OBJ wsetargv.obj) endif(WIN32) +include(CheckSymbolExists) + +# +# Large file support on UN*X, a/k/a LFS. +# +# On Windows, we require _fseeki64() and _ftelli64(). Visual +# Studio has had supported them since Visual Studio 2005/MSVCR80, +# and we require newer versions, so we know we have them. +# +if(NOT WIN32) + include(FindLFS) + if(LFS_FOUND) + # + # Add the required #defines. + # + add_definitions(${LFS_DEFINITIONS}) + endif() + + # + # Check for fseeko as well. + # + include(FindFseeko) + if(FSEEKO_FOUND) + set(HAVE_FSEEKO ON) + + # + # Add the required #defines. + # + add_definitions(${FSEEKO_DEFINITIONS}) + endif() +endif() + # Banner shown at top right of Qt welcome screen. if(DEFINED ENV{WIRESHARK_VERSION_FLAVOR}) set(VERSION_FLAVOR "$ENV{WIRESHARK_VERSION_FLAVOR}") @@ -1246,7 +1278,6 @@ if(GNUTLS_FOUND AND NOT GNUTLS_VERSION VERSION_LESS "3.4.0") # # Check that the support is present in case GnuTLS was compiled # --without-p11-kit as macos-setup.sh did until December 2020. - include(CheckSymbolExists) cmake_push_check_state() if(WIN32) set(CMAKE_REQUIRED_DEFINITIONS -Dssize_t=int) @@ -1546,36 +1577,6 @@ foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS}) add_subdirectory( ${_plugin_src_dir} ) endforeach() -# -# Large file support on UN*X, a/k/a LFS. -# -# On Windows, we require _fseeki64() and _ftelli64(). Visual -# Studio has had supported them since Visual Studio 2005/MSVCR80, -# and we require newer versions, so we know we have them. -# -if(NOT WIN32) - include(FindLFS) - if(LFS_FOUND) - # - # Add the required #defines. - # - add_definitions(${LFS_DEFINITIONS}) - endif() - - # - # Check for fseeko as well. - # - include(FindFseeko) - if(FSEEKO_FOUND) - set(HAVE_FSEEKO ON) - - # - # Add the required #defines. - # - add_definitions(${FSEEKO_DEFINITIONS}) - endif() -endif() - set( VERSION ${PROJECT_VERSION} ) if(VCSVERSION_OVERRIDE) # Allow distributors to override detection of the Git tag and version.