From 760447b6e2795a760e9e45ff6f6f63729f83b8e9 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Mon, 14 Aug 2023 09:05:00 -0700 Subject: [PATCH] Fix cmake error on external misc library For Linux builds, if strlcpt and strlcat are already provided, cmake is given an empty list of sources to build for the "misc" library. Newer versions of cmake throw an error for this. In this case, we should just avoid building the library. Failure pattern: CMake Error at external/misc/CMakeLists.txt:35 (add_library): No SOURCES given to target: misc CMake Generate step failed. Build files cannot be regenerated correctly. Fixes #319 --- external/misc/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/external/misc/CMakeLists.txt b/external/misc/CMakeLists.txt index 16125d0a..05efcc5e 100644 --- a/external/misc/CMakeLists.txt +++ b/external/misc/CMakeLists.txt @@ -32,9 +32,14 @@ if(LINUX) ) endif() - add_library(misc STATIC - ${misc_SOURCES} - ) + if ( "${misc_SOURCES}" ) + add_library(misc STATIC + ${misc_SOURCES} + ) + else() + # Nothing to build + set(MISC_LIBRARIES "" CACHE INTERNAL "") + endif() elseif(WIN32 OR CYGWIN) # windows