diff options
author | Brad King <brad.king@kitware.com> | 2022-10-28 14:03:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-10-28 14:04:01 (GMT) |
commit | 3469d53b3f9ddabe067044ed2cac92215fbe825c (patch) | |
tree | c6e67024b901046876630be4e028c47e7f63eb84 /Source/cmake.h | |
parent | 6b27854d268381cb8d29a500caa2ff3b4fe7da3c (diff) | |
parent | 0fe7aae91f6709c17d2d1b005f7fcac67930ff48 (diff) | |
download | CMake-3469d53b3f9ddabe067044ed2cac92215fbe825c.zip CMake-3469d53b3f9ddabe067044ed2cac92215fbe825c.tar.gz CMake-3469d53b3f9ddabe067044ed2cac92215fbe825c.tar.bz2 |
Merge topic 'extended-profiling'
0fe7aae91f cmake: Add profiling events for configure and generate
3d6a8d7eac cmMakefileProfilingData: Refactor to use RAII
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7828
Diffstat (limited to 'Source/cmake.h')
-rw-r--r-- | Source/cmake.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmake.h b/Source/cmake.h index 4e7bb54..2f7f7bd 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -33,6 +33,7 @@ # include <cm3p/json/value.h> # include "cmCMakePresetsGraph.h" +# include "cmMakefileProfilingData.h" #endif class cmExternalMakefileProjectGeneratorFactory; @@ -41,9 +42,6 @@ class cmFileTimeCache; class cmGlobalGenerator; class cmGlobalGeneratorFactory; class cmMakefile; -#if !defined(CMAKE_BOOTSTRAP) -class cmMakefileProfilingData; -#endif class cmMessenger; class cmVariableWatch; struct cmBuildOptions; @@ -639,6 +637,17 @@ public: #if !defined(CMAKE_BOOTSTRAP) cmMakefileProfilingData& GetProfilingOutput(); bool IsProfilingEnabled() const; + + template <typename... Args> + cm::optional<cmMakefileProfilingData::RAII> CreateProfilingEntry( + Args&&... args) + { + if (this->IsProfilingEnabled()) { + return cm::make_optional<cmMakefileProfilingData::RAII>( + this->GetProfilingOutput(), std::forward<Args>(args)...); + } + return cm::nullopt; + } #endif protected: |