File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -196,13 +196,23 @@ function(swift_create_stdlib_targets name variant define_all_alias)
196196 if (NOT define_all_alias)
197197 set (ALL_keyword ALL )
198198 endif ()
199- add_custom_target (${name}${variant}
200- ${ALL_keyword}
201- DEPENDS
202- ${name}${SWIFT_PRIMARY_VARIANT_SUFFIX}${variant} )
203- set_target_properties (${name}${variant}
204- PROPERTIES
205- FOLDER "Swift libraries/Aggregate" )
199+
200+ # When cross-compiling host tools for multiple architectures, targeting a
201+ # different SDK, the primary variant is not one of the variants being built,
202+ # so it can't be added as a target here. build-script will invoke the
203+ # more-specific target, so just skip creating this target and warn in case
204+ # someone is using the CMake more directly.
205+ if (SWIFT_PRIMARY_VARIANT_SDK IN_LIST SWIFT_SDKS)
206+ add_custom_target (${name}${variant}
207+ ${ALL_keyword}
208+ DEPENDS
209+ ${name}${SWIFT_PRIMARY_VARIANT_SUFFIX}${variant} )
210+ set_target_properties (${name}${variant}
211+ PROPERTIES
212+ FOLDER "Swift libraries/Aggregate" )
213+ else ()
214+ message (WARNING "Primary variant ${SWIFT_PRIMARY_VARIANT_SDK} is not being built, not creating ${name}${variant} alias target for it." )
215+ endif ()
206216endfunction ()
207217
208218swift_create_stdlib_targets("swift-stdlib" "" TRUE )
You can’t perform that action at this time.
0 commit comments