This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 4cbf56e98c7c3ad3365350bd7ef9314263bb8862 (commit)
via 84ccd4f7461ac2c2ee471a4d77f3e184c676c276 (commit)
from 564c9c7b888fdfb156ed5b71de6172a032720c81 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cbf56e98c7c3ad3365350bd7ef9314263bb8862
commit 4cbf56e98c7c3ad3365350bd7ef9314263bb8862
Merge: 564c9c7 84ccd4f
Author: Alexander Neundorf
AuthorDate: Tue Feb 23 16:45:28 2016 -0500
Commit: CMake Topic Stage
CommitDate: Tue Feb 23 16:45:28 2016 -0500
Merge topic 'CodeBlocksParallelFlag' into next
84ccd4f7 CodeBlocks: generate parallel project files (make -j)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84ccd4f7461ac2c2ee471a4d77f3e184c676c276
commit 84ccd4f7461ac2c2ee471a4d77f3e184c676c276
Author: Alex Neundorf
AuthorDate: Tue Feb 23 22:37:44 2016 +0100
Commit: Alex Neundorf
CommitDate: Tue Feb 23 22:37:44 2016 +0100
CodeBlocks: generate parallel project files (make -j)
This is done the same way as for Eclipse: cmake tries to determine
the number of CPUs, and then adds the respective -jN to the make
invocations in the project file.
Alex
diff --git a/Modules/CMakeFindCodeBlocks.cmake
b/Modules/CMakeFindCodeBlocks.cmake
index f8d8d59..bf85ea0 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -23,3 +23,18 @@ endif()
# Determine builtin macros and include dirs:
include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+
+# Try to find out how many CPUs we have and set the -j argument for make
accordingly
+set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS "")
+
+include(ProcessorCount)
+processorcount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
+
+# Only set -j if we are under UNIX and if the make-tool used actually has
"make" in the name
+# (we may also get here in the future e.g. for ninja)
+if("${_CMAKE_CODEBLOCKS_PROCESSOR_COUNT}" GREATER 1 AND CMAKE_HOST_UNIX AND
"${CMAKE_MAKE_PROGRAM}" MATCHES make)
+ set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS
"-j${_CMAKE_CODEBLOCKS_PROCESSOR_COUNT}")
+endif()
+
+# This variable is used by the CodeBlocks generator and appended to the make
invocation commands.
+set(CMAKE_CODEBLOCKS_MAKE_ARGUMENTS "${_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS}"
CACHE STRING "Additional command line arguments when CodeBlocks invokes make.
Enter e.g. -j to get parallel builds")
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx
b/Source/cmExtraCodeBlocksGenerator.cxx
index 9348ef2..19f99ba 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -300,6 +300,8 @@ void cmExtraCodeBlocksGenerator
// figure out the compiler
std::string compiler = this->GetCBCompilerId(mf);
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ const std::string makeArgs = mf->GetSafeDefinition(
+"CMAKE_CODEBLOCKS_MAKE_ARGUMENTS");
fout<<"\n"
"\n"
@@ -311,7 +313,8 @@ void cmExtraCodeBlocksGenerator
" "<AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
+ this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str(),
+ makeArgs);
// add all executable and library targets and some of the GLOBAL
// and UTILITY targets
@@ -333,7 +336,8 @@ void cmExtraCodeBlocksGenerator
(*lg)->GetBinaryDirectory())==0)
{
this->AppendTarget(fout, targetName, 0,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(),
+ makeArgs);
}
}
break;
@@ -350,7 +354,7 @@ void cmExtraCodeBlocksGenerator
}
this->AppendTarget(fout, targetName, 0,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(),makeArgs);
break;
case cmState::EXECUTABLE:
case cmState::STATIC_LIBRARY:
@@ -360,11 +364,11 @@ void cmExtraCodeBlocksGenerator
{
cmGeneratorTarget* gt = *ti;
this->AppendTarget(fout, targetName, gt,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(), makeArgs);
std::string