From 331f316b91c49ee53638053ff8a9bc14517f17d9 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Fri, 16 Jun 2023 08:51:52 +0200 Subject: [PATCH] Disable TRY_RUN when cross compiling Fixes: QTBUG-114625 Pick-to: 6.5.2 6.5 6.6 Change-Id: Idec5ea438ebf3f88d63da7d956ab52e2a0fa1821 Reviewed-by: Joerg Bornemann Reviewed-by: Samuli Piippo --- cmake/QtToolHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index ac46687fb9b..4fa51169cda 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -18,7 +18,7 @@ # TRY_RUN # On Windows, it creates a helper batch script that tests whether the tool can be executed # successfully or not. If not, build halts and an error will be show, with tips on what -# might be cause, and how to fix it. +# might be cause, and how to fix it. TRY_RUN is disabled when cross-compiling. # TRY_RUN_FLAGS # Command line flags that are going to be passed to the tool for testing its correctness. # If no flags were given, we default to `-v`. @@ -233,7 +233,7 @@ function(qt_internal_add_tool target_name) qt_internal_apply_staging_prefix_build_rpath_workaround() endif() - if(arg_TRY_RUN AND WIN32) + if(arg_TRY_RUN AND WIN32 AND NOT CMAKE_CROSSCOMPILING) if(NOT arg_TRY_RUN_FLAGS) set(arg_TRY_RUN_FLAGS "-v") endif()