Create vcruntime.modulemap for use in Windows

This commit is contained in:
Vaibhav 2020-05-11 10:19:22 +05:30 committed by jenkins
parent e505c03038
commit 312b20edbf
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,14 @@
module "vcruntime" [system] {
requires windows
module "vcruntime.h" {
export *
header "vcruntime.h"
}
module "vcruntime_string.h" {
export *
header "vcruntime_string.h"
}
}

View File

@ -558,6 +558,9 @@ namespace {
clang::HeaderSearchOptions& HSOpts = CI.getHeaderSearchOpts(); clang::HeaderSearchOptions& HSOpts = CI.getHeaderSearchOpts();
// We can't use "assert.h" because it is defined in the resource dir, too. // We can't use "assert.h" because it is defined in the resource dir, too.
#ifdef LLVM_ON_WIN32
llvm::SmallString<256> vcIncLoc(getIncludePathForHeader(HS, "vcruntime.h"));
#endif
llvm::SmallString<128> cIncLoc(getIncludePathForHeader(HS, "time.h")); llvm::SmallString<128> cIncLoc(getIncludePathForHeader(HS, "time.h"));
llvm::SmallString<256> stdIncLoc(getIncludePathForHeader(HS, "cassert")); llvm::SmallString<256> stdIncLoc(getIncludePathForHeader(HS, "cassert"));
@ -646,6 +649,8 @@ namespace {
std::string MOverlay; std::string MOverlay;
#ifdef LLVM_ON_WIN32 #ifdef LLVM_ON_WIN32
maybeAppendOverlayEntry(vcIncLoc.str(), "vcruntime.modulemap",
clingIncLoc.str(), MOverlay);
maybeAppendOverlayEntry(cIncLoc.str(), "libc_msvc.modulemap", maybeAppendOverlayEntry(cIncLoc.str(), "libc_msvc.modulemap",
clingIncLoc.str(), MOverlay); clingIncLoc.str(), MOverlay);
maybeAppendOverlayEntry(stdIncLoc.str(), "std_msvc.modulemap", maybeAppendOverlayEntry(stdIncLoc.str(), "std_msvc.modulemap",