Browse Source

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)
Eduard Voronkin 2 months ago
parent
commit
0e54dc9589
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/cmLocalFastbuildGenerator.cxx

+ 3 - 0
Source/cmLocalFastbuildGenerator.cxx

@@ -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;