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
This commit is contained in:
Brett T. Warden 2023-08-14 09:05:00 -07:00
parent a87b72e040
commit 760447b6e2
1 changed files with 8 additions and 3 deletions

View File

@ -32,9 +32,14 @@ if(LINUX)
) )
endif() endif()
if ( "${misc_SOURCES}" )
add_library(misc STATIC add_library(misc STATIC
${misc_SOURCES} ${misc_SOURCES}
) )
else()
# Nothing to build
set(MISC_LIBRARIES "" CACHE INTERNAL "")
endif()
elseif(WIN32 OR CYGWIN) # windows elseif(WIN32 OR CYGWIN) # windows