Skip to content

Commit 007e8f1

Browse files
authored
Merge pull request #811 from DougGregor/build-support-library
2 parents b4cbf40 + b881abe commit 007e8f1

File tree

5 files changed

+91
-0
lines changed

5 files changed

+91
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
add_subdirectory(SwiftSyntax)
1010
add_subdirectory(SwiftDiagnostics)
1111
add_subdirectory(SwiftParser)
12+
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

Sources/SwiftOperators/CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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(SwiftOperators STATIC
10+
Operator.swift
11+
OperatorError+Diagnostics.swift
12+
OperatorError.swift
13+
OperatorTable+Defaults.swift
14+
OperatorTable+Folding.swift
15+
OperatorTable+Semantics.swift
16+
OperatorTable.swift
17+
PrecedenceGraph.swift
18+
PrecedenceGroup.swift
19+
SyntaxSynthesis.swift
20+
)
21+
22+
target_link_libraries(SwiftOperators PUBLIC
23+
SwiftSyntax
24+
SwiftDiagnostics
25+
SwiftParser)
26+
27+
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS SwiftOperators)
28+
29+
# NOTE: workaround for CMake not setting up include flags yet
30+
set_target_properties(SwiftOperators PROPERTIES
31+
INTERFACE_INCLUDE_DIRECTORIES
32+
"${CMAKE_Swift_MODULE_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}")
33+
34+
install(TARGETS SwiftOperators
35+
EXPORT SwiftSyntaxTargets
36+
ARCHIVE DESTINATION lib
37+
LIBRARY DESTINATION lib
38+
RUNTIME DESTINATION bin)

0 commit comments

Comments
 (0)