From 17d8b54cbc0a9ef507808d19733b2a753717a0dd Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 16 Jun 2020 18:10:58 +0200 Subject: CMake: Fix usage of qt_process_qlalr when cross compiling qtremoteobjects has a tool that uses qt_process_qlalr. The function doesn't have a check to see if the consuming target is an imported target, to skip doing any work when corss compiling. Fix it, like we do in qt_extend_target. Change-Id: Ide389a371aa07225f08689d15125c04d8b0e3916 Reviewed-by: Joerg Bornemann --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 036a291725..c82b33ab8b 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -5090,6 +5090,12 @@ endfunction() # 'input_file_list' is a list of 'foo.g' file paths. # 'flags' are extra flags to be passed to qlalr. function(qt_process_qlalr consuming_target input_file_list flags) + # Don't try to extend_target when cross compiling an imported host target (like a tool). + qt_is_imported_target("${consuming_target}" is_imported) + if(is_imported) + return() + endif() + foreach(input_file ${input_file_list}) file(STRINGS ${input_file} input_file_lines) qt_qlalr_find_option_in_list("${input_file_lines}" "^%parser(.+)" "parser") -- cgit v1.2.3