diff options
author | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2009-12-01 00:06:43 +0100 |
---|---|---|
committer | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2009-12-01 00:06:43 +0100 |
commit | b833ebdbbe47d3a4190612e95fd5e7fc250445bd (patch) | |
tree | e27fcb6d20a9e7b6b8e6fbf6d01302daab67ca6c /src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java | |
parent | 4b05392b710e7078582c85631a1e83f271894bda (diff) | |
download | maven-nar-plugin-b833ebdbbe47d3a4190612e95fd5e7fc250445bd.tar.gz maven-nar-plugin-b833ebdbbe47d3a4190612e95fd5e7fc250445bd.tar.bz2 maven-nar-plugin-b833ebdbbe47d3a4190612e95fd5e7fc250445bd.tar.xz maven-nar-plugin-b833ebdbbe47d3a4190612e95fd5e7fc250445bd.zip |
Fixed NAR-56
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java index 64eec84..5c2bd36 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java @@ -26,6 +26,7 @@ import java.util.List; import net.sf.antcontrib.cpptasks.CCTask; import net.sf.antcontrib.cpptasks.CUtil; +import net.sf.antcontrib.cpptasks.CompilerDef; import net.sf.antcontrib.cpptasks.OutputTypeEnum; import net.sf.antcontrib.cpptasks.RuntimeType; import net.sf.antcontrib.cpptasks.types.LibrarySet; @@ -105,14 +106,31 @@ public class NarTestCompileMojo runtimeType.setValue( getRuntime( getAOL() ) ); task.setRuntime( runtimeType ); + int noOfCompilers = 0; + // add C++ compiler - task.addConfiguredCompiler( getCpp().getCompiler( type, test.getName() ) ); + CompilerDef cpp = getCpp().getCompiler( type, test.getName() ); + if ( cpp != null ) + { + task.addConfiguredCompiler( cpp ); + noOfCompilers++; + } // add C compiler - task.addConfiguredCompiler( getC().getCompiler( type, test.getName() ) ); + CompilerDef c = getC().getCompiler( type, test.getName() ); + if ( c != null ) + { + task.addConfiguredCompiler( c ); + noOfCompilers++; + } // add Fortran compiler - task.addConfiguredCompiler( getFortran().getCompiler( type, test.getName() ) ); + CompilerDef fortran = getFortran().getCompiler( type, test.getName() ); + if ( fortran != null ) + { + task.addConfiguredCompiler( fortran ); + noOfCompilers++; + } // add java include paths getJava().addIncludePaths( task, type ); |