Skip to content

Commit a87e68e

Browse files
committed
[PackageDescription] Remove underscore from build settings APIs
<rdar://problem/23270646> [SR-3948] Need support for specifying build settings
1 parent 44a9968 commit a87e68e

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

Sources/PackageDescription4/Target.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ public final class Target {
8181
public let providers: [SystemPackageProvider]?
8282

8383
/// C build settings.
84-
var cSettings: [CSetting]?
84+
public var cSettings: [CSetting]?
8585

8686
/// C++ build settings.
87-
var cxxSettings: [CXXSetting]?
87+
public var cxxSettings: [CXXSetting]?
8888

8989
/// Swift build settings.
90-
var swiftSettings: [SwiftSetting]?
90+
public var swiftSettings: [SwiftSetting]?
9191

9292
/// Linker build settings.
93-
var linkerSettings: [LinkerSetting]?
93+
public var linkerSettings: [LinkerSetting]?
9494

9595
/// Construct a target.
9696
private init(
@@ -136,10 +136,10 @@ public final class Target {
136136
exclude: [String] = [],
137137
sources: [String]? = nil,
138138
publicHeadersPath: String? = nil,
139-
_cSettings: [CSetting]? = nil,
140-
_cxxSettings: [CXXSetting]? = nil,
141-
_swiftSettings: [SwiftSetting]? = nil,
142-
_linkerSettings: [LinkerSetting]? = nil
139+
cSettings: [CSetting]? = nil,
140+
cxxSettings: [CXXSetting]? = nil,
141+
swiftSettings: [SwiftSetting]? = nil,
142+
linkerSettings: [LinkerSetting]? = nil
143143
) -> Target {
144144
return Target(
145145
name: name,
@@ -149,10 +149,10 @@ public final class Target {
149149
sources: sources,
150150
publicHeadersPath: publicHeadersPath,
151151
type: .regular,
152-
cSettings: _cSettings,
153-
cxxSettings: _cxxSettings,
154-
swiftSettings: _swiftSettings,
155-
linkerSettings: _linkerSettings
152+
cSettings: cSettings,
153+
cxxSettings: cxxSettings,
154+
swiftSettings: swiftSettings,
155+
linkerSettings: linkerSettings
156156
)
157157
}
158158

@@ -162,10 +162,10 @@ public final class Target {
162162
path: String? = nil,
163163
exclude: [String] = [],
164164
sources: [String]? = nil,
165-
_cSettings: [CSetting]? = nil,
166-
_cxxSettings: [CXXSetting]? = nil,
167-
_swiftSettings: [SwiftSetting]? = nil,
168-
_linkerSettings: [LinkerSetting]? = nil
165+
cSettings: [CSetting]? = nil,
166+
cxxSettings: [CXXSetting]? = nil,
167+
swiftSettings: [SwiftSetting]? = nil,
168+
linkerSettings: [LinkerSetting]? = nil
169169
) -> Target {
170170
return Target(
171171
name: name,
@@ -175,10 +175,10 @@ public final class Target {
175175
sources: sources,
176176
publicHeadersPath: nil,
177177
type: .test,
178-
cSettings: _cSettings,
179-
cxxSettings: _cxxSettings,
180-
swiftSettings: _swiftSettings,
181-
linkerSettings: _linkerSettings
178+
cSettings: cSettings,
179+
cxxSettings: cxxSettings,
180+
swiftSettings: swiftSettings,
181+
linkerSettings: linkerSettings
182182
)
183183
}
184184

Tests/PackageLoadingTests/PD4_2LoadingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ class PackageDescription4_2LoadingTests: XCTestCase {
229229
targets: [
230230
.target(
231231
name: "Foo",
232-
_swiftSettings: [
232+
swiftSettings: [
233233
.define("SWIFT", .when(configuration: .release)),
234234
],
235-
_linkerSettings: [
235+
linkerSettings: [
236236
.linkedLibrary("libz"),
237237
]
238238
),

Tests/PackageLoadingTests/PD5LoadingTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,20 +236,20 @@ class PackageDescription5LoadingTests: XCTestCase {
236236
targets: [
237237
.target(
238238
name: "Foo",
239-
_cSettings: [
239+
cSettings: [
240240
.headerSearchPath("path/to/foo"),
241241
.define("C", .when(platforms: [.linux])),
242242
.define("CC", to: "4", .when(platforms: [.linux], configuration: .release)),
243243
],
244-
_cxxSettings: [
244+
cxxSettings: [
245245
.headerSearchPath("path/to/bar"),
246246
.define("CXX"),
247247
],
248-
_swiftSettings: [
248+
swiftSettings: [
249249
.define("SWIFT", .when(configuration: .release)),
250250
.define("SWIFT_DEBUG", .when(platforms: [.watchOS], configuration: .debug)),
251251
],
252-
_linkerSettings: [
252+
linkerSettings: [
253253
.linkedLibrary("libz"),
254254
.linkedFramework("CoreData", .when(platforms: [.macOS, .tvOS])),
255255
]

0 commit comments

Comments
 (0)