Skip to content

Commit 4991c51

Browse files
committed
build: only add dependencies if needed
The dependencies may be empty which will fail. Guard against that.
1 parent 4d4448e commit 4991c51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/modules/SwiftSupport.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ function(add_swift_target target)
151151
${documentation})
152152
else()
153153
add_library(${target}-static STATIC ${objs})
154-
add_dependencies(${target}-static ${AST_DEPENDS})
154+
if(AST_DEPENDS)
155+
add_dependencies(${target}-static ${AST_DEPENDS})
156+
endif()
155157
get_filename_component(ast_output_bn ${AST_OUTPUT} NAME)
156158
string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
157159
string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})

0 commit comments

Comments
 (0)