diff --git a/Package.swift b/Package.swift index 9c85ed07d0d..ec6965ded4b 100644 --- a/Package.swift +++ b/Package.swift @@ -489,6 +489,7 @@ let package = Package( name: "CoreCommands", dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), + .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"), "Basics", "Build", "PackageLoading", @@ -509,9 +510,11 @@ let package = Package( dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), .product(name: "OrderedCollections", package: "swift-collections"), + .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"), "Basics", "Build", "CoreCommands", + "LLBuildManifest", "PackageGraph", "PackageModelSyntax", "SourceControl", @@ -594,7 +597,7 @@ let package = Package( .executableTarget( /** The main executable provided by SwiftPM */ name: "swift-package", - dependencies: ["Basics", "Commands"], + dependencies: ["Commands"], exclude: ["CMakeLists.txt"] ), .executableTarget( diff --git a/Sources/CoreCommands/CMakeLists.txt b/Sources/CoreCommands/CMakeLists.txt index d7ec0cbb632..9a2b16aa134 100644 --- a/Sources/CoreCommands/CMakeLists.txt +++ b/Sources/CoreCommands/CMakeLists.txt @@ -6,7 +6,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for Swift project authors -add_library(CoreCommands +add_library(CoreCommands STATIC BuildSystemSupport.swift SwiftCommandState.swift SwiftCommandObservabilityHandler.swift @@ -16,6 +16,8 @@ target_link_libraries(CoreCommands PUBLIC Basics Build PackageGraph + PackageModel + PackageLoading TSCBasic TSCUtility Workspace @@ -26,8 +28,3 @@ target_link_libraries(CoreCommands PRIVATE # NOTE(compnerd) workaround for CMake not setting up include flags yet set_target_properties(CoreCommands PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) - -install(TARGETS CoreCommands - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) diff --git a/Sources/DriverSupport/CMakeLists.txt b/Sources/DriverSupport/CMakeLists.txt index 1044df0e906..a9930bcf0b0 100644 --- a/Sources/DriverSupport/CMakeLists.txt +++ b/Sources/DriverSupport/CMakeLists.txt @@ -6,7 +6,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for Swift project authors -add_library(DriverSupport +add_library(DriverSupport STATIC DriverSupportUtils.swift SPMSwiftDriverExecutor.swift) # NOTE(compnerd) workaround for CMake not setting up include flags yet @@ -16,9 +16,3 @@ target_link_libraries(DriverSupport PUBLIC Basics PackageModel SwiftDriver) - -install(TARGETS DriverSupport - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -set_property(GLOBAL APPEND PROPERTY SwiftPM_EXPORTS DriverSupport) diff --git a/Sources/PackageModelSyntax/CMakeLists.txt b/Sources/PackageModelSyntax/CMakeLists.txt index c034d8d1705..919e808d0f0 100644 --- a/Sources/PackageModelSyntax/CMakeLists.txt +++ b/Sources/PackageModelSyntax/CMakeLists.txt @@ -6,7 +6,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for Swift project authors -add_library(PackageModelSyntax +add_library(PackageModelSyntax STATIC AddPackageDependency.swift AddProduct.swift AddTarget.swift @@ -37,8 +37,4 @@ target_link_libraries(PackageModelSyntax PUBLIC set_target_properties(PackageModelSyntax PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) -install(TARGETS PackageModelSyntax - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) set_property(GLOBAL APPEND PROPERTY SwiftPM_EXPORTS PackageModelSyntax) diff --git a/Sources/SwiftSDKCommand/CMakeLists.txt b/Sources/SwiftSDKCommand/CMakeLists.txt index 4dcfa36a2af..fd63f7512d3 100644 --- a/Sources/SwiftSDKCommand/CMakeLists.txt +++ b/Sources/SwiftSDKCommand/CMakeLists.txt @@ -6,7 +6,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for Swift project authors -add_library(SwiftSDKCommand +add_library(SwiftSDKCommand STATIC Configuration/ConfigurationSubcommand.swift Configuration/DeprecatedSwiftSDKConfigurationCommand.swift Configuration/ResetConfiguration.swift @@ -27,8 +27,3 @@ target_link_libraries(SwiftSDKCommand PUBLIC # NOTE(compnerd) workaround for CMake not setting up include flags yet set_target_properties(SwiftSDKCommand PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) - -install(TARGETS SwiftSDKCommand - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) diff --git a/Sources/swift-package/CMakeLists.txt b/Sources/swift-package/CMakeLists.txt index 3468bdefcdc..3ff57252e80 100644 --- a/Sources/swift-package/CMakeLists.txt +++ b/Sources/swift-package/CMakeLists.txt @@ -9,8 +9,7 @@ add_executable(swift-package Entrypoint.swift) target_link_libraries(swift-package PRIVATE - Commands - TSCBasic) + Commands) target_compile_options(swift-package PRIVATE -parse-as-library)