diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LibrariesToLinkCollector.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LibrariesToLinkCollector.java index 764f16e7a0af6d..3abdaedd248554 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LibrariesToLinkCollector.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LibrariesToLinkCollector.java @@ -607,9 +607,9 @@ private void addDynamicInputLinkOptions( // -l:foo -> foo.so // -l:libfoo.so.1 -> libfoo.so.1 boolean hasCompatibleName = - name.startsWith("lib") || (!name.endsWith(".so") && !name.endsWith(".dylib")); + name.startsWith("lib") || (!name.endsWith(".so") && !name.endsWith(".dylib") && !name.endsWith(".dll")); if (CppFileTypes.SHARED_LIBRARY.matches(name) && hasCompatibleName) { - String libName = name.replaceAll("(^lib|\\.(so|dylib)$)", ""); + String libName = name.replaceAll("(^lib|\\.(so|dylib|dll)$)", ""); librariesToLink.addValue(LibraryToLinkValue.forDynamicLibrary(libName)); } else if (CppFileTypes.SHARED_LIBRARY.matches(name) || CppFileTypes.VERSIONED_SHARED_LIBRARY.matches(name)) {