diff options
author | 2018-04-25 04:47:05 -0700 | |
---|---|---|
committer | 2018-04-25 04:48:52 -0700 | |
commit | 204dfe13ead529cb3ba852243aa677f6b5f7c9ee (patch) | |
tree | e62b7e1be3cddf11b208e58ed5bb36da94624ae6 /src/main/java/com/google/devtools/build/lib/rules | |
parent | b858ade7962ae2c967f224467fc8a59753a7c38b (diff) |
Make output name case-insensitive while calculating output names for object files
This change is due to Windows and macOS, where file paths are case-insensitive
RELNOTES:
PiperOrigin-RevId: 194223755
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java index 85516bc220..7389401859 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java @@ -1222,15 +1222,16 @@ public final class CcCompilationHelper { for (Artifact source : sourceArtifacts) { String outputName = FileSystemUtils.removeExtension(source.getRootRelativePath()).getBaseName(); - count.put(outputName, count.getOrDefault(outputName, 0) + 1); + count.put(outputName.toLowerCase(), + count.getOrDefault(outputName.toLowerCase(), 0) + 1); } for (Artifact source : sourceArtifacts) { String outputName = FileSystemUtils.removeExtension(source.getRootRelativePath()).getBaseName(); - if (count.getOrDefault(outputName, 0) > 1) { - int num = number.getOrDefault(outputName, 0); - number.put(outputName, num + 1); + if (count.getOrDefault(outputName.toLowerCase(), 0) > 1) { + int num = number.getOrDefault(outputName.toLowerCase(), 0); + number.put(outputName.toLowerCase(), num + 1); outputName = num + "/" + outputName; } // If prefixDir is set, prepend it to the outputName |