mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
instrumentation: Remove ninja-specific references
Amend commit 314440c320
(instrumentation: Run preBuild and postBuild
hooks before and after make, 2025-02-05) to make comments and variables
names in `cmInstrumentation` agnostic to the build system being used.
This commit is contained in:
@@ -612,12 +612,12 @@ std::string cmInstrumentation::ComputeSuffixTime()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called by ctest --start-instrumentation as part of the START_INSTRUMENTATION
|
* Called by ctest --start-instrumentation.
|
||||||
* rule when using the Ninja generator.
|
*
|
||||||
* This creates a detached process which waits for the Ninja process to die
|
* This creates a detached process which waits for the parent process (i.e.,
|
||||||
* before running the postBuild hook. In this way, the postBuild hook triggers
|
* the build system) to die before running the postBuild hook. In this way, the
|
||||||
* after every ninja invocation, regardless of whether the build passed or
|
* postBuild hook triggers after every invocation of the build system,
|
||||||
* failed.
|
* regardless of whether the build passed or failed.
|
||||||
*/
|
*/
|
||||||
int cmInstrumentation::SpawnBuildDaemon()
|
int cmInstrumentation::SpawnBuildDaemon()
|
||||||
{
|
{
|
||||||
@@ -630,13 +630,13 @@ int cmInstrumentation::SpawnBuildDaemon()
|
|||||||
|
|
||||||
// postBuild Hook
|
// postBuild Hook
|
||||||
if (this->HasHook(cmInstrumentationQuery::Hook::PostBuild)) {
|
if (this->HasHook(cmInstrumentationQuery::Hook::PostBuild)) {
|
||||||
auto ninja_pid = uv_os_getppid();
|
auto ppid = uv_os_getppid();
|
||||||
if (ninja_pid) {
|
if (ppid) {
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
args.push_back(cmSystemTools::GetCTestCommand());
|
args.push_back(cmSystemTools::GetCTestCommand());
|
||||||
args.push_back("--wait-and-collect-instrumentation");
|
args.push_back("--wait-and-collect-instrumentation");
|
||||||
args.push_back(this->binaryDir);
|
args.push_back(this->binaryDir);
|
||||||
args.push_back(std::to_string(ninja_pid));
|
args.push_back(std::to_string(ppid));
|
||||||
auto builder = cmUVProcessChainBuilder().SetDetached().AddCommand(args);
|
auto builder = cmUVProcessChainBuilder().SetDetached().AddCommand(args);
|
||||||
auto chain = builder.Start();
|
auto chain = builder.Start();
|
||||||
uv_run(&chain.GetLoop(), UV_RUN_DEFAULT);
|
uv_run(&chain.GetLoop(), UV_RUN_DEFAULT);
|
||||||
|
Reference in New Issue
Block a user