diff options
author | Sven Gothel <[email protected]> | 2019-12-12 07:32:37 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-12-12 07:32:37 +0100 |
commit | 8353e0cc85705ca8f81f8563ad975026978b6745 (patch) | |
tree | 8354b68b79250fd8ef00a0aa88b1805cf1bbaa79 /src/main/java/net | |
parent | 07aeed47e484bfec85e749ea721756b8a2571e00 (diff) |
CommandLineLinker: 'g++' is also the GnuLinker (and not clang), hence isGCC -> isGNU
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java | 12 | ||||
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java index 8ed0b2f..05392bd 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java @@ -54,7 +54,7 @@ public abstract class CommandLineLinker extends AbstractLinker private final CommandLineLinker libtoolLinker; private final boolean newEnvironment = false; private final String outputSuffix; - private final boolean isGCC; + private final boolean isGNU; private final boolean isCLANG; @@ -73,7 +73,7 @@ public abstract class CommandLineLinker extends AbstractLinker this.isLibtool = isLibtool; this.isXcoderun = isXCoderun; this.libtoolLinker = libtoolLinker; - isGCC = "gcc".equals(command); + isGNU = "gcc".equals(command) || "g++".equals(command); isCLANG = "clang".equals(command); } public CommandLineLinker(final CommandLineLinker ld, final boolean isXCoderun) { @@ -84,7 +84,7 @@ public abstract class CommandLineLinker extends AbstractLinker this.isLibtool = ld.isLibtool; this.isXcoderun = isXCoderun; this.libtoolLinker = ld.libtoolLinker; - isGCC = "gcc".equals(command); + isGNU = "gcc".equals(command) || "g++".equals(command); isCLANG = "clang".equals(command); } protected abstract void addBase(long base, Vector args); @@ -256,8 +256,8 @@ public abstract class CommandLineLinker extends AbstractLinker protected final boolean isXcodeRun() { return isXcoderun; } - protected final boolean isGCC() { - return isGCC; + protected final boolean isGNU() { + return isGNU; } protected final boolean isCLANG() { return isCLANG; @@ -335,7 +335,7 @@ public abstract class CommandLineLinker extends AbstractLinker final String[] preargs = config.getPreArguments(); final String[] endargs = config.getEndArguments(); final String outputSwitch[] = getOutputFileSwitch(task, outputFile); - final boolean writeSONAME = task.getWriteSONAME() && task.isSharedLibrary() && ( isGCC || isCLANG ); + final boolean writeSONAME = task.getWriteSONAME() && task.isSharedLibrary() && ( isGNU || isCLANG ); int allArgsCount = preargs.length + 1 + outputSwitch.length + sourceFiles.length + endargs.length + ( writeSONAME ? 1 : 0 ); diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java index 2e4e29b..f6d477f 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java @@ -127,26 +127,26 @@ public abstract class GnuLinker extends AbstractLdLinker { } if (type.isStaticLibrary()) { if (isDarwin()) { - return isGCC() ? getStaticMachArLinker() : ( isXcodeRun() ? getStaticXcodeMachArClangLinker() : getStaticMachArClangLinker() ); + return isGNU() ? getStaticMachArLinker() : ( isXcodeRun() ? getStaticXcodeMachArClangLinker() : getStaticMachArClangLinker() ); } else { - return isGCC() ? getStaticArLinker() : getStaticArClangLinker(); + return isGNU() ? getStaticArLinker() : getStaticArClangLinker(); } } if (type.isPluginModule()) { if (isDarwin()) { - return isGCC() ? getStaticMachBundleLinker() : ( isXcodeRun() ? getStaticXcodeMachClangBundleLinker() : getStaticMachClangBundleLinker() ); + return isGNU() ? getStaticMachBundleLinker() : ( isXcodeRun() ? getStaticXcodeMachClangBundleLinker() : getStaticMachClangBundleLinker() ); } else { - return isGCC() ? getStaticDllLinker() : getStaticDllClangLinker(); + return isGNU() ? getStaticDllLinker() : getStaticDllClangLinker(); } } if (type.isSharedLibrary()) { if (isDarwin()) { - return isGCC() ? getStaticMachDllLinker() : ( isXcodeRun() ? getStaticXcodeMachDllClangLinker() : getStaticMachDllClangLinker() ); + return isGNU() ? getStaticMachDllLinker() : ( isXcodeRun() ? getStaticXcodeMachDllClangLinker() : getStaticMachDllClangLinker() ); } else { - return isGCC() ? getStaticDllLinker() : getStaticDllClangLinker(); + return isGNU() ? getStaticDllLinker() : getStaticDllClangLinker(); } } - return isGCC() ? getStaticInstance() : ( isXcodeRun() ? getStaticXcodeClangInstance() : getStaticClangInstance() ) ; + return isGNU() ? getStaticInstance() : ( isXcodeRun() ? getStaticXcodeClangInstance() : getStaticClangInstance() ) ; } }
\ No newline at end of file |