diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-03-23 17:33:13 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-04-04 15:41:20 +0200 |
commit | c926ef55de345d224195225cb997796ea8749137 (patch) | |
tree | a2ccd68f5017bd2252f43ad33e6b485e80162e92 /cmake | |
parent | 2061cea0f38e1eaae26fca1a04fdf6d9473a47d0 (diff) |
CMake: Allow passing -v to ninja when building examples as EPs
By default when building ExternalProjects, even if the main ninja
invocation has -v passed, that won't be passed to the nested ninja
calls.
When building examples in the CI, we want to see the full command line
invocations.
Allow passing -v to the nested EP ninja calls by configuring Qt with
-DQT_INTERNAL_VERBOSE_EXAMPLES=ON, which we will use in our CI.
We don't want to add -v by default because if the main ninja does not
have one, the nested calls will still be verbose.
Pick-to: 6.2 6.3
Change-Id: Ifd4b312c6eaa7354e8870f4fb0a77fadf0f33ab7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index e05d922b16..1a05a563b1 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -1139,6 +1139,12 @@ function(qt_internal_add_example_external_project subdir) set(example_install_prefix "${qt_example_install_prefix}/${example_rel_path}") set(ep_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}") + + set(build_command "") + if(QT_INTERNAL_VERBOSE_EXAMPLES AND CMAKE_GENERATOR MATCHES "Ninja") + set(build_command BUILD_COMMAND "${CMAKE_COMMAND}" --build "." -- -v) + endif() + ExternalProject_Add(${arg_NAME} EXCLUDE_FROM_ALL TRUE SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}" @@ -1147,6 +1153,7 @@ function(qt_internal_add_example_external_project subdir) BINARY_DIR "${ep_binary_dir}" INSTALL_DIR "${example_install_prefix}" INSTALL_COMMAND "" + ${build_command} TEST_COMMAND "" DEPENDS ${deps} CMAKE_CACHE_ARGS ${var_defs} |