Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake error on external misc library #487

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
bwarden committed Aug 14, 2023
commit 760447b6e2795a760e9e45ff6f6f63729f83b8e9
11 changes: 8 additions & 3 deletions external/misc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down