From 24ff93107113d7efe722026c3f81e454ac7a4ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sat, 8 Feb 2025 13:48:14 +0100 Subject: [PATCH] fix(Net): Issue concerning Net/CMakeLists.txt detection of HAVE_SENDFILE #4852 --- Net/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index 2dea608a2..0989f0843 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -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()