From 1bd1b60f777ba44b50c9516d919705fbfacce943 Mon Sep 17 00:00:00 2001 From: Felix L <50841330+Felix-El@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:02:56 +0200 Subject: [PATCH] Also strip .dll extension to get the bare library name --- .../build/lib/rules/cpp/LibrariesToLinkCollector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) {