summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-18 17:45:10 +0000
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-18 17:45:10 +0000
commit1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd (patch)
treef37f39b22381dcd0168c62bd342dbcfde0a0ccfd
parent5ff88e6b18d4cf6ee9a3869b9ff994d83ee96636 (diff)
downloadcpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.gz
cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.bz2
cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.xz
cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.zip
More fixes for NARPLUGIN-123
-rw-r--r--PATCHES2
-rw-r--r--src/net/sf/antcontrib/cpptasks/CCTask.java18
2 files changed, 17 insertions, 3 deletions
diff --git a/PATCHES b/PATCHES
index 009bd01..91ab611 100644
--- a/PATCHES
+++ b/PATCHES
@@ -18,7 +18,7 @@
** Parallel running change
- [src/net/sf/antcontrib/cpptasks/CCTask.java] fork of a process per core/cpu available.
-- [src/net/sf/antcontrib/cpptasks/TargetHistoryTable.java] protect againts multi-threaded updates.
+- [src/net/sf/antcontrib/cpptasks/TargetHistoryTable.java] protect against multi-threaded updates.
- [src/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java] replaced /Zi flag with /Z7 to disable writing debug database file (.pdb).
** -fno-rtti changes
diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java
index d7a7b43..5375420 100644
--- a/src/net/sf/antcontrib/cpptasks/CCTask.java
+++ b/src/net/sf/antcontrib/cpptasks/CCTask.java
@@ -175,6 +175,8 @@ public class CCTask extends Task {
return targetsByConfig;
}
+// FREEHEP
+ private int maxCores = 0;
/** The compiler definitions. */
private Vector _compilers = new Vector();
/** The output file type. */
@@ -739,8 +741,10 @@ public class CCTask extends Task {
//
// BEGINFREEHEP
-// int noOfCores = Runtime.getRuntime().availableProcessors();
-int noOfCores = 1;
+ int noOfCores = Runtime.getRuntime().availableProcessors();
+ if (maxCores > 0) {
+ noOfCores = Math.min(maxCores, noOfCores);
+ }
int noOfFiles = targetsForConfig.size();
if (noOfFiles < noOfCores) noOfCores = targetsForConfig.size();
@@ -1558,6 +1562,16 @@ int noOfCores = 1;
public void setWarnings(WarningLevelEnum level) {
compilerDef.setWarnings(level);
}
+
+// BEGINFREEHEP
+ public void setMaxCores(int maxCores) {
+ this.maxCores = maxCores;
+ }
+
+ public int getMaxCores() {
+ return maxCores;
+ }
+// ENDFREEHEP
/**
* Indicates whether the build will continue even if there are compilation