Add ClangBuildAnalyzer under utils/health for analyzing build times

This commit is contained in:
mj-xmr 2020-11-01 09:36:10 +01:00 committed by wowario
parent eb6469b7a5
commit a76c6b9cae
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111
5 changed files with 171 additions and 0 deletions

View file

@ -54,6 +54,13 @@ if (USE_CCACHE)
else()
message(STATUS "ccache deselected")
endif()
option (USE_COMPILATION_TIME_PROFILER "Use compilation time profiler (for CLang >= 9 only)" OFF)
if (USE_COMPILATION_TIME_PROFILER)
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message(FATAL_ERROR "The flag USE_COMPILATION_TIME_PROFILER is meant to be set only for CLang compiler!")
endif()
add_compile_options("-ftime-trace")
endif()
# Job pool feature requires Ninja.
if (${CMAKE_VERSION} VERSION_GREATER "3.0.0")