Skip to content

Commit 2d3d515

Browse files
porglezompedymtt
andcommitted
[cmake] Skip primary variant alias in a cleaner way
Adjust the condition and message to skip the primary variant alias in a way that's more clear and more directly matches the explanation in the comments. Co-authored-by: Eric Miotto <[email protected]>
1 parent b2e91be commit 2d3d515

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function(swift_create_stdlib_targets name variant define_all_alias)
202202
# so it can't be added as a target here. build-script will invoke the
203203
# more-specific target, so just skip creating this target and warn in case
204204
# someone is using the CMake more directly.
205-
if(TARGET ${name}${SWIFT_PRIMARY_VARIANT_SUFFIX}${variant})
205+
if(SWIFT_PRIMARY_VARIANT_SDK IN_LIST SWIFT_SDKS)
206206
add_custom_target(${name}${variant}
207207
${ALL_keyword}
208208
DEPENDS
@@ -211,7 +211,7 @@ function(swift_create_stdlib_targets name variant define_all_alias)
211211
PROPERTIES
212212
FOLDER "Swift libraries/Aggregate")
213213
else()
214-
message(WARNING "Primary variant is not being built, target ${name}${SWIFT_PRIMARY_VARIANT_SUFFIX}${variant} does not exist, not creating ${name}${variant} alias target.")
214+
message(WARNING "Primary variant ${SWIFT_PRIMARY_VARIANT_SDK} is not being built, not creating ${name}${variant} alias target for it.")
215215
endif()
216216
endfunction()
217217

0 commit comments

Comments
 (0)