From 2cdd1070056c0f7e9dc7f40de19c2bfdfef0432a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 12 Sep 2013 01:57:45 +0200 Subject: Add 'clang' and 'clang++' support (compiler/linker) --- .../sf/antcontrib/cpptasks/gcc/GccCCompiler.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java') 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; -- cgit v1.2.3