Skip to content

Commit

Permalink
Fix #629, Define BSP type in sample config
Browse files Browse the repository at this point in the history
Also removes overwrite of CFE_SYSTEM_PSPNAME,
OSAL_SYTEM_BSPTYPE, OSAL_SYSTEM_OSTYPE if one
is missing from arch_build.cmake.
  • Loading branch information
skliper committed Apr 21, 2020
1 parent 0648a47 commit c478107
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
20 changes: 5 additions & 15 deletions cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,22 +271,12 @@ function(prepare)
if (SIMULATION)
add_definitions(-DSIMULATION=${SIMULATION})
endif (SIMULATION)

# Check that PSPNAME, BSPTYPE, and OSTYPE are set properly for this arch
if (NOT CFE_SYSTEM_PSPNAME OR NOT OSAL_SYSTEM_OSTYPE)
if (CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "Cross-compile toolchain ${CMAKE_TOOLCHAIN_FILE} must define CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE")
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR
"${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
# Export the variables determined here up to the parent scope
SET(CFE_SYSTEM_PSPNAME "pc-linux" PARENT_SCOPE)
SET(OSAL_SYSTEM_BSPTYPE "pc-linux" PARENT_SCOPE)
SET(OSAL_SYSTEM_OSTYPE "posix" PARENT_SCOPE)
else ()
# Not cross compiling and host system is not recognized
message(FATAL_ERROR "Do not know how to set CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE on ${CMAKE_SYSTEM_NAME} system")
endif()
endif (NOT CFE_SYSTEM_PSPNAME OR NOT OSAL_SYSTEM_OSTYPE)
if (NOT CFE_SYSTEM_PSPNAME OR NOT OSAL_SYSTEM_OSTYPE OR NOT OSAL_SYSTEM_BSPTYPE)
message("NOTE: CFE_SYSTEM_PSPNAME=\"${CFE_SYSTEM_PSPNAME}\", OSAL_SYSTEM_OSTYPE=\"${OSAL_SYSTEM_OSTYPE}\", OSAL_SYSTEM_BSPTYPE=\"${OSAL_SYSTEM_BSPTYPE}\"")
message(FATAL_ERROR "All three settings above must be defined in toolchain, currently using ${CMAKE_TOOLCHAIN_FILE}")
endif ()

# Truncate the global TGTSYS_LIST to be only the target architecture
set(TGTSYS_LIST ${TARGETSYSTEM} PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-cpu1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
# These variable settings are specific to cFE/OSAL and determines which
# abstraction layers are built when using this toolchain
SET(CFE_SYSTEM_PSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPTYPE "pc-linux")
SET(OSAL_SYSTEM_OSTYPE "posix")

2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-cpu2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
# These variable settings are specific to cFE/OSAL and determines which
# abstraction layers are built when using this toolchain
SET(CFE_SYSTEM_PSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPTYPE "pc-linux")
SET(OSAL_SYSTEM_OSTYPE "posix")

2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-cpu3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
# These variable settings are specific to cFE/OSAL and determines which
# abstraction layers are built when using this toolchain
SET(CFE_SYSTEM_PSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPTYPE "pc-linux")
SET(OSAL_SYSTEM_OSTYPE "posix")

0 comments on commit c478107

Please sign in to comment.