Skip to content

Commit 3022270

Browse files
authored
Merge pull request #81281 from hamishknight/you-get-a-buildable-folder
2 parents fba1f1d + 2199031 commit 3022270

19 files changed

+466
-244
lines changed

utils/swift-xcodegen/Package.resolved

Lines changed: 9 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/swift-xcodegen/Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ let package = Package(
88
name: "swift-xcodegen",
99
platforms: [.macOS(.v13)],
1010
targets: [
11-
.target(name: "Xcodeproj", exclude: ["README.md"]),
1211
.target(
1312
name: "SwiftXcodeGen",
1413
dependencies: [
1514
.product(name: "ArgumentParser", package: "swift-argument-parser"),
1615
.product(name: "SwiftOptions", package: "swift-driver"),
17-
"Xcodeproj"
16+
],
17+
exclude: [
18+
"Xcodeproj/README.md",
1819
],
1920
swiftSettings: [
2021
.enableExperimentalFeature("StrictConcurrency")

utils/swift-xcodegen/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ PROJECT CONFIGURATION:
9494
Requires Xcode 16: Enables the use of "buildable folders", allowing
9595
folder references to be used for compatible targets. This allows new
9696
source files to be added to a target without needing to regenerate the
97-
project.
98-
99-
Only supported for targets that have no per-file build settings. This
100-
unfortunately means some Clang targes such as 'lib/Basic' and 'stdlib'
101-
cannot currently use buildable folders. (default: --buildable-folders)
97+
project. (default: --buildable-folders)
10298
10399
--runtimes-build-dir <runtimes-build-dir>
104100
Experimental: The path to a build directory for the new 'Runtimes/'

utils/swift-xcodegen/Sources/SwiftXcodeGen/Command/KnownCommand.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,22 @@ extension Command.Flag {
147147
swiftc(.experimentalSkipNonInlinableFunctionBodies)
148148
static let experimentalSkipNonInlinableFunctionBodiesWithoutTypes =
149149
swiftc(.experimentalSkipNonInlinableFunctionBodiesWithoutTypes)
150+
static let enableUpcomingFeature =
151+
swiftc(.enableUpcomingFeature)
152+
static let disableExperimentalFeature =
153+
swiftc(.disableExperimentalFeature)
154+
static let disableUpcomingFeature =
155+
swiftc(.disableUpcomingFeature)
150156
static let F =
151157
swiftc(.F)
152158
static let Fsystem =
153159
swiftc(.Fsystem)
160+
static let libraryLevel =
161+
swiftc(.libraryLevel)
154162
static let moduleName =
155163
swiftc(.moduleName)
164+
static let moduleAbiName =
165+
swiftc(.moduleAbiName)
156166
static let moduleLinkName =
157167
swiftc(.moduleLinkName)
158168
static let nostdimport =
@@ -171,8 +181,12 @@ extension Command.Flag {
171181
swiftc(.runtimeCompatibilityVersion)
172182
static let sdk =
173183
swiftc(.sdk)
184+
static let strictMemorySafety =
185+
swiftc(.strictMemorySafety)
174186
static let swiftVersion =
175187
swiftc(.swiftVersion)
188+
static let warnImplicitOverrides =
189+
swiftc(.warnImplicitOverrides)
176190
static let wholeModuleOptimization =
177191
swiftc(.wholeModuleOptimization)
178192
static let wmo =
@@ -236,21 +250,28 @@ extension KnownCommand {
236250
.experimentalSkipAllFunctionBodies,
237251
.experimentalSkipNonInlinableFunctionBodies,
238252
.experimentalSkipNonInlinableFunctionBodiesWithoutTypes,
253+
.enableUpcomingFeature,
254+
.disableExperimentalFeature,
255+
.disableUpcomingFeature,
239256
.F,
240257
.Fsystem,
241258
.I,
242259
.nostdimport,
243260
.O,
244261
.Onone,
262+
.libraryLevel,
245263
.moduleName,
264+
.moduleAbiName,
246265
.moduleLinkName,
247266
.packageName,
248267
.parseAsLibrary,
249268
.parseStdlib,
250269
.runtimeCompatibilityVersion,
251270
.target,
252271
.sdk,
272+
.strictMemorySafety,
253273
.swiftVersion,
274+
.warnImplicitOverrides,
254275
.wholeModuleOptimization,
255276
.wmo,
256277
.Xcc,

utils/swift-xcodegen/Sources/SwiftXcodeGen/Generator/ClangTarget.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct ClangTarget {
3131
}
3232

3333
extension RepoBuildDir {
34-
func getCSourceFilePaths(for path: RelativePath) throws -> [RelativePath] {
35-
try getAllRepoSubpaths(of: path).filter(\.isCSourceLike)
34+
func getClangSourceFilePaths(for path: RelativePath) throws -> [RelativePath] {
35+
try getAllRepoSubpaths(of: path).filter(\.isClangSource)
3636
}
3737

3838
func getHeaderFilePaths(for path: RelativePath) throws -> [RelativePath] {
@@ -45,7 +45,7 @@ extension RepoBuildDir {
4545
let path = target.path
4646
let name = target.name
4747

48-
let sourcePaths = try getCSourceFilePaths(for: path)
48+
let sourcePaths = try getClangSourceFilePaths(for: path)
4949
let headers = try getHeaderFilePaths(for: path)
5050
if sourcePaths.isEmpty && headers.isEmpty {
5151
return nil

0 commit comments

Comments
 (0)