Skip to content

Commit 758ba58

Browse files
committed
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 <[email protected]>
1 parent c2fbae7 commit 758ba58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,10 @@ if(WITH_NETWORK_BACKEND)
296296
endif()
297297

298298
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
299+
include(CheckCSourceCompiles)
300+
299301
option(WITH_NETWORK_GET_BUFFER "Enable experimental zero-copy transfers" OFF)
300302
if (WITH_NETWORK_GET_BUFFER)
301-
include(CheckCSourceCompiles)
302303
check_c_source_compiles("#define _GNU_SOURCE=1\n#include <fcntl.h>\nint main(void) { return O_TMPFILE; }"
303304
HAS_O_TMPFILE)
304305

0 commit comments

Comments
 (0)