Skip to content

Conversation

@egorzhdan
Copy link
Contributor

This is a counterpart to swiftlang/swift#84816.

rdar://159211965

@egorzhdan egorzhdan requested review from Xazax-hun and j-hui November 7, 2025 20:02
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan requested a review from artemcm November 7, 2025 20:04
public static let emitClangHeaderMinAccess: Option = Option("-emit-clang-header-min-access", .separate, attributes: [.frontend, .noInteractive, .argumentIsPath, .cacheInvariant], metaVar: "<access-level>", helpText: "The minimum access level of declarations to include in the emitted header.>")
public static let emitClangHeaderNonmodularIncludes: Option = Option("-emit-clang-header-nonmodular-includes", .flag, attributes: [.frontend, .noInteractive, .supplementaryOutput], helpText: "Augment emitted Objective-C header with textual imports for every included modular import")
public static let emitClangHeaderPath: Option = Option("-emit-clang-header-path", .separate, alias: Option.emitObjcHeaderPath, attributes: [.frontend, .noInteractive, .argumentIsPath, .supplementaryOutput, .cacheInvariant], helpText: "Emit an Objective-C and C++ header file to <path>")
public static let emitClangHeaderMinAccess: Option = Option("-emit-clang-header-min-access", .separate, attributes: [.frontend, .noInteractive, .cacheInvariant], metaVar: "<access-level>", helpText: "The minimum access level of declarations to include in the emitted header")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case: please ensure Options.swift is updated as follows:
https://github.com/swiftlang/swift-driver?tab=readme-ov-file#rebuilding-optionsswift

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I somehow missed that this file is generated. Thanks!

try commandLine.appendLast(.clangBuildSessionFile, from: &parsedOptions)
}

try commandLine.appendLast(.emitClangHeaderMinAccess, from: &parsedOptions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a check to ensure we don't pass this flag to a compiler which does not support it.

Suggested change
try commandLine.appendLast(.emitClangHeaderMinAccess, from: &parsedOptions)
if isFrontendArgSupported(.emitClangHeaderMinAccess) {
try commandLine.appendLast(.emitClangHeaderMinAccess, from: &parsedOptions)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@egorzhdan egorzhdan force-pushed the egorzhdan/clang-access-flag branch from 45ac397 to b5fdd40 Compare November 7, 2025 23:51
Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@egorzhdan egorzhdan force-pushed the egorzhdan/clang-access-flag branch from b5fdd40 to 051e803 Compare November 7, 2025 23:53
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants