Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ project(SwiftPM LANGUAGES C Swift)

option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)
option(FIND_PM_DEPS "Search for all external Package Manager dependencies" YES)
option(SwiftPM_ENABLE_RUNTIME "Build the runtime" YES)

set(CMAKE_Swift_LANGUAGE_VERSION 5)
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
Expand Down
84 changes: 44 additions & 40 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ let swiftPMProduct = (
"LLBuildManifest",
"SourceKitLSPAPI",
"SPMLLBuild",
"SwiftBuildSupport",
]
)

Expand Down Expand Up @@ -184,20 +185,6 @@ let package = Package(
),
],
targets: [
// The `PackageDescription` target provides the API that is available
// to `Package.swift` manifests. Here we build a debug version of the
// library; the bootstrap scripts build the deployable version.
.target(
name: "PackageDescription",
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.define("USE_IMPL_ONLY_IMPORTS"),
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"]),
],
linkerSettings: packageLibraryLinkSettings
),

// The `AppleProductTypes` target provides additional product types
// to `Package.swift` manifests. Here we build a debug version of the
// library; the bootstrap scripts build the deployable version.
Expand All @@ -213,19 +200,6 @@ let package = Package(
.unsafeFlags(["-Xfrontend", "-module-link-name", "-Xfrontend", "AppleProductTypes"])
]),

// The `PackagePlugin` target provides the API that is available to
// plugin scripts. Here we build a debug version of the library; the
// bootstrap scripts build the deployable version.
.target(
name: "PackagePlugin",
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"]),
],
linkerSettings: packageLibraryLinkSettings
),

.target(
name: "SourceKitLSPAPI",
dependencies: [
Expand Down Expand Up @@ -775,11 +749,41 @@ let package = Package(
]
),

// The `PackageDescription` target provides the API that is available
// to `Package.swift` manifests. Here we build a debug version of the
// library; the bootstrap scripts build the deployable version.
.target(
name: "PackageDescription",
path: "Sources/Runtimes/PackageDescription",
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.define("USE_IMPL_ONLY_IMPORTS"),
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"]),
],
linkerSettings: packageLibraryLinkSettings
),

// The `PackagePlugin` target provides the API that is available to
// plugin scripts. Here we build a debug version of the library; the
// bootstrap scripts build the deployable version.
.target(
name: "PackagePlugin",
path: "Sources/Runtimes/PackagePlugin",
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"]),
],
linkerSettings: packageLibraryLinkSettings
),

// MARK: Support for Swift macros, should eventually move to a plugin-based solution

.target(
name: "CompilerPluginSupport",
dependencies: ["PackageDescription"],
path: "Sources/Runtimes/CompilerPluginSupport",
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.unsafeFlags(["-package-description-version", "999.0"]),
Expand All @@ -789,19 +793,19 @@ let package = Package(

// MARK: Additional Test Dependencies

.target(
/** SwiftPM internal build test suite support library */
name: "_InternalBuildTestSupport",
dependencies: [
"Build",
"XCBuildSupport",
"SwiftBuildSupport",
"_InternalTestSupport"
],
swiftSettings: [
.unsafeFlags(["-static"]),
]
),
.target(
/** SwiftPM internal build test suite support library */
name: "_InternalBuildTestSupport",
dependencies: [
"Build",
"XCBuildSupport",
"SwiftBuildSupport",
"_InternalTestSupport"
],
swiftSettings: [
.unsafeFlags(["-static"]),
]
),

.target(
/** SwiftPM internal test suite support library */
Expand Down
29 changes: 26 additions & 3 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ add_subdirectory(Basics)
add_subdirectory(BinarySymbols)
add_subdirectory(Build)
add_subdirectory(Commands)
add_subdirectory(CompilerPluginSupport)
add_subdirectory(CoreCommands)
add_subdirectory(DriverSupport)
add_subdirectory(LLBuildManifest)
add_subdirectory(PackageCollections)
add_subdirectory(PackageCollectionsModel)
add_subdirectory(PackageCollectionsSigning)
add_subdirectory(PackageDescription)
add_subdirectory(PackageFingerprint)
add_subdirectory(PackageGraph)
add_subdirectory(PackageLoading)
add_subdirectory(PackageModel)
add_subdirectory(PackagePlugin)
add_subdirectory(PackageRegistry)
add_subdirectory(PackageRegistryCommand)
add_subdirectory(PackageSigning)
Expand All @@ -48,3 +45,29 @@ add_subdirectory(Workspace)
add_subdirectory(XCBuildSupport)
add_subdirectory(SwiftBuildSupport)
add_subdirectory(tsan_utils)

if(SwiftPM_ENABLE_RUNTIME)
add_subdirectory(Runtimes)
# NOTE: maintain the custom output directory for the ManifestAPI modules to
# allow the boostrap scripts to continue functioning as they have historically.
# This is unnecessary with the split runtime build, but is left here to
# minimize disruption.
set_target_properties(CompilerPluginSupport PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI)
set_target_properties(PackageDescription PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI)
set_target_properties(PackagePlugin PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI)
endif()
50 changes: 0 additions & 50 deletions Sources/CompilerPluginSupport/CMakeLists.txt

This file was deleted.

65 changes: 0 additions & 65 deletions Sources/PackageDescription/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion Sources/PackageDescription/ContextModel.swift

This file was deleted.

73 changes: 0 additions & 73 deletions Sources/PackagePlugin/CMakeLists.txt

This file was deleted.

Loading