diff options
author | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2006-06-16 17:44:50 +0000 |
---|---|---|
committer | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2006-06-16 17:44:50 +0000 |
commit | 5ba0735d92fa10234e81c24d2157cd1c3771c37b (patch) | |
tree | f0d13bae4fac3438d1a29d3cd964c859aff938f1 /src | |
parent | 760de60a50beffd524d1e8dd4997055c8bc0f010 (diff) | |
download | cpptasks-parallel-5ba0735d92fa10234e81c24d2157cd1c3771c37b.tar.gz cpptasks-parallel-5ba0735d92fa10234e81c24d2157cd1c3771c37b.tar.bz2 cpptasks-parallel-5ba0735d92fa10234e81c24d2157cd1c3771c37b.tar.xz cpptasks-parallel-5ba0735d92fa10234e81c24d2157cd1c3771c37b.zip |
Added flag to disable linking with CPP
Diffstat (limited to 'src')
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/CCTask.java | 6 | ||||
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/compiler/LinkType.java | 11 | ||||
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java | 20 |
3 files changed, 29 insertions, 8 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java index d4b0db2..60f7883 100644 --- a/src/net/sf/antcontrib/cpptasks/CCTask.java +++ b/src/net/sf/antcontrib/cpptasks/CCTask.java @@ -1072,6 +1072,12 @@ public class CCTask extends Task { public void setLink(OutputTypeEnum outputType) { linkType.setOutputType(outputType); } + +// FREEHEP added method to link with cpp + public void setLinkCPP(boolean linkCPP) { + linkType.setLinkCPP(linkCPP); + } + /** * Enables or disables generation of multithreaded code * diff --git a/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java b/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java index 31348f2..2ab5380 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java @@ -27,6 +27,9 @@ public class LinkType { private OutputTypeEnum outputType = new OutputTypeEnum(); private boolean staticRuntime = false; private SubsystemEnum subsystem = new SubsystemEnum(); +// FREEHEP + private boolean linkCPP = true; + /** * Constructor * @@ -156,6 +159,14 @@ public class LinkType { return subsystem.getValue(); } + public void setLinkCPP(boolean linkCPP) { + this.linkCPP = linkCPP; + } + + public boolean linkCPP() { + return linkCPP; + } + // FREEHEP: flag public boolean callAddLibrarySets = false; } diff --git a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java index 6248e00..c8d1da0 100644 --- a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java +++ b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java @@ -72,16 +72,20 @@ public class GppLinker extends AbstractLdLinker { args.addElement("-mwindows"); } } - if (linkType.isStaticRuntime()) { - String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"}; - String[] cmdout = CaptureStreamHandler.run(cmdin); - if (cmdout.length > 0) { - runtimeLibrary = cmdout[0]; +// FREEHEP, avoid stdc++ if requested + runtimeLibrary = null; + if (linkType.linkCPP()) { + if (linkType.isStaticRuntime()) { + String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"}; + String[] cmdout = CaptureStreamHandler.run(cmdin); + if (cmdout.length > 0) { + runtimeLibrary = cmdout[0]; + } else { + runtimeLibrary = null; + } } else { - runtimeLibrary = null; + runtimeLibrary = "-lstdc++"; } - } else { - runtimeLibrary = "-lstdc++"; } // FREEHEP: set flag linkType.callAddLibrarySets = true; |