diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index 084452a2e8012..d93fc695b73d5 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -361,6 +361,7 @@ endfunction() # target # name # [SHARED] +# [STATIC] # [SDK sdk] # [ARCHITECTURE architecture] # [DEPENDS dep1 ...] @@ -390,6 +391,9 @@ endfunction() # SHARED # Build a shared library. # +# STATIC +# Build a static library. +# # SDK sdk # SDK to build for. # @@ -448,7 +452,7 @@ endfunction() # Sources to add into this library function(_add_swift_library_single target name) set(SWIFTLIB_SINGLE_options - SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY + SHARED STATIC OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE) cmake_parse_arguments(SWIFTLIB_SINGLE @@ -473,6 +477,13 @@ function(_add_swift_library_single target name) if("${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}" STREQUAL "") message(FATAL_ERROR "INSTALL_IN_COMPONENT is required") endif() + + if(NOT SWIFTLIB_SINGLE_SHARED AND + NOT SWIFTLIB_SINGLE_STATIC AND + NOT SWIFTLIB_SINGLE_OBJECT_LIBRARY) + message(FATAL_ERROR + "Either SHARED, STATIC, or OBJECT_LIBRARY must be specified") + endif() # Determine the subdirectory where this library will be installed. set(SWIFTLIB_SINGLE_SUBDIR @@ -681,7 +692,7 @@ function(_add_swift_library_single target name) # Do these LAST. set(target_static) - if(SWIFTLIB_SINGLE_IS_STDLIB AND SWIFT_BUILD_STATIC_STDLIB) + if(SWIFTLIB_SINGLE_IS_STDLIB AND SWIFTLIB_SINGLE_STATIC) set(target_static "${target}-static") # We have already compiled Swift sources. Link everything into a static @@ -920,6 +931,7 @@ endfunction() # Usage: # add_swift_library(name # [SHARED] +# [STATIC] # [DEPENDS dep1 ...] # [LINK_LIBRARIES dep1 ...] # [INTERFACE_LINK_LIBRARIES dep1 ...] @@ -949,6 +961,9 @@ endfunction() # SHARED # Build a shared library. # +# STATIC +# Build a static library. +# # DEPENDS # Targets that this library depends on. # @@ -1028,7 +1043,7 @@ endfunction() # Sources to add into this library. function(add_swift_library name) set(SWIFTLIB_options - SHARED OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY + SHARED STATIC OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE HAS_SWIFT_CONTENT) cmake_parse_arguments(SWIFTLIB @@ -1042,7 +1057,6 @@ function(add_swift_library name) if(SWIFTLIB_IS_SDK_OVERLAY) set(SWIFTLIB_HAS_SWIFT_CONTENT TRUE) - set(SWIFTLIB_SHARED TRUE) set(SWIFTLIB_IS_STDLIB TRUE) set(SWIFTLIB_TARGET_LIBRARY TRUE) @@ -1104,6 +1118,13 @@ function(add_swift_library name) if("${SWIFTLIB_INSTALL_IN_COMPONENT}" STREQUAL "") message(FATAL_ERROR "INSTALL_IN_COMPONENT is required") endif() + + if(NOT SWIFTLIB_SHARED AND + NOT SWIFTLIB_STATIC AND + NOT SWIFTLIB_OBJECT_LIBRARY) + message(FATAL_ERROR + "Either SHARED, STATIC, or OBJECT_LIBRARY must be specified") + endif() if(SWIFTLIB_TARGET_LIBRARY) # If we are building this library for targets, loop through the various @@ -1196,6 +1217,7 @@ function(add_swift_library name) ${VARIANT_NAME} ${name} ${SWIFTLIB_SHARED_keyword} + ${SWIFTLIB_STATIC_keyword} ${SWIFTLIB_OBJECT_LIBRARY_keyword} ${SWIFTLIB_SOURCES} SDK ${sdk} @@ -1231,7 +1253,7 @@ function(add_swift_library name) endif() endforeach() - if (SWIFT_BUILD_STATIC_STDLIB AND SWIFTLIB_IS_STDLIB) + if (SWIFTLIB_IS_STDLIB AND SWIFTLIB_STATIC) # Add dependencies on the (not-yet-created) custom lipo target. foreach(DEP ${SWIFTLIB_LINK_LIBRARIES}) if (NOT "${DEP}" STREQUAL "icucore") @@ -1300,7 +1322,7 @@ function(add_swift_library name) # If we built static variants of the library, create a lipo target for # them. set(lipo_target_static) - if (SWIFT_BUILD_STATIC_STDLIB AND SWIFTLIB_IS_STDLIB) + if (SWIFTLIB_IS_STDLIB AND SWIFTLIB_STATIC) set(THIN_INPUT_TARGETS_STATIC) foreach(TARGET ${THIN_INPUT_TARGETS}) list(APPEND THIN_INPUT_TARGETS_STATIC "${TARGET}-static") @@ -1366,6 +1388,8 @@ function(add_swift_library name) ${name} ${name} ${SWIFTLIB_SHARED_keyword} + ${SWIFTLIB_STATIC_keyword} + ${SWIFTLIB_OBJECT_LIBRARY_keyword} ${SWIFTLIB_SOURCES} SDK ${sdk} ARCHITECTURE ${arch} diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt index b902739cb8c6f..bb32dd7204c34 100644 --- a/lib/AST/CMakeLists.txt +++ b/lib/AST/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftAST +add_swift_library(swiftAST STATIC ArchetypeBuilder.cpp ASTContext.cpp ASTDumper.cpp diff --git a/lib/ASTSectionImporter/CMakeLists.txt b/lib/ASTSectionImporter/CMakeLists.txt index 9cd27253bd10f..cc179180b9e4b 100644 --- a/lib/ASTSectionImporter/CMakeLists.txt +++ b/lib/ASTSectionImporter/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftASTSectionImporter +add_swift_library(swiftASTSectionImporter STATIC ASTSectionImporter.cpp LINK_LIBRARIES swiftBasic COMPONENT_DEPENDS core) diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt index df8e6afcfa070..9d528e39f9900 100644 --- a/lib/Basic/CMakeLists.txt +++ b/lib/Basic/CMakeLists.txt @@ -58,7 +58,7 @@ generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}") set(version_inc_files ${llvm_revision_inc} ${clang_revision_inc} ${swift_revision_inc}) -add_swift_library(swiftBasic +add_swift_library(swiftBasic STATIC Cache.cpp ClusteredBitVector.cpp Demangle.cpp diff --git a/lib/ClangImporter/CMakeLists.txt b/lib/ClangImporter/CMakeLists.txt index 12f8934b38a1c..c6cd40c76a482 100644 --- a/lib/ClangImporter/CMakeLists.txt +++ b/lib/ClangImporter/CMakeLists.txt @@ -8,7 +8,7 @@ handle_gyb_sources( generated_include_sources "") -add_swift_library(swiftClangImporter +add_swift_library(swiftClangImporter STATIC CFTypeInfo.cpp ClangDiagnosticConsumer.cpp ClangImporter.cpp diff --git a/lib/Driver/CMakeLists.txt b/lib/Driver/CMakeLists.txt index 2bc7e9b785986..7f9d1633f47bc 100644 --- a/lib/Driver/CMakeLists.txt +++ b/lib/Driver/CMakeLists.txt @@ -14,7 +14,7 @@ set(swiftDriver_sources set(swiftDriver_targetDefines) -add_swift_library(swiftDriver +add_swift_library(swiftDriver STATIC ${swiftDriver_sources} DEPENDS SwiftOptions LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption) diff --git a/lib/Frontend/CMakeLists.txt b/lib/Frontend/CMakeLists.txt index 34fa479149785..9db8f2c643d23 100644 --- a/lib/Frontend/CMakeLists.txt +++ b/lib/Frontend/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftFrontend +add_swift_library(swiftFrontend STATIC CompilerInvocation.cpp DiagnosticVerifier.cpp Frontend.cpp diff --git a/lib/FrontendTool/CMakeLists.txt b/lib/FrontendTool/CMakeLists.txt index 74388b252c3c7..31156da03dc77 100644 --- a/lib/FrontendTool/CMakeLists.txt +++ b/lib/FrontendTool/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftFrontendTool +add_swift_library(swiftFrontendTool STATIC FrontendTool.cpp DEPENDS SwiftOptions LINK_LIBRARIES diff --git a/lib/IDE/CMakeLists.txt b/lib/IDE/CMakeLists.txt index 7ab4ba017da26..a42f074887e0c 100644 --- a/lib/IDE/CMakeLists.txt +++ b/lib/IDE/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftIDE +add_swift_library(swiftIDE STATIC CodeCompletion.cpp CodeCompletionCache.cpp CommentConversion.cpp diff --git a/lib/IRGen/CMakeLists.txt b/lib/IRGen/CMakeLists.txt index c867a49fd8fc6..2dca53a1efd54 100644 --- a/lib/IRGen/CMakeLists.txt +++ b/lib/IRGen/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftIRGen +add_swift_library(swiftIRGen STATIC DebugTypeInfo.cpp EnumPayload.cpp ExtraInhabitants.cpp diff --git a/lib/Immediate/CMakeLists.txt b/lib/Immediate/CMakeLists.txt index 41e18e3b112fd..698553b5fcf0c 100644 --- a/lib/Immediate/CMakeLists.txt +++ b/lib/Immediate/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftImmediate +add_swift_library(swiftImmediate STATIC Immediate.cpp REPL.cpp LINK_LIBRARIES diff --git a/lib/Index/CMakeLists.txt b/lib/Index/CMakeLists.txt index 354833aa34f39..d91c5a8398ac9 100644 --- a/lib/Index/CMakeLists.txt +++ b/lib/Index/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftIndex +add_swift_library(swiftIndex STATIC Index.cpp IndexDataConsumer.cpp IndexSymbol.cpp diff --git a/lib/LLVMPasses/CMakeLists.txt b/lib/LLVMPasses/CMakeLists.txt index 835c07adfc536..40b30be434b9a 100644 --- a/lib/LLVMPasses/CMakeLists.txt +++ b/lib/LLVMPasses/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftLLVMPasses +add_swift_library(swiftLLVMPasses STATIC LLVMSwiftAA.cpp LLVMSwiftRCIdentity.cpp LLVMARCOpts.cpp diff --git a/lib/Markup/CMakeLists.txt b/lib/Markup/CMakeLists.txt index efce3fd3682f1..06c5ebe2e67b3 100644 --- a/lib/Markup/CMakeLists.txt +++ b/lib/Markup/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftMarkup +add_swift_library(swiftMarkup STATIC AST.cpp LineList.cpp Markup.cpp diff --git a/lib/Option/CMakeLists.txt b/lib/Option/CMakeLists.txt index bf1ee773dbbfe..03e0f4b8f9493 100644 --- a/lib/Option/CMakeLists.txt +++ b/lib/Option/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftOption +add_swift_library(swiftOption STATIC Options.cpp SanitizerOptions.cpp DEPENDS SwiftOptions diff --git a/lib/Parse/CMakeLists.txt b/lib/Parse/CMakeLists.txt index 1841dd7c1b492..a659ad51a8f0f 100644 --- a/lib/Parse/CMakeLists.txt +++ b/lib/Parse/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftParse +add_swift_library(swiftParse STATIC Lexer.cpp ParseDecl.cpp ParseExpr.cpp diff --git a/lib/PrintAsObjC/CMakeLists.txt b/lib/PrintAsObjC/CMakeLists.txt index 6608bd2883308..33aae23129eb5 100644 --- a/lib/PrintAsObjC/CMakeLists.txt +++ b/lib/PrintAsObjC/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftPrintAsObjC +add_swift_library(swiftPrintAsObjC STATIC PrintAsObjC.cpp LINK_LIBRARIES diff --git a/lib/RemoteAST/CMakeLists.txt b/lib/RemoteAST/CMakeLists.txt index ef8f02039694c..970400d1af093 100644 --- a/lib/RemoteAST/CMakeLists.txt +++ b/lib/RemoteAST/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftRemoteAST +add_swift_library(swiftRemoteAST STATIC RemoteAST.cpp LINK_LIBRARIES swiftSema swiftIRGen) diff --git a/lib/SIL/CMakeLists.txt b/lib/SIL/CMakeLists.txt index e8b0127349948..89881e3010c1f 100644 --- a/lib/SIL/CMakeLists.txt +++ b/lib/SIL/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSIL +add_swift_library(swiftSIL STATIC AbstractionPattern.cpp Bridging.cpp Dominance.cpp diff --git a/lib/SILGen/CMakeLists.txt b/lib/SILGen/CMakeLists.txt index 279df76d224e0..b2fb44d6ac92d 100644 --- a/lib/SILGen/CMakeLists.txt +++ b/lib/SILGen/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSILGen +add_swift_library(swiftSILGen STATIC ArgumentSource.cpp Cleanup.cpp Condition.cpp diff --git a/lib/SILOptimizer/CMakeLists.txt b/lib/SILOptimizer/CMakeLists.txt index 0cbd42c3edfc0..c018cf6efe19c 100644 --- a/lib/SILOptimizer/CMakeLists.txt +++ b/lib/SILOptimizer/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(SILCombiner) add_subdirectory(Transforms) add_subdirectory(UtilityPasses) add_subdirectory(Utils) -add_swift_library(swiftSILOptimizer +add_swift_library(swiftSILOptimizer STATIC ${ARC_SOURCES} ${ANALYSIS_SOURCES} ${SILCOMBINER_SOURCES} diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt index fdb53bb499065..29b3b924dcdfb 100644 --- a/lib/Sema/CMakeLists.txt +++ b/lib/Sema/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSema +add_swift_library(swiftSema STATIC CodeSynthesis.cpp Constraint.cpp ConstraintGraph.cpp diff --git a/lib/Serialization/CMakeLists.txt b/lib/Serialization/CMakeLists.txt index 42901a3443b3e..be7a2186aaa45 100644 --- a/lib/Serialization/CMakeLists.txt +++ b/lib/Serialization/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSerialization +add_swift_library(swiftSerialization STATIC Deserialization.cpp DeserializeSIL.cpp ModuleFile.cpp diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt index 50bff21ed6cf8..d46e8f369fe45 100644 --- a/stdlib/CMakeLists.txt +++ b/stdlib/CMakeLists.txt @@ -10,6 +10,12 @@ else() set(CMAKE_C_COMPILER_ARG1 "") endif() +# FIXME: Make it possible to build *only* static libraries for the stdlib. +set(SWIFT_STDLIB_LIBRARY_BUILD_TYPES SHARED) +if(SWIFT_BUILD_STATIC_STDLIB) + list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES STATIC) +endif() + add_custom_target(swift-stdlib-all) foreach(SDK ${SWIFT_SDKS}) add_custom_target("swift-stdlib-${SWIFT_SDK_${SDK}_LIB_SUBDIR}") diff --git a/stdlib/internal/SwiftExperimental/CMakeLists.txt b/stdlib/internal/SwiftExperimental/CMakeLists.txt index ed069b3b4eea2..6b2cd6ec438e7 100644 --- a/stdlib/internal/SwiftExperimental/CMakeLists.txt +++ b/stdlib/internal/SwiftExperimental/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSwiftExperimental SHARED IS_STDLIB +add_swift_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. SwiftExperimental.swift diff --git a/stdlib/private/StdlibCollectionUnittest/CMakeLists.txt b/stdlib/private/StdlibCollectionUnittest/CMakeLists.txt index 10c4a456a877c..572e045956af0 100644 --- a/stdlib/private/StdlibCollectionUnittest/CMakeLists.txt +++ b/stdlib/private/StdlibCollectionUnittest/CMakeLists.txt @@ -9,7 +9,7 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}") Foundation) endif() -add_swift_library(swiftStdlibCollectionUnittest SHARED IS_STDLIB +add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. StdlibCollectionUnittest.swift diff --git a/stdlib/private/StdlibUnittest/CMakeLists.txt b/stdlib/private/StdlibUnittest/CMakeLists.txt index 37c3f3c3b369b..d3a6032e26079 100644 --- a/stdlib/private/StdlibUnittest/CMakeLists.txt +++ b/stdlib/private/StdlibUnittest/CMakeLists.txt @@ -22,7 +22,7 @@ if(SWIFT_SERIALIZE_STDLIB_UNITTEST) list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all") endif() -add_swift_library(swiftStdlibUnittest SHARED IS_STDLIB +add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. StdlibUnittest.swift.gyb diff --git a/stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt b/stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt index 02635d630785d..746805e6091f5 100644 --- a/stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt +++ b/stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftStdlibUnittestFoundationExtras SHARED IS_STDLIB +add_swift_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. StdlibUnittestFoundationExtras.swift diff --git a/stdlib/private/SwiftPrivate/CMakeLists.txt b/stdlib/private/SwiftPrivate/CMakeLists.txt index 8a529ca227da4..4719e74c12a4d 100644 --- a/stdlib/private/SwiftPrivate/CMakeLists.txt +++ b/stdlib/private/SwiftPrivate/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSwiftPrivate SHARED IS_STDLIB +add_swift_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. SwiftPrivate.swift diff --git a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt index 476ef57a7c7f0..b7b0c03570a42 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt @@ -9,7 +9,7 @@ elseif(SWIFT_HOST_VARIANT STREQUAL "linux" OR SWIFT_HOST_VARIANT STREQUAL "freeb Glibc) endif() -add_swift_library(swiftSwiftPrivateLibcExtras SHARED IS_STDLIB +add_swift_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. SwiftPrivateLibcExtras.swift diff --git a/stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt b/stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt index ee6edcef5f8d2..bada755f4d518 100644 --- a/stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt @@ -8,7 +8,7 @@ elseif(SWIFT_HOST_VARIANT STREQUAL "linux" OR SWIFT_HOST_VARIANT STREQUAL "freeb Glibc) endif() -add_swift_library(swiftSwiftPrivatePthreadExtras SHARED IS_STDLIB +add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. SwiftPrivatePthreadExtras.swift diff --git a/stdlib/private/SwiftReflectionTest/CMakeLists.txt b/stdlib/private/SwiftReflectionTest/CMakeLists.txt index 920de1ad744bf..e03f724c9830b 100644 --- a/stdlib/private/SwiftReflectionTest/CMakeLists.txt +++ b/stdlib/private/SwiftReflectionTest/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSwiftReflectionTest SHARED IS_STDLIB +add_swift_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB SwiftReflectionTest.swift SWIFT_MODULE_DEPENDS Darwin INSTALL_IN_COMPONENT stdlib-experimental) diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index c71b897220060..1878a2fb8134a 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -24,7 +24,7 @@ else() DEPENDS glibc_modulemap) endif() -add_swift_library(${swift_platform_name} IS_SDK_OVERLAY +add_swift_library(${swift_platform_name} ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY ${swift_platform_sources} ${swift_platform_flags}) diff --git a/stdlib/public/Reflection/CMakeLists.txt b/stdlib/public/Reflection/CMakeLists.txt index 8dc5d9674c013..aadce0e79196e 100644 --- a/stdlib/public/Reflection/CMakeLists.txt +++ b/stdlib/public/Reflection/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftReflection TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK +add_swift_library(swiftReflection STATIC TARGET_LIBRARY FORCE_BUILD_FOR_HOST_SDK Demangle.cpp MetadataSource.cpp Remangle.cpp diff --git a/stdlib/public/SDK/AVFoundation/CMakeLists.txt b/stdlib/public/SDK/AVFoundation/CMakeLists.txt index f0088528c96e5..1112c1c16a647 100644 --- a/stdlib/public/SDK/AVFoundation/CMakeLists.txt +++ b/stdlib/public/SDK/AVFoundation/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftAVFoundation IS_SDK_OVERLAY +add_swift_library(swiftAVFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY AVFoundation.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation CoreMedia diff --git a/stdlib/public/SDK/AppKit/CMakeLists.txt b/stdlib/public/SDK/AppKit/CMakeLists.txt index 60326169f4dea..e2e63d19b248c 100644 --- a/stdlib/public/SDK/AppKit/CMakeLists.txt +++ b/stdlib/public/SDK/AppKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftAppKit IS_SDK_OVERLAY +add_swift_library(swiftAppKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY AppKit.swift AppKit_FoundationExtensions.swift NSError.swift diff --git a/stdlib/public/SDK/AssetsLibrary/CMakeLists.txt b/stdlib/public/SDK/AssetsLibrary/CMakeLists.txt index 91e7cd713324e..82325ef993c28 100644 --- a/stdlib/public/SDK/AssetsLibrary/CMakeLists.txt +++ b/stdlib/public/SDK/AssetsLibrary/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftAssetsLibrary IS_SDK_OVERLAY +add_swift_library(swiftAssetsLibrary ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY AssetsLibrary.swift TARGET_SDKS IOS IOS_SIMULATOR SWIFT_MODULE_DEPENDS ObjectiveC Foundation CoreGraphics diff --git a/stdlib/public/SDK/CMakeLists.txt b/stdlib/public/SDK/CMakeLists.txt index 83e9fc2d1dee6..29842cd6b2c54 100644 --- a/stdlib/public/SDK/CMakeLists.txt +++ b/stdlib/public/SDK/CMakeLists.txt @@ -1,5 +1,11 @@ # All libraries in this directory tree are overlays that depend on Darwin SDK. +# FIXME: Make it possible to build *only* static libraries for the SDK overlays. +set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES SHARED) +if(SWIFT_BUILD_STATIC_STDLIB) + list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC) +endif() + # Please keep this list sorted. add_subdirectory(AppKit) add_subdirectory(AVFoundation) diff --git a/stdlib/public/SDK/CloudKit/CMakeLists.txt b/stdlib/public/SDK/CloudKit/CMakeLists.txt index c8bcea4714bc8..8dfad66555c53 100644 --- a/stdlib/public/SDK/CloudKit/CMakeLists.txt +++ b/stdlib/public/SDK/CloudKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCloudKit IS_SDK_OVERLAY +add_swift_library(swiftCloudKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CloudKit.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation CoreLocation diff --git a/stdlib/public/SDK/Contacts/CMakeLists.txt b/stdlib/public/SDK/Contacts/CMakeLists.txt index 27378bc1acd5c..789af57a4f612 100644 --- a/stdlib/public/SDK/Contacts/CMakeLists.txt +++ b/stdlib/public/SDK/Contacts/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftContacts IS_SDK_OVERLAY +add_swift_library(swiftContacts ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY Contacts.swift TARGET_SDKS OSX IOS IOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/CoreAudio/CMakeLists.txt b/stdlib/public/SDK/CoreAudio/CMakeLists.txt index 444b38bc07fdb..ff155a9866a53 100644 --- a/stdlib/public/SDK/CoreAudio/CMakeLists.txt +++ b/stdlib/public/SDK/CoreAudio/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreAudio IS_SDK_OVERLAY +add_swift_library(swiftCoreAudio ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreAudio.swift ../../../public/core/WriteBackMutableSlice.swift diff --git a/stdlib/public/SDK/CoreBluetooth/CMakeLists.txt b/stdlib/public/SDK/CoreBluetooth/CMakeLists.txt index b8de0896c6af6..f71a88fb67d92 100644 --- a/stdlib/public/SDK/CoreBluetooth/CMakeLists.txt +++ b/stdlib/public/SDK/CoreBluetooth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreBluetooth IS_SDK_OVERLAY +add_swift_library(swiftCoreBluetooth ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreBluetooth.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/CoreData/CMakeLists.txt b/stdlib/public/SDK/CoreData/CMakeLists.txt index 98b1bc6bd2ff0..86254552d9433 100644 --- a/stdlib/public/SDK/CoreData/CMakeLists.txt +++ b/stdlib/public/SDK/CoreData/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreData IS_SDK_OVERLAY +add_swift_library(swiftCoreData ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreData.swift SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/CoreGraphics/CMakeLists.txt b/stdlib/public/SDK/CoreGraphics/CMakeLists.txt index 96bf676c98352..fd1c5962529a0 100644 --- a/stdlib/public/SDK/CoreGraphics/CMakeLists.txt +++ b/stdlib/public/SDK/CoreGraphics/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreGraphics IS_SDK_OVERLAY +add_swift_library(swiftCoreGraphics ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreGraphics.swift CGFloat.swift.gyb # rdar://problem/20891746 diff --git a/stdlib/public/SDK/CoreImage/CMakeLists.txt b/stdlib/public/SDK/CoreImage/CMakeLists.txt index d609f8c7c37a9..e9262e9a4b298 100644 --- a/stdlib/public/SDK/CoreImage/CMakeLists.txt +++ b/stdlib/public/SDK/CoreImage/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreImage IS_SDK_OVERLAY +add_swift_library(swiftCoreImage ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreImage.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR diff --git a/stdlib/public/SDK/CoreLocation/CMakeLists.txt b/stdlib/public/SDK/CoreLocation/CMakeLists.txt index 9ffb04d5948c9..c9996ba53515e 100644 --- a/stdlib/public/SDK/CoreLocation/CMakeLists.txt +++ b/stdlib/public/SDK/CoreLocation/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreLocation IS_SDK_OVERLAY +add_swift_library(swiftCoreLocation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreLocation.swift SWIFT_MODULE_DEPENDS Foundation FRAMEWORK_DEPENDS CoreLocation) diff --git a/stdlib/public/SDK/CoreMedia/CMakeLists.txt b/stdlib/public/SDK/CoreMedia/CMakeLists.txt index 33d79b825f132..0f177be21b6fb 100644 --- a/stdlib/public/SDK/CoreMedia/CMakeLists.txt +++ b/stdlib/public/SDK/CoreMedia/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftCoreMedia IS_SDK_OVERLAY +add_swift_library(swiftCoreMedia ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY CoreMedia.swift CMTime.swift CMTimeRange.swift diff --git a/stdlib/public/SDK/Dispatch/CMakeLists.txt b/stdlib/public/SDK/Dispatch/CMakeLists.txt index 614b5d10c1bdc..3328bea761007 100644 --- a/stdlib/public/SDK/Dispatch/CMakeLists.txt +++ b/stdlib/public/SDK/Dispatch/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftDispatch IS_SDK_OVERLAY +add_swift_library(swiftDispatch ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY Dispatch.swift Dispatch.mm Block.swift diff --git a/stdlib/public/SDK/EventKit/CMakeLists.txt b/stdlib/public/SDK/EventKit/CMakeLists.txt index 2fef66848ec8f..b63b025d7792d 100644 --- a/stdlib/public/SDK/EventKit/CMakeLists.txt +++ b/stdlib/public/SDK/EventKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftEventKit IS_SDK_OVERLAY +add_swift_library(swiftEventKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY EventKit.swift TARGET_SDKS OSX IOS IOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR diff --git a/stdlib/public/SDK/Foundation/CMakeLists.txt b/stdlib/public/SDK/Foundation/CMakeLists.txt index d3e9bf914fd33..f3a33f3767e02 100644 --- a/stdlib/public/SDK/Foundation/CMakeLists.txt +++ b/stdlib/public/SDK/Foundation/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftFoundation IS_SDK_OVERLAY +add_swift_library(swiftFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY Foundation.swift Boxing.swift NSError.swift diff --git a/stdlib/public/SDK/GLKit/CMakeLists.txt b/stdlib/public/SDK/GLKit/CMakeLists.txt index 3397e603dbeab..7858bdd5f9200 100644 --- a/stdlib/public/SDK/GLKit/CMakeLists.txt +++ b/stdlib/public/SDK/GLKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftGLKit IS_SDK_OVERLAY +add_swift_library(swiftGLKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY GLKit.swift.gyb TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR diff --git a/stdlib/public/SDK/GameKit/CMakeLists.txt b/stdlib/public/SDK/GameKit/CMakeLists.txt index 0c8856d882c75..84abe09c6482f 100644 --- a/stdlib/public/SDK/GameKit/CMakeLists.txt +++ b/stdlib/public/SDK/GameKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftGameKit IS_SDK_OVERLAY +add_swift_library(swiftGameKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY GameKit.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS SWIFT_MODULE_DEPENDS Foundation SpriteKit SceneKit simd diff --git a/stdlib/public/SDK/GameplayKit/CMakeLists.txt b/stdlib/public/SDK/GameplayKit/CMakeLists.txt index fcd6c33479e1e..0ad40784f8912 100644 --- a/stdlib/public/SDK/GameplayKit/CMakeLists.txt +++ b/stdlib/public/SDK/GameplayKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftGameplayKit IS_SDK_OVERLAY +add_swift_library(swiftGameplayKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY GameplayKit.swift GameplayKit.mm diff --git a/stdlib/public/SDK/HomeKit/CMakeLists.txt b/stdlib/public/SDK/HomeKit/CMakeLists.txt index e2389489aaa48..930fdc492b22a 100644 --- a/stdlib/public/SDK/HomeKit/CMakeLists.txt +++ b/stdlib/public/SDK/HomeKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftHomeKit IS_SDK_OVERLAY +add_swift_library(swiftHomeKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY HomeKit.swift TARGET_SDKS IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/IOKit/CMakeLists.txt b/stdlib/public/SDK/IOKit/CMakeLists.txt index e7de40f1111e8..2b7cc5db27374 100644 --- a/stdlib/public/SDK/IOKit/CMakeLists.txt +++ b/stdlib/public/SDK/IOKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftIOKit IS_SDK_OVERLAY +add_swift_library(swiftIOKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY IOKit.swift TARGET_SDKS OSX SWIFT_MODULE_DEPENDS ObjectiveC Dispatch diff --git a/stdlib/public/SDK/Intents/CMakeLists.txt b/stdlib/public/SDK/Intents/CMakeLists.txt index dad4f7dc4a77f..b3f1d7afa348b 100644 --- a/stdlib/public/SDK/Intents/CMakeLists.txt +++ b/stdlib/public/SDK/Intents/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftIntents IS_SDK_OVERLAY +add_swift_library(swiftIntents ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY Intents.swift INBooleanResolutionResult.swift INDoubleResolutionResult.swift diff --git a/stdlib/public/SDK/LocalAuthentication/CMakeLists.txt b/stdlib/public/SDK/LocalAuthentication/CMakeLists.txt index cedcbdf04b68b..9adfe2fd58b99 100644 --- a/stdlib/public/SDK/LocalAuthentication/CMakeLists.txt +++ b/stdlib/public/SDK/LocalAuthentication/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftLocalAuthentication IS_SDK_OVERLAY +add_swift_library(swiftLocalAuthentication ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY LocalAuthentication.swift TARGET_SDKS OSX IOS IOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/MultipeerConnectivity/CMakeLists.txt b/stdlib/public/SDK/MultipeerConnectivity/CMakeLists.txt index 1e2336c717f3c..1dc6938e77368 100644 --- a/stdlib/public/SDK/MultipeerConnectivity/CMakeLists.txt +++ b/stdlib/public/SDK/MultipeerConnectivity/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftMultipeerConnectivity IS_SDK_OVERLAY +add_swift_library(swiftMultipeerConnectivity ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY MultipeerConnectivity.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR diff --git a/stdlib/public/SDK/ObjectiveC/CMakeLists.txt b/stdlib/public/SDK/ObjectiveC/CMakeLists.txt index 67595285029a1..69797246ef92c 100644 --- a/stdlib/public/SDK/ObjectiveC/CMakeLists.txt +++ b/stdlib/public/SDK/ObjectiveC/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftObjectiveC IS_SDK_OVERLAY +add_swift_library(swiftObjectiveC ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY ObjectiveC.mm ObjectiveC.swift SWIFT_MODULE_DEPENDS Darwin) diff --git a/stdlib/public/SDK/OpenCL/CMakeLists.txt b/stdlib/public/SDK/OpenCL/CMakeLists.txt index ac6c1afa5ea59..4637a0a3065c1 100644 --- a/stdlib/public/SDK/OpenCL/CMakeLists.txt +++ b/stdlib/public/SDK/OpenCL/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftOpenCL IS_SDK_OVERLAY +add_swift_library(swiftOpenCL ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY OpenCL.swift TARGET_SDKS OSX SWIFT_MODULE_DEPENDS Dispatch Darwin # also, IOSurface diff --git a/stdlib/public/SDK/PassKit/CMakeLists.txt b/stdlib/public/SDK/PassKit/CMakeLists.txt index c1449b0ea03f2..ad4879be287d1 100644 --- a/stdlib/public/SDK/PassKit/CMakeLists.txt +++ b/stdlib/public/SDK/PassKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftPassKit IS_SDK_OVERLAY +add_swift_library(swiftPassKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY PassKit.swift TARGET_SDKS IOS IOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation UIKit Contacts diff --git a/stdlib/public/SDK/SafariServices/CMakeLists.txt b/stdlib/public/SDK/SafariServices/CMakeLists.txt index cee21bacdccae..d981c778f38df 100644 --- a/stdlib/public/SDK/SafariServices/CMakeLists.txt +++ b/stdlib/public/SDK/SafariServices/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSafariServices IS_SDK_OVERLAY +add_swift_library(swiftSafariServices ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY SafariServices.mm SafariServices.swift diff --git a/stdlib/public/SDK/SceneKit/CMakeLists.txt b/stdlib/public/SDK/SceneKit/CMakeLists.txt index 14cc12720c84d..ce67092a00a75 100644 --- a/stdlib/public/SDK/SceneKit/CMakeLists.txt +++ b/stdlib/public/SDK/SceneKit/CMakeLists.txt @@ -4,7 +4,7 @@ SET(SWIFT_SCENEKIT_DEPENDENCIES_NON_WATCHOS simd CoreImage) -add_swift_library(swiftSceneKit IS_SDK_OVERLAY +add_swift_library(swiftSceneKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY SceneKit.swift Thunks.mm diff --git a/stdlib/public/SDK/SpriteKit/CMakeLists.txt b/stdlib/public/SDK/SpriteKit/CMakeLists.txt index acfd5a082109f..dc8e7b5639eb3 100644 --- a/stdlib/public/SDK/SpriteKit/CMakeLists.txt +++ b/stdlib/public/SDK/SpriteKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSpriteKit IS_SDK_OVERLAY +add_swift_library(swiftSpriteKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY SpriteKit.swift SpriteKitQuickLooks.swift.gyb diff --git a/stdlib/public/SDK/UIKit/CMakeLists.txt b/stdlib/public/SDK/UIKit/CMakeLists.txt index c118528e4428b..360efa1a908db 100644 --- a/stdlib/public/SDK/UIKit/CMakeLists.txt +++ b/stdlib/public/SDK/UIKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftUIKit IS_SDK_OVERLAY +add_swift_library(swiftUIKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY DesignatedInitializers.mm UIKit.swift UIKit_FoundationExtensions.swift diff --git a/stdlib/public/SDK/WatchConnectivity/CMakeLists.txt b/stdlib/public/SDK/WatchConnectivity/CMakeLists.txt index 5e3e903a2b64a..61710a3ebc50c 100644 --- a/stdlib/public/SDK/WatchConnectivity/CMakeLists.txt +++ b/stdlib/public/SDK/WatchConnectivity/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftWatchConnectivity IS_SDK_OVERLAY +add_swift_library(swiftWatchConnectivity ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY WatchConnectivity.swift TARGET_SDKS IOS IOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/WatchKit/CMakeLists.txt b/stdlib/public/SDK/WatchKit/CMakeLists.txt index c64e220133b1f..7e597e53bb6f8 100644 --- a/stdlib/public/SDK/WatchKit/CMakeLists.txt +++ b/stdlib/public/SDK/WatchKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftWatchKit IS_SDK_OVERLAY +add_swift_library(swiftWatchKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY WatchKit.swift TARGET_SDKS IOS IOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation UIKit CoreGraphics CoreLocation SceneKit diff --git a/stdlib/public/SDK/WebKit/CMakeLists.txt b/stdlib/public/SDK/WebKit/CMakeLists.txt index 77d7d6562ffb8..3f6b2f34b596e 100644 --- a/stdlib/public/SDK/WebKit/CMakeLists.txt +++ b/stdlib/public/SDK/WebKit/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftWebKit IS_SDK_OVERLAY +add_swift_library(swiftWebKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY WebKit.swift TARGET_SDKS OSX IOS IOS_SIMULATOR SWIFT_MODULE_DEPENDS Foundation diff --git a/stdlib/public/SDK/XCTest/CMakeLists.txt b/stdlib/public/SDK/XCTest/CMakeLists.txt index b642c7439bf62..5862301164750 100644 --- a/stdlib/public/SDK/XCTest/CMakeLists.txt +++ b/stdlib/public/SDK/XCTest/CMakeLists.txt @@ -1,6 +1,6 @@ set(DISABLE_APPLICATION_EXTENSION ON) -add_swift_library(swiftXCTest IS_SDK_OVERLAY +add_swift_library(swiftXCTest ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY XCTestCaseAdditions.mm XCTest.swift TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR diff --git a/stdlib/public/SDK/XPC/CMakeLists.txt b/stdlib/public/SDK/XPC/CMakeLists.txt index 311af23b1269e..94a7470b1eb3c 100644 --- a/stdlib/public/SDK/XPC/CMakeLists.txt +++ b/stdlib/public/SDK/XPC/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftXPC IS_SDK_OVERLAY +add_swift_library(swiftXPC ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY XPC.swift XPC.mm TARGET_SDKS OSX diff --git a/stdlib/public/SDK/simd/CMakeLists.txt b/stdlib/public/SDK/simd/CMakeLists.txt index b210337a6b621..c8bcfbb5a0730 100644 --- a/stdlib/public/SDK/simd/CMakeLists.txt +++ b/stdlib/public/SDK/simd/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftsimd IS_SDK_OVERLAY +add_swift_library(swiftsimd ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY simd.swift.gyb SWIFT_COMPILE_FLAGS ${STDLIB_SIL_SERIALIZE_ALL} -parse-stdlib diff --git a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt index af20804866339..220aa021eb494 100644 --- a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt +++ b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_library(swiftSwiftOnoneSupport SHARED IS_STDLIB +add_swift_library(swiftSwiftOnoneSupport ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. SwiftOnoneSupport.swift diff --git a/stdlib/public/SwiftRemoteMirror/CMakeLists.txt b/stdlib/public/SwiftRemoteMirror/CMakeLists.txt index 500f8bda5547e..dbd45d8fe3aa6 100644 --- a/stdlib/public/SwiftRemoteMirror/CMakeLists.txt +++ b/stdlib/public/SwiftRemoteMirror/CMakeLists.txt @@ -1,5 +1,6 @@ +# libswiftRemoteMirror.dylib should not have runtime dependencies; it's +# always built as a shared library. add_swift_library(swiftRemoteMirror SHARED TARGET_LIBRARY DONT_EMBED_BITCODE - SwiftRemoteMirror.cpp - LINK_LIBRARIES swiftReflection - INSTALL_IN_COMPONENT stdlib) - + SwiftRemoteMirror.cpp + LINK_LIBRARIES swiftReflection + INSTALL_IN_COMPONENT stdlib) diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index 043310f4d553b..011839201a7de 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -184,12 +184,12 @@ if(SWIFT_STDLIB_SIL_DEBUGGING) endif() if(SWIFT_CHECK_ESSENTIAL_STDLIB) - add_swift_library(swift_stdlib_essential SHARED IS_STDLIB IS_STDLIB_CORE + add_swift_library(swift_stdlib_essential ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE ${SWIFTLIB_ESSENTIAL}) target_link_libraries(swift_stdlib_essential ${RUNTIME_DEPENDENCY}) endif() -add_swift_library(swiftCore SHARED IS_STDLIB IS_STDLIB_CORE +add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE ${SWIFTLIB_SOURCES} # The copy_shim_headers target dependency is required to let the # build system know that there's a rule to produce the shims diff --git a/stdlib/public/runtime/CMakeLists.txt b/stdlib/public/runtime/CMakeLists.txt index 64ac6c0b5b875..818ae38d0bd89 100644 --- a/stdlib/public/runtime/CMakeLists.txt +++ b/stdlib/public/runtime/CMakeLists.txt @@ -83,11 +83,11 @@ add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY INSTALL_IN_COMPONENT never_install) if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - add_swift_library(section_magic_begin IS_STDLIB IS_STDLIB_CORE + add_swift_library(section_magic_begin STATIC IS_STDLIB IS_STDLIB_CORE swift_sections.S C_COMPILE_FLAGS ${swift_runtime_compile_flags} "-DSWIFT_BEGIN" INSTALL_IN_COMPONENT never_install) - add_swift_library(section_magic_end IS_STDLIB IS_STDLIB_CORE + add_swift_library(section_magic_end STATIC IS_STDLIB IS_STDLIB_CORE swift_sections.S C_COMPILE_FLAGS ${swift_runtime_compile_flags} "-DSWIFT_END" INSTALL_IN_COMPONENT never_install)