FASTBuild: fix relative paths to includes

When include path is the same as binary dir - `cmSystemTools::RelativePath`
returns an empty string which results into incorrect compiler option
(`-I` without anything afterwards)
This commit is contained in:
Eduard Voronkin
2025-09-23 11:19:30 -07:00
parent 9f190de849
commit 0e54dc9589

View File

@@ -106,6 +106,9 @@ std::string cmLocalFastbuildGenerator::ConvertToIncludeReference(
if (GG->UsingRelativePaths && cmSystemTools::FileIsFullPath(path)) {
std::string const& binDir =
GG->GetCMakeInstance()->GetHomeOutputDirectory();
if (binDir == converted) {
return ".";
}
return cmSystemTools::RelativePath(binDir, converted);
}
return converted;