Skip to content

Commit ca8d316

Browse files
committed
Define SWT_DOCC in the package based on environment variables
1 parent f3b39b9 commit ca8d316

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/pull_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ jobs:
2525
with:
2626
license_header_check_project_name: "Swift"
2727
docs_check_container_image: "swift:6.2-noble"
28-
docs_check_additional_arguments: "-DSWT_DOCC"
2928
format_check_enabled: false
3029
api_breakage_check_enabled: false

Package.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ let buildingForEmbedded: Bool = {
3636
return Bool(envvar) ?? ((Int(envvar) ?? 0) != 0)
3737
}()
3838

39+
/// Whether or not we appear to be building the package for the documentation
40+
/// soundness check we run in GitHub Actions.
41+
let buildingForDocumentationSoundnessCheck: Bool = {
42+
Context.environment["ADDITIONAL_DOCC_ARGUMENTS"] != nil
43+
}()
44+
3945
let package = Package(
4046
name: "swift-testing",
4147

@@ -389,6 +395,12 @@ extension Array where Element == PackageDescription.SwiftSetting {
389395
.define("SWT_NO_LIBDISPATCH", .whenEmbedded()),
390396
]
391397

398+
if buildingForDocumentationSoundnessCheck {
399+
result += [
400+
.define("SWT_DOCC", .whenEmbedded()),
401+
]
402+
}
403+
392404
return result
393405
}
394406

0 commit comments

Comments
 (0)