diff --git a/Package.swift b/Package.swift index 6d9d3efbf42..910cdee0cc2 100644 --- a/Package.swift +++ b/Package.swift @@ -421,6 +421,7 @@ let package = Package( dependencies: [], exclude: [ "Formats/v1.md", + "CMakeLists.txt", ], swiftSettings: commonExperimentalFeatures + [ .unsafeFlags(["-static"]), @@ -437,6 +438,7 @@ let package = Package( "PackageModel", "SourceControl", ], + exclude: ["CMakeLists.txt"], swiftSettings: swift6CompatibleExperimentalFeatures + [ .unsafeFlags(["-static"]), ] @@ -450,6 +452,7 @@ let package = Package( "Basics", "PackageCollectionsModel", ], + exclude: ["CMakeLists.txt"], swiftSettings: commonExperimentalFeatures + [ .unsafeFlags(["-static"]), ] @@ -682,6 +685,7 @@ let package = Package( "SPMBuildCore", "Workspace", ], + exclude: ["CMakeLists.txt"], swiftSettings: commonExperimentalFeatures + [ .unsafeFlags(["-static"]), ] @@ -694,6 +698,7 @@ let package = Package( "Basics", .product(name: "Crypto", package: "swift-crypto"), ], + exclude: ["CMakeLists.txt"], swiftSettings: [ .enableExperimentalFeature("StrictConcurrency=complete"), .unsafeFlags(["-static"]), diff --git a/Sources/Basics/CMakeLists.txt b/Sources/Basics/CMakeLists.txt index c1e018b7c76..e2910d09b81 100644 --- a/Sources/Basics/CMakeLists.txt +++ b/Sources/Basics/CMakeLists.txt @@ -38,6 +38,7 @@ add_library(Basics FileSystem/RelativePath.swift FileSystem/TemporaryFile.swift FileSystem/TSCAdapters.swift + FileSystem/VirtualFileSystem.swift FileSystem/VFSOverlay.swift Graph/AdjacencyMatrix.swift Graph/DirectedGraph.swift diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 809eb98067e..0698b97e71e 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -17,6 +17,9 @@ 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) @@ -25,7 +28,9 @@ add_subdirectory(PackageModel) add_subdirectory(PackageModelSyntax) add_subdirectory(PackagePlugin) add_subdirectory(PackageRegistry) +add_subdirectory(PackageRegistryCommand) add_subdirectory(PackageSigning) +add_subdirectory(QueryEngine) add_subdirectory(SourceControl) add_subdirectory(SourceKitLSPAPI) add_subdirectory(SPMBuildCore) @@ -43,3 +48,4 @@ add_subdirectory(SwiftSDKCommand) add_subdirectory(Workspace) add_subdirectory(XCBuildSupport) add_subdirectory(SwiftBuildSupport) +add_subdirectory(tsan_utils) diff --git a/Sources/PackageCollections/CMakeLists.txt b/Sources/PackageCollections/CMakeLists.txt new file mode 100644 index 00000000000..63eb94c2f22 --- /dev/null +++ b/Sources/PackageCollections/CMakeLists.txt @@ -0,0 +1,61 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2021 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackageCollections + API.swift + Model/CVE.swift + Model/Collection.swift + Model/License.swift + Model/PackageList.swift + Model/PackageTypes.swift + Model/Search.swift + Model/TargetListResult.swift + PackageCollections+CertificatePolicy.swift + PackageCollections+Configuration.swift + PackageCollections+Storage.swift + PackageCollections+Validation.swift + PackageCollections.swift + PackageIndex+Configuration.swift + PackageIndex.swift + PackageIndexAndCollections.swift + Providers/GitHubPackageMetadataProvider.swift + Providers/JSONPackageCollectionProvider.swift + Providers/PackageCollectionProvider.swift + Providers/PackageMetadataProvider.swift + Storage/FilePackageCollectionsSourcesStorage.swift + Storage/PackageCollectionsSourcesStorage.swift + Storage/PackageCollectionsStorage.swift + Storage/SQLitePackageCollectionsStorage.swift + Storage/Trie.swift + Utility.swift) +# NOTE(compnerd) workaround for CMake not setting up include flags yet +set_target_properties(PackageCollections PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +target_link_libraries(PackageCollections PUBLIC + Basics + PackageCollectionsModel + PackageCollectionsSigning + PackageModel + SourceControl + TSCBasic + TSCUtility) +if(NOT APPLE) + if(Foundation_FOUND) + target_link_directories(PackageCollections PRIVATE + $) + endif() + if(dispatch_FOUND) + target_link_directories(PackageCollections PRIVATE + $) + endif() +endif() + +install(TARGETS PackageCollections + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) diff --git a/Sources/PackageCollectionsModel/CMakeLists.txt b/Sources/PackageCollectionsModel/CMakeLists.txt new file mode 100644 index 00000000000..9f98827a559 --- /dev/null +++ b/Sources/PackageCollectionsModel/CMakeLists.txt @@ -0,0 +1,25 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackageCollectionsModel + PackageCollectionModel+v1.swift + PackageCollectionModel.swift) +# NOTE(compnerd) workaround for CMake not setting up include flags yet +set_target_properties(PackageCollectionsModel PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +if(NOT APPLE) + if(Foundation_FOUND) + target_link_directories(PackageCollectionsModel PRIVATE + $) + endif() +endif() + +install(TARGETS PackageCollectionsModel + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) diff --git a/Sources/PackageCollectionsSigning/CMakeLists.txt b/Sources/PackageCollectionsSigning/CMakeLists.txt new file mode 100644 index 00000000000..5f3d69abebe --- /dev/null +++ b/Sources/PackageCollectionsSigning/CMakeLists.txt @@ -0,0 +1,41 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackageCollectionsSigning + CertificatePolicy.swift + PackageCollectionSigning.swift + Signature.swift + Utilities/Base64URL.swift + Utilities/Utilities.swift + X509Extensions.swift + embedded_resources.swift) +# NOTE(compnerd) workaround for CMake not setting up include flags yet +set_target_properties(PackageCollectionsSigning PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +target_link_libraries(PackageCollectionsSigning PUBLIC + Basics + PackageCollectionsModel + Crypto + _CryptoExtras + SwiftASN1 + X509) +if(NOT APPLE) + if(Foundation_FOUND) + target_link_directories(PackageCollectionsSigning PRIVATE + $) + endif() + if(dispatch_FOUND) + target_link_directories(PackageCollectionsSigning PRIVATE + $) + endif() +endif() + +install(TARGETS PackageCollectionsSigning + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) diff --git a/Sources/PackageRegistryCommand/CMakeLists.txt b/Sources/PackageRegistryCommand/CMakeLists.txt new file mode 100644 index 00000000000..92c7785edec --- /dev/null +++ b/Sources/PackageRegistryCommand/CMakeLists.txt @@ -0,0 +1,39 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackageRegistryCommand + PackageRegistryCommand+Auth.swift + PackageRegistryCommand+Publish.swift + PackageRegistryCommand.swift) +# NOTE(compnerd) workaround for CMake not setting up include flags yet +set_target_properties(PackageRegistryCommand PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +target_link_libraries(PackageRegistryCommand PUBLIC + Basics + Commands + CoreCommands + PackageFingerprint + PackageModel + PackageRegistry + PackageSigning + Workspace + ArgumentParser + TSCBasic + TSCUtility + X509) +if(NOT APPLE) + if(Foundation_FOUND) + target_link_directories(PackageRegistryCommand PRIVATE + $) + endif() +endif() + +install(TARGETS PackageRegistryCommand + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) diff --git a/Sources/QueryEngine/CMakeLists.txt b/Sources/QueryEngine/CMakeLists.txt new file mode 100644 index 00000000000..869c52c4561 --- /dev/null +++ b/Sources/QueryEngine/CMakeLists.txt @@ -0,0 +1,32 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(QueryEngine + CacheKey.swift + FileCacheRecord.swift + Query.swift + QueryEngine.swift) +# NOTE(compnerd) workaround for CMake not setting up include flags yet +set_target_properties(QueryEngine PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +target_link_libraries(QueryEngine PUBLIC + _AsyncFileSystem + Basics + Crypto + SwiftSystem::SystemPackage) +if(NOT APPLE) + if(Foundation_FOUND) + target_link_directories(QueryEngine PRIVATE + $) + endif() +endif() + +install(TARGETS QueryEngine + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) diff --git a/Sources/tsan_utils/CMakeLists.txt b/Sources/tsan_utils/CMakeLists.txt new file mode 100644 index 00000000000..3bfeb3f3480 --- /dev/null +++ b/Sources/tsan_utils/CMakeLists.txt @@ -0,0 +1,12 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(tsan_utils STATIC + tsan_utils.c) +target_include_directories(tsan_utils PUBLIC + include)