Skip to content

Commit

Permalink
DLL name stripping support for libraries built in Windows using GCC
Browse files Browse the repository at this point in the history
.dll has to be stripped to enable linkage with DLL created by GCC in Windows
  • Loading branch information
vvviktor authored Feb 8, 2024
1 parent 67ffe04 commit 0ae8ebf
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,9 @@ private void addDynamicInputLinkOptions(
// -lfoo -> libfoo.so
// -l:foo -> foo.so
// -l:libfoo.so.1 -> libfoo.so.1
boolean hasCompatibleName =
name.startsWith("lib") || (!name.endsWith(".so") && !name.endsWith(".dylib"));
boolean hasCompatibleName = 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)) {
Expand Down

0 comments on commit 0ae8ebf

Please sign in to comment.