diff --git a/external/misc/CMakeLists.txt b/external/misc/CMakeLists.txt index 16125d0..685b89a 100644 --- a/external/misc/CMakeLists.txt +++ b/external/misc/CMakeLists.txt @@ -32,9 +32,22 @@ if(LINUX) ) endif() - add_library(misc STATIC - ${misc_SOURCES} - ) + # Add_library doesn't like to get an empty source file list. + # I tried several variations on this theme to test whether the list + # was not empty and was not successful in getting it to work + # on both Alpine and RPi. + #if("${misc_SOURCES}") + # This is less elegant and less maintainable but it works. + + if ((NOT HAVE_STRLCPY) OR (NOT HAVE_STRLCAT)) + add_library(misc STATIC + ${misc_SOURCES} + ) + else() + set(MISC_LIBRARIES "" CACHE INTERNAL "") + endif() + + elseif(WIN32 OR CYGWIN) # windows