diff options
author | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2007-07-18 17:45:10 +0000 |
---|---|---|
committer | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2007-07-18 17:45:10 +0000 |
commit | 1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd (patch) | |
tree | f37f39b22381dcd0168c62bd342dbcfde0a0ccfd /src/net | |
parent | 5ff88e6b18d4cf6ee9a3869b9ff994d83ee96636 (diff) | |
download | cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.gz cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.bz2 cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.tar.xz cpptasks-parallel-1d5f29a06d4a04c92b6086b0f4f3076bd6e105bd.zip |
More fixes for NARPLUGIN-123
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/CCTask.java | 18 |
1 files changed, 16 insertions, 2 deletions
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 |