diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2019-02-02 09:06:36 (GMT) |
---|---|---|
committer | Wouter Klouwen <wouter.klouwen@youview.com> | 2020-03-07 13:36:27 (GMT) |
commit | 9aa4640792bd99b232abfe826b0cb0ae72f6644a (patch) | |
tree | 6d576cb085d48a0073ddc09036a7e1a2b95df2d6 /Source/cmake.h | |
parent | 8f122b45570e8357886df115d78007c4ea437daa (diff) | |
download | CMake-9aa4640792bd99b232abfe826b0cb0ae72f6644a.zip CMake-9aa4640792bd99b232abfe826b0cb0ae72f6644a.tar.gz CMake-9aa4640792bd99b232abfe826b0cb0ae72f6644a.tar.bz2 |
cmake: add command line options to output script profiling data
For users of CMake who want to optimize their scripts if they take a
while to run, this commit adds the ability to output profiling data.
To enable this output, it adds the two command line parameters
to select the output path and format.
This commit adds the first profiling format of type ``google-trace``,
which is the output is a JSON file containing Duration events as per the
Google Trace Format specification:
https://docs.google.com/document/d/1CvAClvFfyA5R-
PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#
Diffstat (limited to 'Source/cmake.h')
-rw-r--r-- | Source/cmake.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmake.h b/Source/cmake.h index 35425ec..58769fd 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -34,6 +34,9 @@ class cmFileTimeCache; class cmGlobalGenerator; class cmGlobalGeneratorFactory; class cmMakefile; +#if !defined(CMAKE_BOOTSTRAP) +class cmMakefileProfilingData; +#endif class cmMessenger; class cmVariableWatch; struct cmDocumentationEntry; @@ -549,6 +552,11 @@ public: bool GetRegenerateDuringBuild() const { return this->RegenerateDuringBuild; } +#if !defined(CMAKE_BOOTSTRAP) + cmMakefileProfilingData& GetProfilingOutput(); + bool IsProfilingEnabled() const; +#endif + protected: void RunCheckForUnusedVariables(); int HandleDeleteCacheVariables(const std::string& var); @@ -657,6 +665,10 @@ private: void AppendGlobalGeneratorsDocumentation(std::vector<cmDocumentationEntry>&); void AppendExtraGeneratorsDocumentation(std::vector<cmDocumentationEntry>&); + +#if !defined(CMAKE_BOOTSTRAP) + std::unique_ptr<cmMakefileProfilingData> ProfilingOutput; +#endif }; #define CMAKE_STANDARD_OPTIONS_TABLE \ |