summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/Linker.java30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/Linker.java b/src/main/java/org/apache/maven/plugin/nar/Linker.java
index dfdea08..810c540 100644
--- a/src/main/java/org/apache/maven/plugin/nar/Linker.java
+++ b/src/main/java/org/apache/maven/plugin/nar/Linker.java
@@ -200,10 +200,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "msvc" ) )
{
@@ -214,10 +210,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "icc" ) || name.equals( "icpc" ) )
{
@@ -228,10 +220,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "icl" ) )
{
@@ -242,15 +230,25 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out.toString() );
- }
+ }
+ else if ( name.equals( "CC" ) )
+ {
+ NarUtil.runCommand( "CC", new String[] { "-V" }, null, null, out, err, dbg );
+ Pattern p = Pattern.compile( "\\d+\\.d+" );
+ Matcher m = p.matcher( err.toString() );
+ if ( m.find() )
+ {
+ version = m.group( 0 );
+ }
}
else
{
throw new MojoFailureException( "Cannot find version number for linker '" + name + "'" );
}
+
+ if (version == null) {
+ throw new MojoFailureException( "Cannot deduce version number from: " + out.toString() );
+ }
return version;
}