From b833ebdbbe47d3a4190612e95fd5e7fc250445bd Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Tue, 1 Dec 2009 00:06:43 +0100 Subject: Fixed NAR-56 --- .../apache/maven/plugin/nar/NarCompileMojo.java | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java') diff --git a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java index e447b59..ddf1407 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java @@ -29,6 +29,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.LinkerDef; import net.sf.antcontrib.cpptasks.OutputTypeEnum; import net.sf.antcontrib.cpptasks.RuntimeType; @@ -184,15 +185,32 @@ public class NarCompileMojo runtimeType.setValue( getRuntime( getAOL() ) ); task.setRuntime( runtimeType ); + int noOfCompilers = 0; + // add C++ compiler - task.addConfiguredCompiler( getCpp().getCompiler( type, getOutput( getAOL() ) ) ); + CompilerDef cpp = getCpp().getCompiler( type, getOutput( getAOL() ) ); + if ( cpp != null ) + { + task.addConfiguredCompiler( cpp ); + noOfCompilers++; + } // add C compiler - task.addConfiguredCompiler( getC().getCompiler( type, getOutput( getAOL() ) ) ); + CompilerDef c = getC().getCompiler( type, getOutput( getAOL() ) ); + if ( c != null ) + { + task.addConfiguredCompiler( c ); + noOfCompilers++; + } // add Fortran compiler - task.addConfiguredCompiler( getFortran().getCompiler( type, getOutput( getAOL() ) ) ); - + CompilerDef fortran = getFortran().getCompiler( type, getOutput( getAOL() ) ); + if ( fortran != null ) + { + task.addConfiguredCompiler( fortran ); + noOfCompilers++; + } + // add javah include path File jniDirectory = getJavah().getJniDirectory(); if ( jniDirectory.exists() ) -- cgit v1.2.3