Skip to content

Commit 0e18fda

Browse files
committed
build: complete the CMake based build
This adds the missing libraries we need to build the full test suite on Windows against the CMake products.
1 parent 1f1216b commit 0e18fda

File tree

10 files changed

+198
-0
lines changed

10 files changed

+198
-0
lines changed

Package.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ let package = Package(
421421
dependencies: [],
422422
exclude: [
423423
"Formats/v1.md",
424+
"CMakeLists.txt",
424425
],
425426
swiftSettings: commonExperimentalFeatures + [
426427
.unsafeFlags(["-static"]),
@@ -437,6 +438,7 @@ let package = Package(
437438
"PackageModel",
438439
"SourceControl",
439440
],
441+
exclude: ["CMakeLists.txt"],
440442
swiftSettings: swift6CompatibleExperimentalFeatures + [
441443
.unsafeFlags(["-static"]),
442444
]
@@ -450,6 +452,7 @@ let package = Package(
450452
"Basics",
451453
"PackageCollectionsModel",
452454
],
455+
exclude: ["CMakeLists.txt"],
453456
swiftSettings: commonExperimentalFeatures + [
454457
.unsafeFlags(["-static"]),
455458
]
@@ -682,6 +685,7 @@ let package = Package(
682685
"SPMBuildCore",
683686
"Workspace",
684687
],
688+
exclude: ["CMakeLists.txt"],
685689
swiftSettings: commonExperimentalFeatures + [
686690
.unsafeFlags(["-static"]),
687691
]
@@ -694,6 +698,7 @@ let package = Package(
694698
"Basics",
695699
.product(name: "Crypto", package: "swift-crypto"),
696700
],
701+
exclude: ["CMakeLists.txt"],
697702
swiftSettings: [
698703
.enableExperimentalFeature("StrictConcurrency=complete"),
699704
.unsafeFlags(["-static"]),

Sources/Basics/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ add_library(Basics
3838
FileSystem/RelativePath.swift
3939
FileSystem/TemporaryFile.swift
4040
FileSystem/TSCAdapters.swift
41+
FileSystem/VirtualFileSystem.swift
4142
FileSystem/VFSOverlay.swift
4243
Graph/AdjacencyMatrix.swift
4344
Graph/DirectedGraph.swift

Sources/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ add_subdirectory(CompilerPluginSupport)
1717
add_subdirectory(CoreCommands)
1818
add_subdirectory(DriverSupport)
1919
add_subdirectory(LLBuildManifest)
20+
add_subdirectory(PackageCollections)
21+
add_subdirectory(PackageCollectionsModel)
22+
add_subdirectory(PackageCollectionsSigning)
2023
add_subdirectory(PackageDescription)
2124
add_subdirectory(PackageFingerprint)
2225
add_subdirectory(PackageGraph)
@@ -25,7 +28,9 @@ add_subdirectory(PackageModel)
2528
add_subdirectory(PackageModelSyntax)
2629
add_subdirectory(PackagePlugin)
2730
add_subdirectory(PackageRegistry)
31+
add_subdirectory(PackageRegistryCommand)
2832
add_subdirectory(PackageSigning)
33+
add_subdirectory(QueryEngine)
2934
add_subdirectory(SourceControl)
3035
add_subdirectory(SourceKitLSPAPI)
3136
add_subdirectory(SPMBuildCore)
@@ -43,3 +48,4 @@ add_subdirectory(SwiftSDKCommand)
4348
add_subdirectory(Workspace)
4449
add_subdirectory(XCBuildSupport)
4550
add_subdirectory(SwiftBuildSupport)
51+
add_subdirectory(tsan_utils)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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_library(PackageCollections
10+
API.swift
11+
Model/CVE.swift
12+
Model/Collection.swift
13+
Model/License.swift
14+
Model/PackageList.swift
15+
Model/PackageTypes.swift
16+
Model/Search.swift
17+
Model/TargetListResult.swift
18+
PackageCollections+CertificatePolicy.swift
19+
PackageCollections+Configuration.swift
20+
PackageCollections+Storage.swift
21+
PackageCollections+Validation.swift
22+
PackageCollections.swift
23+
PackageIndex+Configuration.swift
24+
PackageIndex.swift
25+
PackageIndexAndCollections.swift
26+
Providers/GitHubPackageMetadataProvider.swift
27+
Providers/JSONPackageCollectionProvider.swift
28+
Providers/PackageCollectionProvider.swift
29+
Providers/PackageMetadataProvider.swift
30+
Storage/FilePackageCollectionsSourcesStorage.swift
31+
Storage/PackageCollectionsSourcesStorage.swift
32+
Storage/PackageCollectionsStorage.swift
33+
Storage/SQLitePackageCollectionsStorage.swift
34+
Storage/Trie.swift
35+
Utility.swift)
36+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
37+
set_target_properties(PackageCollections PROPERTIES
38+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
39+
target_link_libraries(PackageCollections PUBLIC
40+
Basics
41+
PackageCollectionsModel
42+
PackageCollectionsSigning
43+
PackageModel
44+
SourceControl
45+
TSCBasic
46+
TSCUtility)
47+
if(NOT APPLE)
48+
if(Foundation_FOUND)
49+
target_link_directories(PackageCollections PRIVATE
50+
$<TARGET_LINKER_FILE_DIR:Fooundation>)
51+
endif()
52+
if(dispatch_FOUND)
53+
target_link_directories(PackageCollections PRIVATE
54+
$<TARGET_LINKER_FILE_DIR:Dispatch>)
55+
endif()
56+
endif()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2014 - 2024 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(PackageCollectionsModel
10+
PackageCollectionModel+v1.swift
11+
PackageCollectionModel.swift)
12+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
13+
set_target_properties(PackageCollectionsModel PROPERTIES
14+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
15+
if(NOT APPLE)
16+
if(Foundation_FOUND)
17+
target_link_directories(PackageCollectionsModel PRIVATE
18+
$<TARGET_LINKER_FILE_DIR:Fooundation>)
19+
endif()
20+
endif()
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2014 - 2024 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(PackageCollectionsSigning
10+
CertificatePolicy.swift
11+
PackageCollectionSigning.swift
12+
Signature.swift
13+
Utilities/Base64URL.swift
14+
Utilities/Utilities.swift
15+
X509Extensions.swift
16+
embedded_resources.swift)
17+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
18+
set_target_properties(PackageCollectionsSigning PROPERTIES
19+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
20+
target_link_libraries(PackageCollectionsSigning PUBLIC
21+
Basics
22+
PackageCollectionsModel
23+
Crypto
24+
_CryptoExtras
25+
SwiftASN1
26+
X509)
27+
if(NOT APPLE)
28+
if(Foundation_FOUND)
29+
target_link_directories(PackageCollectionsSigning PRIVATE
30+
$<TARGET_LINKER_FILE_DIR:Fooundation>)
31+
endif()
32+
if(dispatch_FOUND)
33+
target_link_directories(PackageCollectionsSigning PRIVATE
34+
$<TARGET_LINKER_FILE_DIR:dispatch>)
35+
endif()
36+
endif()
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2014 - 2024 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(PackageRegistryCommand
10+
PackageRegistryCommand+Auth.swift
11+
PackageRegistryCommand+Publish.swift
12+
PackageRegistryCommand.swift)
13+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
14+
set_target_properties(PackageRegistryCommand PROPERTIES
15+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
16+
target_link_libraries(PackageRegistryCommand PUBLIC
17+
Basics
18+
Commands
19+
CoreCommands
20+
PackageFingerprint
21+
PackageModel
22+
PackageRegistry
23+
PackageSigning
24+
Workspace
25+
ArgumentParser
26+
TSCBasic
27+
TSCUtility
28+
X509)
29+
if(NOT APPLE)
30+
if(Foundation_FOUND)
31+
target_link_directories(PackageRegistryCommand PRIVATE
32+
$<TARGET_LINKER_FILE_DIR:Fooundation>)
33+
endif()
34+
endif()

Sources/QueryEngine/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2014 - 2024 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(QueryEngine
10+
CacheKey.swift
11+
FileCacheRecord.swift
12+
Query.swift
13+
QueryEngine.swift)
14+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
15+
set_target_properties(QueryEngine PROPERTIES
16+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
17+
target_link_libraries(QueryEngine PUBLIC
18+
_AsyncFileSystem
19+
Basics
20+
Crypto
21+
SwiftSystem::SystemPackage)
22+
if(NOT APPLE)
23+
if(Foundation_FOUND)
24+
target_link_directories(QueryEngine PRIVATE
25+
$<TARGET_LINKER_FILE_DIR:Foundation>)
26+
endif()
27+
endif()

Sources/tsan_utils/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This source file is part of the Swift open source project
2+
#
3+
# Copyright (c) 2014 - 2024 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(tsan_utils STATIC
10+
tsan_utils.c)
11+
target_include_directories(tsan_utils PUBLIC
12+
include)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module tsan_utils {
22
header "tsan_utils.h"
33
export *
4+
link "tsan_utils"
45
}

0 commit comments

Comments
 (0)