fix(Net): Issue concerning Net/CMakeLists.txt detection of HAVE_SENDFILE #4852

This commit is contained in:
Günter Obiltschnig 2025-02-08 13:48:14 +01:00
parent a1abf9659d
commit 24ff931071

View File

@ -10,7 +10,7 @@ POCO_HEADERS_AUTO(SRCS ${HDRS_G})
POCO_SOURCES_AUTO_PLAT(SRCS WIN32 src/wepoll.c)
POCO_HEADERS_AUTO(SRCS src/wepoll.h)
if (MSVC)
if (MSVC OR MINGW)
set(HAVE_SENDFILE ON)
else()
include(CheckIncludeFiles)
@ -18,8 +18,8 @@ else()
check_include_files(sys/sendfile.h HAVE_SYS_SENDFILE_H)
if(HAVE_SYS_SENDFILE_H)
check_symbol_exists(sendfile sys/sendfile.h HAVE_SENDFILE)
if (NOT DEFINED HAVE_SENDFILE)
check_symbol_exists(sendfile64 sys/sendfile.h HAVE_SENDFILE)
if (NOT HAVE_SENDFILE)
check_symbol_exists(sendfile64 sys/sendfile.h HAVE_SENDFILE64)
endif()
else()
# BSD version
@ -27,7 +27,7 @@ else()
endif()
endif()
if (DEFINED HAVE_SENDFILE)
if (HAVE_SENDFILE OR HAVE_SENDFILE64)
message(STATUS "OS has native sendfile function")
add_compile_definitions(POCO_HAVE_SENDFILE)
endif()