mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
cmGlobalGhsMultiGenerator: Simplify relative path conversion logic
Our call to `MaybeConvertToRelativePath` uses paths that always pass the "maybe" checks. Use `ForceToRelativePath` directly.
This commit is contained in:
@@ -375,7 +375,7 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout,
|
||||
}
|
||||
|
||||
void cmGlobalGhsMultiGenerator::WriteProjectLine(
|
||||
std::ostream& fout, cmGeneratorTarget const* target, cmLocalGenerator* root,
|
||||
std::ostream& fout, cmGeneratorTarget const* target,
|
||||
std::string& rootBinaryDir)
|
||||
{
|
||||
cmProp projName = target->GetProperty("GENERATOR_FILE_NAME");
|
||||
@@ -383,7 +383,7 @@ void cmGlobalGhsMultiGenerator::WriteProjectLine(
|
||||
if (projName && projType) {
|
||||
cmLocalGenerator* lg = target->GetLocalGenerator();
|
||||
std::string dir = lg->GetCurrentBinaryDirectory();
|
||||
dir = root->MaybeConvertToRelativePath(rootBinaryDir, dir);
|
||||
dir = cmSystemTools::ForceToRelativePath(rootBinaryDir, dir);
|
||||
if (dir == ".") {
|
||||
dir.clear();
|
||||
} else {
|
||||
@@ -433,7 +433,7 @@ void cmGlobalGhsMultiGenerator::WriteTargets(cmLocalGenerator* root)
|
||||
target->GetName(), "] had a cycle.\n"));
|
||||
} else {
|
||||
for (auto& tgt : build) {
|
||||
this->WriteProjectLine(fbld, tgt, root, rootBinaryDir);
|
||||
this->WriteProjectLine(fbld, tgt, rootBinaryDir);
|
||||
}
|
||||
}
|
||||
fbld.Close();
|
||||
@@ -490,7 +490,7 @@ void cmGlobalGhsMultiGenerator::WriteAllTarget(
|
||||
target->GetType() == cmStateEnums::SHARED_LIBRARY) {
|
||||
continue;
|
||||
}
|
||||
this->WriteProjectLine(fbld, target, root, rootBinaryDir);
|
||||
this->WriteProjectLine(fbld, target, rootBinaryDir);
|
||||
}
|
||||
}
|
||||
fbld.Close();
|
||||
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
void WriteSubProjects(std::ostream& fout, std::string& all_target);
|
||||
void WriteTargets(cmLocalGenerator* root);
|
||||
void WriteProjectLine(std::ostream& fout, cmGeneratorTarget const* target,
|
||||
cmLocalGenerator* root, std::string& rootBinaryDir);
|
||||
std::string& rootBinaryDir);
|
||||
void WriteCustomRuleBOD(std::ostream& fout);
|
||||
void WriteCustomTargetBOD(std::ostream& fout);
|
||||
void WriteAllTarget(cmLocalGenerator* root,
|
||||
|
||||
Reference in New Issue
Block a user