From 640f84cd14d0e8ec9ae80cccd88b3343962968bb Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 9 Jul 2020 09:41:12 -0400 Subject: [PATCH] Fix #710, allow setting of processor ID in targets.cmake Add support for a TGTx_PROCESSOR_ID directive, which allows one to set the default value returned by CFE_PSP_GetProcessorId() function, rather than assuming the index value from CMake. --- cmake/target/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/target/CMakeLists.txt b/cmake/target/CMakeLists.txt index 35935cb4a..309981d78 100644 --- a/cmake/target/CMakeLists.txt +++ b/cmake/target/CMakeLists.txt @@ -40,7 +40,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # The CPU ID and name are defined by the build scripts for this target if (DEFINED TGTID) - add_definitions(-DCFE_CPU_ID_VALUE=${TGTID}) + if (DEFINED TGT${TGTID}_PROCESSORID) + add_definitions(-DCFE_CPU_ID_VALUE=${TGT${TGTID}_PROCESSORID}) + else() + add_definitions(-DCFE_CPU_ID_VALUE=${TGTID}) + endif() endif() if (DEFINED SPACECRAFT_ID) add_definitions(-DCFE_SPACECRAFT_ID_VALUE=${SPACECRAFT_ID})