Skip to content

Commit

Permalink
Fix nasa#652, cmake-based OSAL config
Browse files Browse the repository at this point in the history
Rather than CFE generating an osconfig.h file directly, it just
needs to select file(s) from the defs directory and pass them
to OSAL for the config.
  • Loading branch information
jphickey committed Apr 29, 2020
1 parent 3c616f2 commit 566868f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,18 @@ endfunction(cfs_app_do_install)
#
function(prepare)

# Generate the "osconfig.h" wrapper file as indicated by the configuration
# If specific system config options were not specified, use defaults
if (NOT OSAL_SYSTEM_OSCONFIG)
set(OSAL_SYSTEM_OSCONFIG default)
endif (NOT OSAL_SYSTEM_OSCONFIG)
generate_config_includefile("inc/osconfig.h" osconfig.h ${OSAL_SYSTEM_OSCONFIG} ${TARGETSYSTEM})
# Choose the configuration file to use for OSAL on this system
set(OSAL_CONFIGURATION_FILE)
if (EXISTS "${MISSION_DEFS}/default_osconfig.cmake")
list(APPEND OSAL_CONFIGURATION_FILE "${MISSION_DEFS}/default_osconfig.cmake")
endif()
if (DEFINED OSAL_SYSTEM_OSCONFIG AND EXISTS "${MISSION_DEFS}/${OSAL_SYSTEM_OSCONFIG}_osconfig.cmake")
list(APPEND OSAL_CONFIGURATION_FILE "${MISSION_DEFS}/${OSAL_SYSTEM_OSCONFIG}_osconfig.cmake")
endif()
if (EXISTS "${MISSION_DEFS}/${TARGETSYSTEM}_osconfig.cmake")
list(APPEND OSAL_CONFIGURATION_FILE "${MISSION_DEFS}/${TARGETSYSTEM}_osconfig.cmake")
endif()
set(OSAL_CONFIGURATION_FILE ${OSAL_CONFIGURATION_FILE} PARENT_SCOPE)

# Allow sources to "ifdef" certain things if running on simulated hardware
# This should be used sparingly, typically to fake access to hardware that is not present
Expand Down

0 comments on commit 566868f

Please sign in to comment.