From 371b9a7fc2ec5e5b24315a96084b75c3bedcc5df Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Fri, 19 Jan 2024 22:48:43 +0100 Subject: [PATCH] Move check for strlcpy before config.h generation Fixes: 225aa107f671 ("Define strlcpy only on platforms where it's not available") --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23c920aef..c6f998a81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -326,6 +326,9 @@ if(HAVE_LINK_ATOMIC) set(PLATFORM_LIBS ${PLATFORM_LIBS} "-latomic") endif() +include(CheckSymbolExists) +check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY) + check_include_files(endian.h HAVE_ENDIAN_H) configure_file( @@ -693,9 +696,6 @@ endif() # Set some optimizations and tweaks include(CheckCSourceCompiles) -include(CheckSymbolExists) - -check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY) set(CMAKE_REQUIRED_INCLUDES ${LUA_INCLUDE_DIR}) if(USE_LUAJIT)