Skip to content

Commit 328de9e

Browse files
committed
[SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only* static library versions of the stdlib, change `add_swift_library` such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`. Ideally, only these flags would be used to determine whether to build shared, static, or object libraries, but that is not currently the case -- `add_swift_library` also checks whether the library `IS_STDLIB` before performing certain additional actions. This will be cleaned up in a future commit.
1 parent e9fff22 commit 328de9e

File tree

75 files changed

+120
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+120
-83
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ endfunction()
361361
# target
362362
# name
363363
# [SHARED]
364+
# [STATIC]
364365
# [SDK sdk]
365366
# [ARCHITECTURE architecture]
366367
# [DEPENDS dep1 ...]
@@ -390,6 +391,9 @@ endfunction()
390391
# SHARED
391392
# Build a shared library.
392393
#
394+
# STATIC
395+
# Build a static library.
396+
#
393397
# SDK sdk
394398
# SDK to build for.
395399
#
@@ -448,7 +452,7 @@ endfunction()
448452
# Sources to add into this library
449453
function(_add_swift_library_single target name)
450454
set(SWIFTLIB_SINGLE_options
451-
SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
455+
SHARED STATIC OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
452456
TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
453457
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE)
454458
cmake_parse_arguments(SWIFTLIB_SINGLE
@@ -473,6 +477,13 @@ function(_add_swift_library_single target name)
473477
if("${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}" STREQUAL "")
474478
message(FATAL_ERROR "INSTALL_IN_COMPONENT is required")
475479
endif()
480+
481+
if(NOT SWIFTLIB_SINGLE_SHARED AND
482+
NOT SWIFTLIB_SINGLE_STATIC AND
483+
NOT SWIFTLIB_SINGLE_OBJECT_LIBRARY)
484+
message(FATAL_ERROR
485+
"Either SHARED, STATIC, or OBJECT_LIBRARY must be specified")
486+
endif()
476487

477488
# Determine the subdirectory where this library will be installed.
478489
set(SWIFTLIB_SINGLE_SUBDIR
@@ -681,7 +692,7 @@ function(_add_swift_library_single target name)
681692
# Do these LAST.
682693

683694
set(target_static)
684-
if(SWIFTLIB_SINGLE_IS_STDLIB AND SWIFT_BUILD_STATIC_STDLIB)
695+
if(SWIFTLIB_SINGLE_IS_STDLIB AND SWIFTLIB_SINGLE_STATIC)
685696
set(target_static "${target}-static")
686697

687698
# We have already compiled Swift sources. Link everything into a static
@@ -920,6 +931,7 @@ endfunction()
920931
# Usage:
921932
# add_swift_library(name
922933
# [SHARED]
934+
# [STATIC]
923935
# [DEPENDS dep1 ...]
924936
# [LINK_LIBRARIES dep1 ...]
925937
# [INTERFACE_LINK_LIBRARIES dep1 ...]
@@ -949,6 +961,9 @@ endfunction()
949961
# SHARED
950962
# Build a shared library.
951963
#
964+
# STATIC
965+
# Build a static library.
966+
#
952967
# DEPENDS
953968
# Targets that this library depends on.
954969
#
@@ -1028,7 +1043,7 @@ endfunction()
10281043
# Sources to add into this library.
10291044
function(add_swift_library name)
10301045
set(SWIFTLIB_options
1031-
SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
1046+
SHARED STATIC OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
10321047
TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
10331048
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE HAS_SWIFT_CONTENT)
10341049
cmake_parse_arguments(SWIFTLIB
@@ -1042,7 +1057,6 @@ function(add_swift_library name)
10421057

10431058
if(SWIFTLIB_IS_SDK_OVERLAY)
10441059
set(SWIFTLIB_HAS_SWIFT_CONTENT TRUE)
1045-
set(SWIFTLIB_SHARED TRUE)
10461060
set(SWIFTLIB_IS_STDLIB TRUE)
10471061
set(SWIFTLIB_TARGET_LIBRARY TRUE)
10481062

@@ -1104,6 +1118,13 @@ function(add_swift_library name)
11041118
if("${SWIFTLIB_INSTALL_IN_COMPONENT}" STREQUAL "")
11051119
message(FATAL_ERROR "INSTALL_IN_COMPONENT is required")
11061120
endif()
1121+
1122+
if(NOT SWIFTLIB_SHARED AND
1123+
NOT SWIFTLIB_STATIC AND
1124+
NOT SWIFTLIB_OBJECT_LIBRARY)
1125+
message(FATAL_ERROR
1126+
"Either SHARED, STATIC, or OBJECT_LIBRARY must be specified")
1127+
endif()
11071128

11081129
if(SWIFTLIB_TARGET_LIBRARY)
11091130
# If we are building this library for targets, loop through the various
@@ -1196,6 +1217,7 @@ function(add_swift_library name)
11961217
${VARIANT_NAME}
11971218
${name}
11981219
${SWIFTLIB_SHARED_keyword}
1220+
${SWIFTLIB_STATIC_keyword}
11991221
${SWIFTLIB_OBJECT_LIBRARY_keyword}
12001222
${SWIFTLIB_SOURCES}
12011223
SDK ${sdk}
@@ -1231,7 +1253,7 @@ function(add_swift_library name)
12311253
endif()
12321254
endforeach()
12331255

1234-
if (SWIFT_BUILD_STATIC_STDLIB AND SWIFTLIB_IS_STDLIB)
1256+
if (SWIFTLIB_IS_STDLIB AND SWIFTLIB_STATIC)
12351257
# Add dependencies on the (not-yet-created) custom lipo target.
12361258
foreach(DEP ${SWIFTLIB_LINK_LIBRARIES})
12371259
if (NOT "${DEP}" STREQUAL "icucore")
@@ -1300,7 +1322,7 @@ function(add_swift_library name)
13001322
# If we built static variants of the library, create a lipo target for
13011323
# them.
13021324
set(lipo_target_static)
1303-
if (SWIFT_BUILD_STATIC_STDLIB AND SWIFTLIB_IS_STDLIB)
1325+
if (SWIFTLIB_IS_STDLIB AND SWIFTLIB_STATIC)
13041326
set(THIN_INPUT_TARGETS_STATIC)
13051327
foreach(TARGET ${THIN_INPUT_TARGETS})
13061328
list(APPEND THIN_INPUT_TARGETS_STATIC "${TARGET}-static")
@@ -1366,6 +1388,8 @@ function(add_swift_library name)
13661388
${name}
13671389
${name}
13681390
${SWIFTLIB_SHARED_keyword}
1391+
${SWIFTLIB_STATIC_keyword}
1392+
${SWIFTLIB_OBJECT_LIBRARY_keyword}
13691393
${SWIFTLIB_SOURCES}
13701394
SDK ${sdk}
13711395
ARCHITECTURE ${arch}

lib/AST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftAST
1+
add_swift_library(swiftAST STATIC
22
ArchetypeBuilder.cpp
33
ASTContext.cpp
44
ASTDumper.cpp

lib/ASTSectionImporter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftASTSectionImporter
1+
add_swift_library(swiftASTSectionImporter STATIC
22
ASTSectionImporter.cpp
33
LINK_LIBRARIES swiftBasic
44
COMPONENT_DEPENDS core)

lib/Basic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}")
5858
set(version_inc_files
5959
${llvm_revision_inc} ${clang_revision_inc} ${swift_revision_inc})
6060

61-
add_swift_library(swiftBasic
61+
add_swift_library(swiftBasic STATIC
6262
Cache.cpp
6363
ClusteredBitVector.cpp
6464
Demangle.cpp

lib/ClangImporter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ handle_gyb_sources(
88
generated_include_sources
99
"")
1010

11-
add_swift_library(swiftClangImporter
11+
add_swift_library(swiftClangImporter STATIC
1212
CFTypeInfo.cpp
1313
ClangDiagnosticConsumer.cpp
1414
ClangImporter.cpp

lib/Driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(swiftDriver_sources
1414

1515
set(swiftDriver_targetDefines)
1616

17-
add_swift_library(swiftDriver
17+
add_swift_library(swiftDriver STATIC
1818
${swiftDriver_sources}
1919
DEPENDS SwiftOptions
2020
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)

lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftFrontend
1+
add_swift_library(swiftFrontend STATIC
22
CompilerInvocation.cpp
33
DiagnosticVerifier.cpp
44
Frontend.cpp

lib/FrontendTool/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftFrontendTool
1+
add_swift_library(swiftFrontendTool STATIC
22
FrontendTool.cpp
33
DEPENDS SwiftOptions
44
LINK_LIBRARIES

lib/IDE/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftIDE
1+
add_swift_library(swiftIDE STATIC
22
CodeCompletion.cpp
33
CodeCompletionCache.cpp
44
CommentConversion.cpp

lib/IRGen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftIRGen
1+
add_swift_library(swiftIRGen STATIC
22
DebugTypeInfo.cpp
33
EnumPayload.cpp
44
ExtraInhabitants.cpp

lib/Immediate/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftImmediate
1+
add_swift_library(swiftImmediate STATIC
22
Immediate.cpp
33
REPL.cpp
44
LINK_LIBRARIES

lib/Index/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftIndex
1+
add_swift_library(swiftIndex STATIC
22
Index.cpp
33
IndexDataConsumer.cpp
44
IndexSymbol.cpp

lib/LLVMPasses/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftLLVMPasses
1+
add_swift_library(swiftLLVMPasses STATIC
22
LLVMSwiftAA.cpp
33
LLVMSwiftRCIdentity.cpp
44
LLVMARCOpts.cpp

lib/Markup/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftMarkup
1+
add_swift_library(swiftMarkup STATIC
22
AST.cpp
33
LineList.cpp
44
Markup.cpp

lib/Option/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftOption
1+
add_swift_library(swiftOption STATIC
22
Options.cpp
33
SanitizerOptions.cpp
44
DEPENDS SwiftOptions

lib/Parse/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftParse
1+
add_swift_library(swiftParse STATIC
22
Lexer.cpp
33
ParseDecl.cpp
44
ParseExpr.cpp

lib/PrintAsObjC/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftPrintAsObjC
1+
add_swift_library(swiftPrintAsObjC STATIC
22
PrintAsObjC.cpp
33

44
LINK_LIBRARIES

lib/RemoteAST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftRemoteAST
1+
add_swift_library(swiftRemoteAST STATIC
22
RemoteAST.cpp
33
LINK_LIBRARIES
44
swiftSema swiftIRGen)

lib/SIL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSIL
1+
add_swift_library(swiftSIL STATIC
22
AbstractionPattern.cpp
33
Bridging.cpp
44
Dominance.cpp

lib/SILGen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSILGen
1+
add_swift_library(swiftSILGen STATIC
22
ArgumentSource.cpp
33
Cleanup.cpp
44
Condition.cpp

lib/SILOptimizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ add_subdirectory(SILCombiner)
88
add_subdirectory(Transforms)
99
add_subdirectory(UtilityPasses)
1010
add_subdirectory(Utils)
11-
add_swift_library(swiftSILOptimizer
11+
add_swift_library(swiftSILOptimizer STATIC
1212
${ARC_SOURCES}
1313
${ANALYSIS_SOURCES}
1414
${SILCOMBINER_SOURCES}

lib/Sema/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSema
1+
add_swift_library(swiftSema STATIC
22
CodeSynthesis.cpp
33
Constraint.cpp
44
ConstraintGraph.cpp

lib/Serialization/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSerialization
1+
add_swift_library(swiftSerialization STATIC
22
Deserialization.cpp
33
DeserializeSIL.cpp
44
ModuleFile.cpp

stdlib/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ else()
1010
set(CMAKE_C_COMPILER_ARG1 "")
1111
endif()
1212

13+
# FIXME: Make it possible to build *only* static libraries for the stdlib.
14+
set(SWIFT_STDLIB_LIBRARY_BUILD_TYPES SHARED)
15+
if(SWIFT_BUILD_STATIC_STDLIB)
16+
list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES STATIC)
17+
endif()
18+
1319
add_custom_target(swift-stdlib-all)
1420
foreach(SDK ${SWIFT_SDKS})
1521
add_custom_target("swift-stdlib-${SWIFT_SDK_${SDK}_LIB_SUBDIR}")

stdlib/internal/SwiftExperimental/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSwiftExperimental SHARED IS_STDLIB
1+
add_swift_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftExperimental.swift

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
99
Foundation)
1010
endif()
1111

12-
add_swift_library(swiftStdlibCollectionUnittest SHARED IS_STDLIB
12+
add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1313
# This file should be listed the first. Module name is inferred from the
1414
# filename.
1515
StdlibCollectionUnittest.swift

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
2222
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all")
2323
endif()
2424

25-
add_swift_library(swiftStdlibUnittest SHARED IS_STDLIB
25+
add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
2626
# This file should be listed the first. Module name is inferred from the
2727
# filename.
2828
StdlibUnittest.swift.gyb

stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftStdlibUnittestFoundationExtras SHARED IS_STDLIB
1+
add_swift_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
StdlibUnittestFoundationExtras.swift

stdlib/private/SwiftPrivate/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSwiftPrivate SHARED IS_STDLIB
1+
add_swift_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftPrivate.swift

stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ elseif(SWIFT_HOST_VARIANT STREQUAL "linux" OR SWIFT_HOST_VARIANT STREQUAL "freeb
99
Glibc)
1010
endif()
1111

12-
add_swift_library(swiftSwiftPrivateLibcExtras SHARED IS_STDLIB
12+
add_swift_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1313
# This file should be listed the first. Module name is inferred from the
1414
# filename.
1515
SwiftPrivateLibcExtras.swift

stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ elseif(SWIFT_HOST_VARIANT STREQUAL "linux" OR SWIFT_HOST_VARIANT STREQUAL "freeb
88
Glibc)
99
endif()
1010

11-
add_swift_library(swiftSwiftPrivatePthreadExtras SHARED IS_STDLIB
11+
add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1212
# This file should be listed the first. Module name is inferred from the
1313
# filename.
1414
SwiftPrivatePthreadExtras.swift

stdlib/private/SwiftReflectionTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftSwiftReflectionTest SHARED IS_STDLIB
1+
add_swift_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
SwiftReflectionTest.swift
33
SWIFT_MODULE_DEPENDS Darwin
44
INSTALL_IN_COMPONENT stdlib-experimental)

stdlib/public/Platform/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ else()
2424
DEPENDS glibc_modulemap)
2525
endif()
2626

27-
add_swift_library(${swift_platform_name} IS_SDK_OVERLAY
27+
add_swift_library(${swift_platform_name} ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
2828
${swift_platform_sources}
2929
${swift_platform_flags})
3030

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 FORCE_BUILD_FOR_HOST_SDK
1+
add_swift_library(swiftReflection STATIC TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK
22
Demangle.cpp
33
MetadataSource.cpp
44
Remangle.cpp

stdlib/public/SDK/AVFoundation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftAVFoundation IS_SDK_OVERLAY
1+
add_swift_library(swiftAVFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
22
AVFoundation.swift
33
TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR
44
SWIFT_MODULE_DEPENDS Foundation CoreMedia

stdlib/public/SDK/AppKit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftAppKit IS_SDK_OVERLAY
1+
add_swift_library(swiftAppKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
22
AppKit.swift
33
AppKit_FoundationExtensions.swift
44
NSError.swift

stdlib/public/SDK/AssetsLibrary/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftAssetsLibrary IS_SDK_OVERLAY
1+
add_swift_library(swiftAssetsLibrary ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
22
AssetsLibrary.swift
33
TARGET_SDKS IOS IOS_SIMULATOR
44
SWIFT_MODULE_DEPENDS ObjectiveC Foundation CoreGraphics

stdlib/public/SDK/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# All libraries in this directory tree are overlays that depend on Darwin SDK.
22

3+
# FIXME: Make it possible to build *only* static libraries for the SDK overlays.
4+
set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES SHARED)
5+
if(SWIFT_BUILD_STATIC_STDLIB)
6+
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
7+
endif()
8+
39
# Please keep this list sorted.
410
add_subdirectory(AppKit)
511
add_subdirectory(AVFoundation)

0 commit comments

Comments
 (0)