diff options
author | Sven Gothel <[email protected]> | 2019-06-15 14:18:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-06-15 14:18:22 +0200 |
commit | 6523322893a0f18cef7b45e693249e147721990e (patch) | |
tree | 9b35d616d0952eb814b53e4406da908b38a65289 /src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java | |
parent | bd21aded190bb92261e4a01acdfa8e1be2158474 (diff) |
Adding option 'usehighleveltool'
Adding option 'usehighleveltool', which gives preference to the higher level tool selection.
Default is false.
Currently 'usehighleveltool' is implemented for LinkType
operation to build a static library, i.e. 'outtype' target is 'static'.
If set to false (default), the default low level 'ar' librarian tool is being used.
If set to true, the high-level tool gcc, g++ or clang (w/ or w/o xcode's xcrun)
will be used to process the command.
This might have some advantages where xcode's clang may validate consistency
of the result, i.e. missing symbols etc.
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java index 3ee7f8e..f264cd9 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java @@ -59,24 +59,21 @@ public abstract class AbstractLdLinker extends CommandLineLinker { args.addElement("-g"); } if (isDarwin()) { - if (linkType.isPluginModule()) { + if (linkType.isStaticRuntime() || linkType.isStaticLibrary()) { + args.addElement("-static"); + } else if (linkType.isPluginModule()) { args.addElement("-bundle"); - } else { - if (linkType.isSharedLibrary()) { - // args.addElement("-prebind"); // Only required for OSX 10.3 and earlier, no auto-add (can add manually though) - args.addElement("-dynamiclib"); - } + } else if (linkType.isSharedLibrary()) { + // args.addElement("-prebind"); // Only required for OSX 10.3 and earlier, no auto-add (can add manually though) + args.addElement("-dynamic"); } } else { - if (linkType.isStaticRuntime()) { + if (linkType.isStaticRuntime() || linkType.isStaticLibrary()) { args.addElement("-static"); - } - if (linkType.isPluginModule()) { + } else if (linkType.isPluginModule()) { + args.addElement("-shared"); + } else if (linkType.isSharedLibrary()) { args.addElement("-shared"); - } else { - if (linkType.isSharedLibrary()) { - args.addElement("-shared"); - } } } } |