Skip to content

Commit d12eceb

Browse files
committed
Update CMake build and bootstrap script for PackageModelSyntax module
1 parent ada683e commit d12eceb

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

Sources/Commands/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ target_link_libraries(Commands PUBLIC
5656
CoreCommands
5757
LLBuildManifest
5858
PackageGraph
59+
PackageModelSyntax
5960
SourceControl
6061
TSCBasic
6162
TSCUtility
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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(PackageModelSyntax
10+
AddPackageDependency.swift
11+
ManifestEditError.swift
12+
ManifestSyntaxRepresentable.swift
13+
PackageDependency+Syntax.swift
14+
SyntaxEditUtils.swift)
15+
target_link_libraries(PackageModelSyntax PUBLIC
16+
Basics
17+
PackageLoading
18+
PackageModel
19+
20+
SwiftDiagnostics
21+
SwiftParser
22+
SwiftSyntax
23+
SwiftSyntaxBuilder)
24+
# NOTE(compnerd) workaround for CMake not setting up include flags yet
25+
set_target_properties(PackageModelSyntax PROPERTIES
26+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
27+
28+
install(TARGETS PackageModelSyntax
29+
ARCHIVE DESTINATION lib
30+
LIBRARY DESTINATION lib
31+
RUNTIME DESTINATION bin)
32+
set_property(GLOBAL APPEND PROPERTY SwiftPM_EXPORTS PackageModelSyntax)

Utilities/bootstrap

+2
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def parse_global_args(args):
198198
args.source_dirs["swift-argument-parser"] = os.path.join(args.project_root, "..", "swift-argument-parser")
199199
args.source_dirs["swift-crypto"] = os.path.join(args.project_root, "..", "swift-crypto")
200200
args.source_dirs["swift-driver"] = os.path.join(args.project_root, "..", "swift-driver")
201+
args.source_dirs["swift-syntax"] = os.path.join(args.project_root, "..", "swift-syntax")
201202
args.source_dirs["swift-system"] = os.path.join(args.project_root, "..", "swift-system")
202203
args.source_dirs["swift-collections"] = os.path.join(args.project_root, "..", "swift-collections")
203204
args.source_dirs["swift-certificates"] = os.path.join(args.project_root, "..", "swift-certificates")
@@ -625,6 +626,7 @@ def build_swiftpm_with_cmake(args):
625626
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-argument-parser"], "lib"))
626627
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-crypto"], "lib"))
627628
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-driver"], "lib"))
629+
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-syntax"], "lib"))
628630
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-system"], "lib"))
629631
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-collections"], "lib"))
630632
add_rpath_for_cmake_build(args, os.path.join(args.build_dirs["swift-asn1"], "lib"))

0 commit comments

Comments
 (0)