Skip to content

Commit b881abe

Browse files
committed
Add a dedicated library for compiler support.
The compiler support library is going to pull in a number of different modules from this package, and provide APIs that only make sense for the compiler itself. Separate those into their own module.
1 parent 1671df7 commit b881abe

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

Package.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ let package = Package(
124124
name: "SwiftOperators",
125125
dependencies: ["SwiftSyntax", "SwiftParser", "SwiftDiagnostics"]
126126
),
127+
.target(
128+
name: "SwiftCompilerSupport",
129+
dependencies: [
130+
"SwiftSyntax", "SwiftParser", "SwiftDiagnostics", "SwiftOperators"]
131+
),
127132
.executableTarget(
128133
name: "lit-test-helper",
129134
dependencies: ["SwiftSyntax", "SwiftSyntaxParser"]

Sources/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ add_subdirectory(SwiftSyntax)
1010
add_subdirectory(SwiftDiagnostics)
1111
add_subdirectory(SwiftParser)
1212
add_subdirectory(SwiftOperators)
13+
add_subdirectory(SwiftCompilerSupport)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This source file is part of the Swift.org open source project
2+
#
3+
# Copyright (c) 2014 - 2022 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(SwiftCompilerSupport STATIC
10+
ConsistencyCheck.swift
11+
)
12+
13+
target_link_libraries(SwiftCompilerSupport PUBLIC
14+
SwiftSyntax
15+
SwiftDiagnostics
16+
SwiftParser
17+
SwiftOperators
18+
)
19+
20+
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS SwiftCompilerSupport)
21+
22+
# NOTE: workaround for CMake not setting up include flags yet
23+
set_target_properties(SwiftCompilerSupport PROPERTIES
24+
INTERFACE_INCLUDE_DIRECTORIES
25+
"${CMAKE_Swift_MODULE_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}")
26+
27+
install(TARGETS SwiftCompilerSupport
28+
EXPORT SwiftSyntaxTargets
29+
ARCHIVE DESTINATION lib
30+
LIBRARY DESTINATION lib
31+
RUNTIME DESTINATION bin)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===-------------------------- ConsistencyCheck.swift --------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
import SwiftOperators
14+
import SwiftParser
15+
import SwiftSyntax

0 commit comments

Comments
 (0)