mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #79278 from compnerd/modular
This commit is contained in:
@@ -560,15 +560,26 @@ void GetWindowsFileMappings(
|
|||||||
fileMapping.redirectedFiles.emplace_back(std::string(VCToolsInjection),
|
fileMapping.redirectedFiles.emplace_back(std::string(VCToolsInjection),
|
||||||
AuxiliaryFile);
|
AuxiliaryFile);
|
||||||
|
|
||||||
// __msvc_bit_utils.hpp was added in a recent VS 2022 version. It has to be
|
// Because we wish to be backwrds compatible with older Visual Studio
|
||||||
// referenced from the modulemap directly to avoid modularization errors.
|
// releases, we inject empty headers which allow us to have definitions for
|
||||||
// Older VS versions might not have it. Let's inject an empty header file if
|
// modules referencing headers which may not exist. We stub out the headers
|
||||||
// it isn't available.
|
// with empty files to allow a single module definition to work across
|
||||||
llvm::sys::path::remove_filename(VCToolsInjection);
|
// different MSVC STL releases.
|
||||||
llvm::sys::path::append(VCToolsInjection, "__msvc_bit_utils.hpp");
|
//
|
||||||
if (!llvm::sys::fs::exists(VCToolsInjection))
|
// __msvc_bit_utils.hpp was introduced in VS 2022 STL release 17.8.
|
||||||
fileMapping.overridenFiles.emplace_back(std::string(VCToolsInjection),
|
// __msvc_string_view.hpp was introduced in VS 2022 STL release 17.11.
|
||||||
"");
|
static const char * const kInjectedHeaders[] = {
|
||||||
|
"__msvc_bit_utils.hpp",
|
||||||
|
"__msvc_string_view.hpp",
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const char * const header : kInjectedHeaders) {
|
||||||
|
llvm::sys::path::remove_filename(VCToolsInjection);
|
||||||
|
llvm::sys::path::append(VCToolsInjection, header);
|
||||||
|
if (!llvm::sys::fs::exists(VCToolsInjection))
|
||||||
|
fileMapping.overridenFiles.emplace_back(std::string{VCToolsInjection},
|
||||||
|
"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -707,6 +707,11 @@ module std [system] {
|
|||||||
export *
|
export *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit module __msvc_string_view {
|
||||||
|
header "__msvc_string_view.hpp"
|
||||||
|
export *
|
||||||
|
}
|
||||||
|
|
||||||
explicit module xatomic {
|
explicit module xatomic {
|
||||||
header "xatomic.h"
|
header "xatomic.h"
|
||||||
export *
|
export *
|
||||||
|
|||||||
Reference in New Issue
Block a user