Skip to content

Commit

Permalink
Fix nasa#906, Update variable checks in read_targetconfig
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jphickey committed Sep 23, 2020
1 parent 983157d commit 8a8ac31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/global_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8a8ac31

Please sign in to comment.