From 8a8ac31b9734f846a1bccc0f1a85b651775f61b9 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 23 Sep 2020 11:10:48 -0400 Subject: [PATCH] Fix #906, Update variable checks in read_targetconfig This was using "DEFINED" to check if these variables were set. Problem discovered is that this is always true because "SIMULATION" is a cache var set from an environment variable, so it ALWAYS defined, it is just empty if not being used. Fix is to use if (SIMULATION) rather than if (DEFINED SIMULATION) which should only be true if the string is not empty, as intended. --- cmake/global_functions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index eada7699d..6c5b437f2 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -185,10 +185,10 @@ function(read_targetconfig) endwhile() foreach(CPUNAME ${MISSION_CPUNAMES}) - if (DEFINED SIMULATION) + if (SIMULATION) # if simulation use simulation system architecture for all targets set(TOOLCHAIN_NAME "${SIMULATION}") - elseif (DEFINED ${CPUNAME}_SYSTEM) + elseif (${CPUNAME}_SYSTEM) # get the target system arch identifier string set(TOOLCHAIN_NAME "${${CPUNAME}_SYSTEM}") else()