Skip to content

Commit

Permalink
HOTFIX: confirm that MISSION_DIR is set for all dependencies
Browse files Browse the repository at this point in the history
Adding a subdirectory with an empty/undefined string is interpreted
as the current directory, which ends up triggering an infinite loop.

This can occur if the variables/lists were modified in an unexpected
manner.
  • Loading branch information
jphickey committed Jul 8, 2020
1 parent 4bb29b7 commit 7b93466
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,22 @@ function(process_arch SYSVAR)
if (NOT INSTALL_SUBDIR)
set(INSTALL_SUBDIR cf)
endif (NOT INSTALL_SUBDIR)


# confirm that all dependencies have a MISSION_DIR defined that indicates the source.
# This should have been set up by the parent script. However, if any dir is not set,
# this may result in "add_subdirectory" of itself which causes a loop. This can happen
# if the variables/lists were modified unexpectedly.
foreach(DEP
${MISSION_CORE_MODULES}
${TGTSYS_${SYSVAR}_PSPMODULES}
${TGTSYS_${SYSVAR}_STATICAPPS}
${TGTSYS_${SYSVAR}_APPS})
if(NOT DEFINED ${DEP}_MISSION_DIR)
message(FATAL_ERROR "ERROR: core module ${DEP} has no MISSION_DIR defined")
endif()
endforeach()


# Add all core modules
# The osal is handled explicitly (above) since this has special extra config
foreach(DEP ${MISSION_CORE_MODULES})
Expand Down

0 comments on commit 7b93466

Please sign in to comment.