summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-11-10 23:15:08 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-11-11 16:45:00 (GMT)
commit553794e98706800a8c792bbcd81d49522333a50f (patch)
tree168b7b2625b4673d77c60089926df96ed70442af /Source/cmMakefile.cxx
parent31893e8c8f580d6a94fc70b85e8cae47300cc6c0 (diff)
downloadCMake-553794e98706800a8c792bbcd81d49522333a50f.zip
CMake-553794e98706800a8c792bbcd81d49522333a50f.tar.gz
CMake-553794e98706800a8c792bbcd81d49522333a50f.tar.bz2
cmake::CreateProfilingEntry: Refactor to take lambda for args
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2091f27..db8f785 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -376,7 +376,20 @@ public:
this->Makefile->ExecutionStatusStack.push_back(&status);
#if !defined(CMAKE_BOOTSTRAP)
this->ProfilingDataRAII =
- this->Makefile->GetCMakeInstance()->CreateProfilingEntry(lff, lfc);
+ this->Makefile->GetCMakeInstance()->CreateProfilingEntry(
+ "script", lff.LowerCaseName(), [&lff, &lfc]() -> Json::Value {
+ Json::Value argsValue = Json::objectValue;
+ if (!lff.Arguments().empty()) {
+ std::string args;
+ for (auto const& a : lff.Arguments()) {
+ args = cmStrCat(args, args.empty() ? "" : " ", a.Value);
+ }
+ argsValue["functionArgs"] = args;
+ }
+ argsValue["location"] =
+ cmStrCat(lfc.FilePath, ':', std::to_string(lfc.Line));
+ return argsValue;
+ });
#endif
}