summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInternals
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2020-12-03 19:13:08 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2020-12-07 14:26:07 +0000
commit61d5b019727dd1c06366205cb307a2a928a2a29c (patch)
tree6ccb276787f1a5161db957b1aeae963864fbabb2 /cmake/QtBuildInternals
parent886db3a2f3600d15ceb2447c9502f20ce9b3f000 (diff)
CMake: Add extra targets to run single benchmark using CMake generator
Add custom targets with '_benchmark' suffixes to make run of benchmarks using generators possible, e.g.: $ ninja tst_bench_qudpsocket_benchmark Extend '-[no]make' option to pass benchmark. Rework '-[no]make' processing to unify these options processing. Also looks like it doesn't make sense to enable benchmarks without having test enabled. So '-DQT_BUILD_BENCHMARKS' enables test as own dependency automatically. Task-number: QTBUG-89076 Pick-to: 6.0 Change-Id: Ieee9eadaf6d75a1efec120242d6eb786ace1b071 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuildInternals')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 7aebfb04db..d9e4eb85ef 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -335,6 +335,12 @@ macro(qt_build_repo_begin)
add_custom_target(host_tools)
add_custom_target(bootstrap_tools)
endif()
+
+ # Add benchmark meta target. It's collection of all benchmarks added/registered by
+ # 'qt_internal_add_benchmark' helper.
+ if(NOT TARGET benchmark)
+ add_custom_target(benchmark)
+ endif()
endmacro()
macro(qt_build_repo_end)