diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2020-12-03 19:13:08 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2020-12-07 14:26:07 +0000 |
commit | 61d5b019727dd1c06366205cb307a2a928a2a29c (patch) | |
tree | 6ccb276787f1a5161db957b1aeae963864fbabb2 /cmake/QtSetup.cmake | |
parent | 886db3a2f3600d15ceb2447c9502f20ce9b3f000 (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/QtSetup.cmake')
-rw-r--r-- | cmake/QtSetup.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 56684e7e02..a77a1795b9 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -125,6 +125,12 @@ else() set(__build_benchmarks OFF) endif() +# Build Benchmarks +option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks}) +if(QT_BUILD_BENCHMARKS) + set(_qt_build_tests_default ON) +endif() + ## Set up testing option(QT_BUILD_TESTS "Build the testing tree." ${_qt_build_tests_default}) unset(_qt_build_tests_default) @@ -157,9 +163,6 @@ enable_testing() option(QT_BUILD_EXAMPLES "Build Qt examples" OFF) option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON) -# Build Benchmarks -option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks}) - ## Find host tools (if non native): set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.") |