From 3189c3b1ee0080d219487360cef204bd5f458ecd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 23 Jan 2023 10:01:35 +0100 Subject: GccLinker.dll[Clang]Linker: Support Windows hosts w/ NAME.dll target (default is libNAME.so) --- src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java index f9c51ef..e205102 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java @@ -47,6 +47,11 @@ public class GccLinker extends GnuLinker { private static final GccLinker dllClangLinker = new GccLinker("clang", objFiles, discardFiles, "lib", ".so", false, new GccLinker("clang", objFiles, discardFiles, "lib", ".so", true, null)); + private static final GccLinker dllWindowsLinker = new GccLinker("gcc", objFiles, + discardFiles, "", ".dll", false, new GccLinker("gcc", objFiles, discardFiles, "", ".dll", true, null)); + private static final GccLinker dllWindowsClangLinker = new GccLinker("clang", objFiles, + discardFiles, "", ".dll", false, new GccLinker("clang", objFiles, discardFiles, "", ".dll", true, null)); + private static final GccLinker arLinker = new GccLinker("gcc", objFiles, discardFiles, "lib", ".a", false, new GccLinker("gcc", objFiles, discardFiles, "lib", ".a", true, null)); private static final GccLinker arClangLinker = new GccLinker("clang", objFiles, @@ -95,11 +100,11 @@ public class GccLinker extends GnuLinker { @Override protected final GnuLinker getStaticDllLinker() { - return dllLinker; + return isWindows() ? dllWindowsLinker : dllLinker; } @Override protected final GnuLinker getStaticDllClangLinker() { - return dllClangLinker; + return isWindows() ? dllWindowsClangLinker : dllClangLinker; } @Override protected final GnuLinker getStaticArLinker() { -- cgit v1.2.3