Sub CompilerInvocation should inherit '-D' when build swiftinterface to swiftmodule #64562
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
legacy driver
Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
swift 5.7
unexpected behavior
Bug: Unexpected behavior or incorrect output
Description
Compile a swift file which import swiftinterface file with not set -disable-implicit-swift-modules param, the swiftinterface file may import a clang module, the headers of clang module may has some logic depend on macros.
Because of sub CompilerInvocation did not inhert '-D' params when build swiftinterface file, ClangImporter will build clang module error.
'-D' means macros params, for example -Xcc -DDebug=1
Steps to reproduce
1、download SwiftIssue.zip
2、cd SwiftIssue
3、run build.sh in SwiftIssue
Expected behavior
compile success
Environment
SwiftIssue.zip
The text was updated successfully, but these errors were encountered: