mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
@@ -7,6 +7,7 @@ Perform the :ref:`CTest Build Step` as a :ref:`Dashboard Client`.
|
|||||||
|
|
||||||
ctest_build([BUILD <build-dir>] [APPEND]
|
ctest_build([BUILD <build-dir>] [APPEND]
|
||||||
[CONFIGURATION <config>]
|
[CONFIGURATION <config>]
|
||||||
|
[PARALLEL_LEVEL <parallel>]
|
||||||
[FLAGS <flags>]
|
[FLAGS <flags>]
|
||||||
[PROJECT_NAME <project-name>]
|
[PROJECT_NAME <project-name>]
|
||||||
[TARGET <target-name>]
|
[TARGET <target-name>]
|
||||||
@@ -42,6 +43,13 @@ The options are:
|
|||||||
Otherwise the ``-C <cfg>`` option given to the :manual:`ctest(1)`
|
Otherwise the ``-C <cfg>`` option given to the :manual:`ctest(1)`
|
||||||
command will be used, if any.
|
command will be used, if any.
|
||||||
|
|
||||||
|
``PARALLEL_LEVEL <parallel>``
|
||||||
|
.. versionadded:: 3.21
|
||||||
|
|
||||||
|
Specify the parallel level of the underlying build system. If not
|
||||||
|
specified, the :envvar:`CMAKE_BUILD_PARALLEL_LEVEL` environment
|
||||||
|
variable will be checked.
|
||||||
|
|
||||||
``FLAGS <flags>``
|
``FLAGS <flags>``
|
||||||
Pass additional arguments to the underlying build command.
|
Pass additional arguments to the underlying build command.
|
||||||
If not specified the ``CTEST_BUILD_FLAGS`` variable will be checked.
|
If not specified the ``CTEST_BUILD_FLAGS`` variable will be checked.
|
||||||
|
@@ -2,3 +2,5 @@ generate-cmake-build-command-parallel
|
|||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
* The :command:`build_command` command gained a ``PARALLEL_LEVEL`` option.
|
* The :command:`build_command` command gained a ``PARALLEL_LEVEL`` option.
|
||||||
|
|
||||||
|
* The :command:`ctest_build` command gained a ``PARALLEL_LEVEL`` option.
|
||||||
|
@@ -27,6 +27,7 @@ void cmCTestBuildCommand::BindArguments()
|
|||||||
this->Bind("CONFIGURATION"_s, this->Configuration);
|
this->Bind("CONFIGURATION"_s, this->Configuration);
|
||||||
this->Bind("FLAGS"_s, this->Flags);
|
this->Bind("FLAGS"_s, this->Flags);
|
||||||
this->Bind("PROJECT_NAME"_s, this->ProjectName);
|
this->Bind("PROJECT_NAME"_s, this->ProjectName);
|
||||||
|
this->Bind("PARALLEL_LEVEL"_s, this->ParallelLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCTestBuildCommand::~cmCTestBuildCommand() = default;
|
cmCTestBuildCommand::~cmCTestBuildCommand() = default;
|
||||||
@@ -98,7 +99,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
|||||||
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
|
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
|
||||||
std::string buildCommand =
|
std::string buildCommand =
|
||||||
this->GlobalGenerator->GenerateCMakeBuildCommand(
|
this->GlobalGenerator->GenerateCMakeBuildCommand(
|
||||||
cmakeBuildTarget, cmakeBuildConfiguration, "",
|
cmakeBuildTarget, cmakeBuildConfiguration, this->ParallelLevel,
|
||||||
cmakeBuildAdditionalFlags, this->Makefile->IgnoreErrorsCMP0061());
|
cmakeBuildAdditionalFlags, this->Makefile->IgnoreErrorsCMP0061());
|
||||||
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||||
"SetMakeCommand:" << buildCommand << "\n",
|
"SetMakeCommand:" << buildCommand << "\n",
|
||||||
|
@@ -60,4 +60,5 @@ protected:
|
|||||||
std::string Configuration;
|
std::string Configuration;
|
||||||
std::string Flags;
|
std::string Flags;
|
||||||
std::string ProjectName;
|
std::string ProjectName;
|
||||||
|
std::string ParallelLevel;
|
||||||
};
|
};
|
||||||
|
11
Tests/RunCMake/ctest_build/ParallelLevel-check.cmake
Normal file
11
Tests/RunCMake/ctest_build/ParallelLevel-check.cmake
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
|
||||||
|
if(build_xml_file)
|
||||||
|
file(STRINGS "${build_xml_file}" build_cmd LIMIT_COUNT 1 REGEX "<BuildCommand>")
|
||||||
|
if(NOT build_cmd MATCHES [[ --parallel "1"]])
|
||||||
|
set(RunCMake_TEST_FAILED
|
||||||
|
"Build.xml does not have expected build command with --parallel flag"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(RunCMake_TEST_FAILED "Build.xml not found")
|
||||||
|
endif()
|
@@ -10,6 +10,7 @@ function(run_ctest_build CASE_NAME)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
run_ctest_build(BuildQuiet QUIET)
|
run_ctest_build(BuildQuiet QUIET)
|
||||||
|
run_ctest_build(ParallelLevel PARALLEL_LEVEL 1)
|
||||||
|
|
||||||
function(run_BuildFailure)
|
function(run_BuildFailure)
|
||||||
set(CASE_CMAKELISTS_SUFFIX_CODE [[
|
set(CASE_CMAKELISTS_SUFFIX_CODE [[
|
||||||
|
Reference in New Issue
Block a user