Skip to content

Commit 034441a

Browse files
committed
[cmake] Rename the variable HOST_LIBRARY => FORCE_BUILD_FOR_HOST_SDK in add_swift_library.
HOST_LIBRARY is supposed to mean "no matter what the defaults say, also build this library for the host". FORCE_BUILD_FOR_HOST_SDK is a less confusing name.
1 parent c8bbd63 commit 034441a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ endfunction()
366366
# [IS_STDLIB]
367367
# [IS_STDLIB_CORE]
368368
# [IS_SDK_OVERLAY]
369+
# [FORCE_BUILD_FOR_HOST_SDK]
369370
# INSTALL_IN_COMPONENT comp
370371
# source1 [source2 source3 ...])
371372
#
@@ -429,12 +430,15 @@ endfunction()
429430
# INSTALL_IN_COMPONENT comp
430431
# The Swift installation component that this library belongs to.
431432
#
433+
# FORCE_BUILD_FOR_HOST_SDK
434+
# Regardless of the defaults, also build this library for the host SDK.
435+
#
432436
# source1 ...
433437
# Sources to add into this library
434438
function(_add_swift_library_single target name)
435439
set(SWIFTLIB_SINGLE_options
436440
SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
437-
TARGET_LIBRARY HOST_LIBRARY
441+
TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
438442
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE)
439443
cmake_parse_arguments(SWIFTLIB_SINGLE
440444
"${SWIFTLIB_SINGLE_options}"
@@ -916,6 +920,7 @@ endfunction()
916920
# [IS_STDLIB]
917921
# [IS_STDLIB_CORE]
918922
# [TARGET_LIBRARY]
923+
# [FORCE_BUILD_FOR_HOST_SDK]
919924
# INSTALL_IN_COMPONENT comp
920925
# DEPLOYMENT_VERSION_IOS version
921926
# source1 [source2 source3 ...])
@@ -998,12 +1003,15 @@ endfunction()
9981003
# DEPLOYMENT_VERSION_IOS
9991004
# The minimum deployment version to build for if this is an iOS library.
10001005
#
1006+
# FORCE_BUILD_FOR_HOST_SDK
1007+
# Regardless of the defaults, also build this library for the host SDK.
1008+
#
10011009
# source1 ...
10021010
# Sources to add into this library.
10031011
function(add_swift_library name)
10041012
set(SWIFTLIB_options
10051013
SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
1006-
TARGET_LIBRARY HOST_LIBRARY
1014+
TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
10071015
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE HAS_SWIFT_CONTENT)
10081016
cmake_parse_arguments(SWIFTLIB
10091017
"${SWIFTLIB_options}"
@@ -1084,7 +1092,7 @@ function(add_swift_library name)
10841092
# SDKs building the variants of this library.
10851093
list_intersect(
10861094
"${SWIFTLIB_TARGET_SDKS}" "${SWIFT_SDKS}" SWIFTLIB_TARGET_SDKS)
1087-
if(SWIFTLIB_HOST_LIBRARY)
1095+
if(SWIFTLIB_FORCE_BUILD_FOR_HOST_SDK)
10881096
list_union(
10891097
"${SWIFTLIB_TARGET_SDKS}" "${SWIFT_HOST_VARIANT_SDK}"
10901098
SWIFTLIB_TARGET_SDKS)
@@ -1191,7 +1199,7 @@ function(add_swift_library name)
11911199
${SWIFTLIB_IS_STDLIB_CORE_keyword}
11921200
${SWIFTLIB_IS_SDK_OVERLAY_keyword}
11931201
${SWIFTLIB_TARGET_LIBRARY_keyword}
1194-
${SWIFTLIB_HOST_LIBRARY_keyword}
1202+
${SWIFTLIB_FORCE_BUILD_FOR_HOST_SDK_keyword}
11951203
INSTALL_IN_COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
11961204
DEPLOYMENT_VERSION_IOS "${SWIFTLIB_DEPLOYMENT_VERSION_IOS}"
11971205
)

stdlib/public/Reflection/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftReflection TARGET_LIBRARY HOST_LIBRARY
1+
add_swift_library(swiftReflection TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
22
Demangle.cpp
33
MetadataSource.cpp
44
Remangle.cpp

0 commit comments

Comments
 (0)