Skip to content

Commit 1e87373

Browse files
authored
Merge pull request #9999 from owenv/owenv/missingexecs
Add CMake build support for missing Windows executables
2 parents a148585 + e1910f8 commit 1e87373

7 files changed

Lines changed: 66 additions & 4 deletions

File tree

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ let package = Package(
705705
.executableTarget(
706706
/** Interacts with package collections */
707707
name: "swift-package-collection",
708-
dependencies: ["Commands", "PackageCollectionsCommand"]
708+
dependencies: ["PackageCollectionsCommand"]
709709
),
710710
.executableTarget(
711711
/** Multi-command entry point for SwiftPM. */
@@ -722,7 +722,7 @@ let package = Package(
722722
.executableTarget(
723723
/** Interact with package registry */
724724
name: "swift-package-registry",
725-
dependencies: ["Commands", "PackageRegistryCommand"]
725+
dependencies: ["PackageRegistryCommand"]
726726
),
727727
.executableTarget(
728728
/** Utility to produce the artifacts for prebuilts */

Sources/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_subdirectory(CoreCommands)
1717
add_subdirectory(DriverSupport)
1818
add_subdirectory(LLBuildManifest)
1919
add_subdirectory(PackageCollections)
20+
add_subdirectory(PackageCollectionsCommand)
2021
add_subdirectory(PackageCollectionsModel)
2122
add_subdirectory(PackageCollectionsSigning)
2223
add_subdirectory(PackageFingerprint)
@@ -39,6 +40,8 @@ add_subdirectory(swift-build)
3940
add_subdirectory(swift-experimental-sdk)
4041
add_subdirectory(swift-sdk)
4142
add_subdirectory(swift-package)
43+
add_subdirectory(swift-package-collection)
44+
add_subdirectory(swift-package-registry)
4245
add_subdirectory(swift-run)
4346
add_subdirectory(swift-test)
4447
add_subdirectory(SwiftPMBuildServer)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2026 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_library(PackageCollectionsCommand
10+
PackageCollectionsCommand.swift)
11+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
12+
set_target_properties(PackageCollectionsCommand PROPERTIES
13+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
14+
target_link_libraries(PackageCollectionsCommand PUBLIC
15+
Basics
16+
Commands
17+
CoreCommands
18+
PackageCollections
19+
PackageModel
20+
ArgumentParser)
21+
22+
install(TARGETS PackageCollectionsCommand
23+
ARCHIVE DESTINATION lib
24+
LIBRARY DESTINATION lib
25+
RUNTIME DESTINATION bin)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2026 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_executable(swift-package-collection
10+
Entrypoint.swift)
11+
target_link_libraries(swift-package-collection PRIVATE
12+
PackageCollectionsCommand)
13+
14+
target_compile_options(swift-package-collection PRIVATE
15+
-parse-as-library)
16+
17+
install(TARGETS swift-package-collection
18+
RUNTIME DESTINATION bin)

Sources/swift-package-collection/Entrypoint.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Commands
1413
import PackageCollectionsCommand
1514

1615
@main
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2021 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_executable(swift-package-registry
10+
runner.swift)
11+
target_link_libraries(swift-package-registry PRIVATE
12+
PackageRegistryCommand)
13+
14+
target_compile_options(swift-package-registry PRIVATE
15+
-parse-as-library)
16+
17+
install(TARGETS swift-package-registry
18+
RUNTIME DESTINATION bin)

Sources/swift-package-registry/runner.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Commands
1413
import PackageRegistryCommand
1514

1615
@main

0 commit comments

Comments
 (0)