Skip to content

Commit dfa4938

Browse files
authored
Merge pull request #2194 from aciidb0mb3r/inh-swift-5.1-branch
[Xcodeproj] Add $(inherited) to OTHER_SWIFT_FLAGS
2 parents 45f2384 + bbb77d2 commit dfa4938

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
File renamed without changes.

Sources/Xcodeproj/pbxproj().swift renamed to Sources/Xcodeproj/pbxproj.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ func xcodeProject(
126126
// paths so that all the products can be found.
127127
projectSettings.common.DYLIB_INSTALL_NAME_BASE = "@rpath"
128128

129+
// Set the `Xcode` build preset in Swift to let code conditionalize on
130+
// being built in Xcode.
131+
projectSettings.common.OTHER_SWIFT_FLAGS = ["$(inherited)", "-DXcode"]
132+
129133
// Add any additional compiler and linker flags the user has specified.
130134
if !options.flags.cCompilerFlags.isEmpty {
131135
projectSettings.common.OTHER_CFLAGS = options.flags.cCompilerFlags
@@ -134,12 +138,9 @@ func xcodeProject(
134138
projectSettings.common.OTHER_LDFLAGS = options.flags.linkerFlags
135139
}
136140
if !options.flags.swiftCompilerFlags.isEmpty {
137-
projectSettings.common.OTHER_SWIFT_FLAGS = options.flags.swiftCompilerFlags
141+
projectSettings.common.OTHER_SWIFT_FLAGS += options.flags.swiftCompilerFlags
138142
}
139143

140-
// Also set the `Xcode` build preset in Swift to let code conditionalize on
141-
// being built in Xcode.
142-
projectSettings.common.OTHER_SWIFT_FLAGS += ["-DXcode"]
143144
projectSettings.common.MACOSX_DEPLOYMENT_TARGET = "10.10"
144145

145146
// Prevent Xcode project upgrade warnings.

0 commit comments

Comments
 (0)