mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ClangImporter: run Clang with a proper executable path
Clang deduces its installation directory from the `argv[0]` parameter (see clang/lib/Frontend/CreateInvocationFromCommandLine.cpp), and the default include search paths are computed based on the installation directory. This change allows compiling Swift code that imports the C++ stdlib without having to manually specify the include search path of `std` headers.
This commit is contained in:
@@ -597,6 +597,10 @@ namespace swift {
|
||||
/// Options for controlling the behavior of the Clang importer.
|
||||
class ClangImporterOptions final {
|
||||
public:
|
||||
/// The path to the Clang compiler executable.
|
||||
/// Used to detect the default include paths.
|
||||
std::string clangPath = "clang";
|
||||
|
||||
/// The module cache path which the Clang importer should use.
|
||||
std::string ModuleCachePath;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user