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 <joerg.bornemann@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
This commit is contained in:
Amir Masoud Abdol 2023-06-16 08:51:52 +02:00
parent a452e22546
commit 331f316b91

View File

@ -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()