Skip to content

Commit f9ec030

Browse files
committed
Guarded imports with NO_SWIFTPM flag.
1 parent 69e3ebf commit f9ec030

15 files changed

+32
-1
lines changed

Sources/Clang/Availability.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
public struct Availability {
46
let alwaysDeprecated: Bool

Sources/Clang/CType.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// The type of an element in the abstract syntax tree.
46
public protocol CType: CustomStringConvertible {

Sources/Clang/CTypes.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// MARK: Special Types
46
public struct RecordType: ClangTypeBacked {

Sources/Clang/ClangError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// Represents the errors that can be thrown by libclang.
46
enum ClangError: Error {

Sources/Clang/Comment.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// A `Comment` is a parsed documentation comment in a C/C++/Objective-C source
46
/// file.

Sources/Clang/Cursor.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// A cursor representing some element in the abstract syntax tree for a
46
/// translation unit.
@@ -16,7 +18,8 @@ import cclang
1618
/// `children() to explore the rest of the translation unit.
1719
///
1820
/// `SourceLocation.cursor` maps from a physical source location to the entity
19-
/// that resides at that location, allowing one to map from the source code into the AST.
21+
/// that resides at that location, allowing one to map from the source code into
22+
/// the AST.
2023
public protocol Cursor: CustomStringConvertible {
2124
/// Converts this cursor value to a CXCursor value to be consumed by
2225
/// libclang APIs

Sources/Clang/Cursors.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/// IMPORTANT: This file is automatically generated.
2+
#if !NO_SWIFTPM
23
import cclang
4+
#endif
35

46
/// MARK: Customized Types
57

Sources/Clang/Diagnostic.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// Describes the severity of a particular diagnostic.
46
public enum DiagnosticSeverity {

Sources/Clang/File.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24
import Foundation
35

46
/// Represents a file ID that's unique to each file in a translation unit.

Sources/Clang/Index.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
public class Index {
46
let clang: CXIndex

Sources/Clang/Language.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// The "language" a given cursor is written in.
46
public enum Language {

Sources/Clang/Token.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24
import Foundation
35

46
public struct Token {

Sources/Clang/TranslationUnit.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
/// Flags that control the creation of translation units.
46
/// The enumerators in this enumeration type are meant to be bitwise ORed

Sources/Clang/Utilities.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if !NO_SWIFTPM
12
import cclang
3+
#endif
24

35
internal extension Bool {
46
func asClang() -> Int32 {

Tests/ClangTests/ClangTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import XCTest
2+
#if !NO_SWIFTPM
23
import cclang
4+
#endif
35
@testable import Clang
46

57
extension String {

0 commit comments

Comments
 (0)