Skip to content

Commit e429bbf

Browse files
committed
fix swift modules
1 parent 81fa851 commit e429bbf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

metadata-generator/src/Umbrella.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static std::error_code CreateUmbrellaHeaderForAmbientModule(
6363

6464
std::ifstream file(moduleMapPath);
6565

66+
std::string basePathStr = basePath.string();
67+
addIncludePath(basePathStr, includePaths);
68+
6669
if (isFramework && std::find(frameworks.begin(), frameworks.end(),
6770
basePath) == frameworks.end()) {
6871
frameworks.push_back(basePath.string());
@@ -267,14 +270,14 @@ static std::error_code CreateUmbrellaHeaderForAmbientModules(
267270

268271
for (std::string arg : args) {
269272
if (arg.find("-fmodule-map-file=") == 0) {
270-
std::string moduleMapFile = arg.substr(20);
273+
std::string moduleMapFile = arg.substr(18);
271274
std::filesystem::path moduleMapPath(moduleMapFile);
272275
if (std::filesystem::exists(moduleMapPath)) {
273-
std::cerr << "Found module map arg: " << moduleMapPath.string()
274-
<< std::endl;
276+
std::cerr << "Found module map arg: " << moduleMapPath.string() << std::endl;
275277
if (std::error_code code = CreateUmbrellaHeaderForAmbientModule(moduleMapPath.parent_path(), false, moduleMapPath, umbrellaHeaders, includePaths, frameworks)) {
276278
return code;
277279
}
280+
std::cerr << "Added module map headers from: " << moduleMapPath.string() << std::endl;
278281
}
279282
}
280283
}

0 commit comments

Comments
 (0)