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/GccLinker.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/GccLinker.java')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java | 42 |
1 files changed, 37 insertions, 5 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 88a3bed..30d9ce6 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java @@ -36,17 +36,22 @@ public class GccLinker extends GnuLinker { "-static", "-shared", "-symbolic", "-Xlinker", "--export-all-symbols", "-static-libgcc", "-static-libstdc++",}; - private static final GccLinker dllLinker = new GccLinker("gcc", objFiles, - discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles, discardFiles, "lib", ".so", true, null)); - 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 instance = new GccLinker("gcc", objFiles, discardFiles, "", "", false, null); private static final GccLinker clangInstance = new GccLinker("clang", objFiles, discardFiles, "", "", false, null); private static final GccLinker xcodeClangInstance = new GccLinker(clangInstance, true); + private static final GccLinker dllLinker = new GccLinker("gcc", objFiles, + discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles, discardFiles, "lib", ".so", true, null)); + 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 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, + discardFiles, "lib", ".a", false, new GccLinker("clang", objFiles, discardFiles, "lib", ".a", true, null)); + private static final GccLinker machBundleLinker = new GccLinker("gcc", objFiles, discardFiles, "lib", ".bundle", false, null); private static final GccLinker machClangBundleLinker = new GccLinker("clang", @@ -59,6 +64,12 @@ public class GccLinker extends GnuLinker { objFiles, discardFiles, "lib", ".dylib", false, null); private static final GccLinker xcodeMachDllClangLinker = new GccLinker(machDllClangLinker, true); + private static final GccLinker machArLinker = new GccLinker("gcc", + objFiles, discardFiles, "lib", ".a", false, null); + private static final GccLinker machArClangLinker = new GccLinker("clang", + objFiles, discardFiles, "lib", ".a", false, null); + private static final GccLinker xcodeMachArClangLinker = new GccLinker(machArClangLinker, true); + public static GccLinker getInstance() { return instance; } @@ -91,6 +102,14 @@ public class GccLinker extends GnuLinker { return dllClangLinker; } @Override + protected final GnuLinker getStaticArLinker() { + return arLinker; + } + @Override + protected final GnuLinker getStaticArClangLinker() { + return arClangLinker; + } + @Override protected final GnuLinker getStaticClangInstance() { return clangInstance; } @@ -123,6 +142,19 @@ public class GccLinker extends GnuLinker { return xcodeMachDllClangLinker; } @Override + protected final GnuLinker getStaticMachArLinker() { + return machArLinker; + } + @Override + protected final GnuLinker getStaticMachArClangLinker() { + return machArClangLinker; + } + @Override + protected final GnuLinker getStaticXcodeMachArClangLinker() { + return xcodeMachArClangLinker; + } + + @Override protected final GnuLinker getStaticInstance() { return instance; } |