Skip to content

Commit 760447b

Browse files
committed
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
1 parent a87b72e commit 760447b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: external/misc/CMakeLists.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ if(LINUX)
3232
)
3333
endif()
3434

35-
add_library(misc STATIC
36-
${misc_SOURCES}
37-
)
35+
if ( "${misc_SOURCES}" )
36+
add_library(misc STATIC
37+
${misc_SOURCES}
38+
)
39+
else()
40+
# Nothing to build
41+
set(MISC_LIBRARIES "" CACHE INTERNAL "")
42+
endif()
3843

3944
elseif(WIN32 OR CYGWIN) # windows
4045

0 commit comments

Comments
 (0)