diff options
author | Sven Gothel <[email protected]> | 2013-09-12 01:57:45 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-09-12 01:57:45 +0200 |
commit | 2cdd1070056c0f7e9dc7f40de19c2bfdfef0432a (patch) | |
tree | aacbd861bf10565505e710ce693bf2e3cbc35e3b /src/main/java/net/sf/antcontrib/cpptasks/gcc | |
parent | 2603158cb1a0ff29f5a23de4c0ba2ce759f574cf (diff) |
Add 'clang' and 'clang++' support (compiler/linker)
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/gcc')
3 files changed, 33 insertions, 3 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java index ba88d46..fb831e1 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java @@ -33,7 +33,7 @@ import net.sf.antcontrib.cpptasks.OptimizationEnum; /** * Adapter for the GCC C/C++ compiler * - * @author Adam Murdoch + * @author Adam Murdoch, et.al. */ public final class GccCCompiler extends GccCompatibleCCompiler { private final static String[] sourceExtensions = new String[]{".c", /* C */ @@ -67,6 +67,14 @@ public final class GccCCompiler extends GccCompatibleCCompiler { sourceExtensions, headerExtensions, false, new GccCCompiler("gcc", sourceExtensions, headerExtensions, true, null, false, null), false, null); + private static final GccCCompiler clangInstance = new GccCCompiler("clang", + sourceExtensions, headerExtensions, false, + new GccCCompiler("clang", sourceExtensions, headerExtensions, true, + null, false, null), false, null); + private static final GccCCompiler cpplangInstance = new GccCCompiler("clang++", + sourceExtensions, headerExtensions, false, + new GccCCompiler("clang++", sourceExtensions, headerExtensions, true, + null, false, null), false, null); /** * Gets c++ adapter */ @@ -91,6 +99,18 @@ public final class GccCCompiler extends GccCompatibleCCompiler { public static GccCCompiler getInstance() { return instance; } + /** + * Gets clang adapter + */ + public static GccCCompiler getCLangInstance() { + return clangInstance; + } + /** + * Gets clang++ adapter + */ + public static GccCCompiler getCPPLangInstance() { + return cpplangInstance; + } private String identifier; private File[] includePath; private boolean isPICMeaningful = true; 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 c1e9786..f02dd64 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java @@ -26,7 +26,7 @@ import net.sf.antcontrib.cpptasks.compiler.Linker; /** * Adapter for the GCC linker * - * @author Adam Murdoch + * @author Adam Murdoch, et.al. */ public class GccLinker extends AbstractLdLinker { private static final String[] discardFiles = new String[0]; @@ -44,6 +44,8 @@ public class GccLinker extends AbstractLdLinker { 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 machBundleLinker = new GccLinker("gcc", objFiles, discardFiles, "lib", ".bundle", false, null); private static final GccLinker machDllLinker = new GccLinker("gcc", @@ -51,6 +53,9 @@ public class GccLinker extends AbstractLdLinker { public static GccLinker getInstance() { return instance; } + public static GccLinker getCLangInstance() { + return clangInstance; + } private File[] libDirs; protected GccLinker(String command, String[] extensions, String[] ignoredExtensions, String outputPrefix, diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java index f3bc174..4dfe771 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java @@ -27,7 +27,7 @@ import net.sf.antcontrib.cpptasks.types.LibrarySet; /** * Adapter for the g++ variant of the GCC linker * - * @author Stephen M. Webb <[email protected]> + * @author Stephen M. Webb <[email protected]>, et.al. */ public class GppLinker extends AbstractLdLinker { protected static final String[] discardFiles = new String[0]; @@ -44,6 +44,8 @@ public class GppLinker extends AbstractLdLinker { "-prebind", "-s", "-static", "-shared", "-symbolic", "-Xlinker"}; private static final GppLinker instance = new GppLinker("gcc", objFiles, discardFiles, "", "", false, null); + private static final GppLinker clangInstance = new GppLinker("clang", objFiles, + discardFiles, "", "", false, null); private static final GppLinker machDllLinker = new GppLinker("gcc", objFiles, discardFiles, "lib", ".dylib", false, null); private static final GppLinker machPluginLinker = new GppLinker("gcc", @@ -51,6 +53,9 @@ public class GppLinker extends AbstractLdLinker { public static GppLinker getInstance() { return instance; } + public static GppLinker getCLangInstance() { + return clangInstance; + } private File[] libDirs; private String runtimeLibrary; protected GppLinker(String command, String[] extensions, |