1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 17:31:57 +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:
Tyler Yankee
2025-07-08 12:53:43 -04:00
committed by Brad King
parent 7dbe092d77
commit 455944508e

View File

@@ -612,12 +612,12 @@ std::string cmInstrumentation::ComputeSuffixTime()
}
/*
* Called by ctest --start-instrumentation as part of the START_INSTRUMENTATION
* rule when using the Ninja generator.
* This creates a detached process which waits for the Ninja process to die
* before running the postBuild hook. In this way, the postBuild hook triggers
* after every ninja invocation, regardless of whether the build passed or
* failed.
* Called by ctest --start-instrumentation.
*
* This creates a detached process which waits for the parent process (i.e.,
* the build system) to die before running the postBuild hook. In this way, the
* postBuild hook triggers after every invocation of the build system,
* regardless of whether the build passed or failed.
*/
int cmInstrumentation::SpawnBuildDaemon()
{
@@ -630,13 +630,13 @@ int cmInstrumentation::SpawnBuildDaemon()
// postBuild Hook
if (this->HasHook(cmInstrumentationQuery::Hook::PostBuild)) {
auto ninja_pid = uv_os_getppid();
if (ninja_pid) {
auto ppid = uv_os_getppid();
if (ppid) {
std::vector<std::string> args;
args.push_back(cmSystemTools::GetCTestCommand());
args.push_back("--wait-and-collect-instrumentation");
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 chain = builder.Start();
uv_run(&chain.GetLoop(), UV_RUN_DEFAULT);