From 758ba58c81273d9075a539216f8a322935c2e434 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 12 Nov 2021 16:49:21 +0000 Subject: [PATCH] CMake: Move include(CheckCSourceCompiles) before its macros are used Move include(CheckCSourceCompiles) before any of the check_c_source_compiles() macros is called. This fixes a CMake error when compiling with WITH_NETWORK_GET_BUFFER disabled. Signed-off-by: Paul Cercueil --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7437136c8..05b4feff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,9 +296,10 @@ if(WITH_NETWORK_BACKEND) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + include(CheckCSourceCompiles) + option(WITH_NETWORK_GET_BUFFER "Enable experimental zero-copy transfers" OFF) if (WITH_NETWORK_GET_BUFFER) - include(CheckCSourceCompiles) check_c_source_compiles("#define _GNU_SOURCE=1\n#include \nint main(void) { return O_TMPFILE; }" HAS_O_TMPFILE)