summaryrefslogtreecommitdiffstats
path: root/Source/cmake.h
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/cmake.h
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/cmake.h')
-rw-r--r--Source/cmake.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmake.h b/Source/cmake.h
index 2f7f7bd..6b585a1 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -638,13 +638,20 @@ public:
cmMakefileProfilingData& GetProfilingOutput();
bool IsProfilingEnabled() const;
- template <typename... Args>
cm::optional<cmMakefileProfilingData::RAII> CreateProfilingEntry(
- Args&&... args)
+ const std::string& category, const std::string& name)
+ {
+ return this->CreateProfilingEntry(
+ category, name, []() -> cm::nullopt_t { return cm::nullopt; });
+ }
+
+ template <typename ArgsFunc>
+ cm::optional<cmMakefileProfilingData::RAII> CreateProfilingEntry(
+ const std::string& category, const std::string& name, ArgsFunc&& argsFunc)
{
if (this->IsProfilingEnabled()) {
return cm::make_optional<cmMakefileProfilingData::RAII>(
- this->GetProfilingOutput(), std::forward<Args>(args)...);
+ this->GetProfilingOutput(), category, name, argsFunc());
}
return cm::nullopt;
}