From b46b894177208b00a850f760c03e34d88b56df05 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 10 Jan 2022 10:51:53 +0100 Subject: Fix multi config generator and add checks for configs,archs Fix typo config -> configs. Add checks for configs and archs, otherwise we silently do not set right dependencies and continue the build. This can end up in weird looking errors. Task-number: QTBUG-99511 Change-Id: Ief727033e7b3ac32ab9f42bd96babd9be97f63a6 Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 511d360d4f196d739975fbdfb80b99bfa4f4cc80) Reviewed-by: Qt Cherry-pick Bot --- cmake/Functions.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 3bdf86c83..95f279946 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -931,8 +931,14 @@ function(add_gn_build_aritfacts_to_target cmakeTarget ninjaTarget module buildDi # config loop is a workaround to be able to add_custom_command per config # note this is fixed in CMAKE.3.20 and should be cleaned up when 3.20 is # the minimum cmake we support - get_configs(config) + get_configs(configs) get_architectures(archs) + if(NOT configs) + message(FATAL_ERROR "No valid configurations found !") + endif() + if(NOT archs) + message(FATAL_ERROR "No valid architectures found. In case of cross-compiling make sure you have CMAKE_SYSTEM_PROCESSOR in your toolchain file.") + endif() foreach(config ${configs}) foreach(arch ${archs}) set(target ${ninjaTarget}_${config}_${arch}) -- cgit v1.2.3