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.

(cherry picked from commit 3f556a6e76)
This commit is contained in:
Guy Harris 2021-03-22 19:13:34 -07:00
parent d0fdecc6b6
commit 878e8058a6
1 changed files with 32 additions and 31 deletions

View File

@ -261,6 +261,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}")
@ -1241,7 +1273,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 recently.
include(CheckSymbolExists)
cmake_push_check_state()
if(WIN32)
set(CMAKE_REQUIRED_DEFINITIONS -Dssize_t=int)
@ -1542,36 +1573,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.