From 436bc4b4a03faf616fac6fd6dbc3624b9afecbd0 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 1 Apr 2020 18:58:57 -0400 Subject: [PATCH] Fix #581, Propagate the OSAL compile definitions to CFE build Use the INTERFACE_COMPILE_DEFINITIONS and INTERFACE_INCLUDE_DIRECTORIES properties from the osal target and apply them to the entire CFE build. At this time, the OSAL library build does not use/export these properties so this is effectively a no-op for the CFE build and can be merged with no effect. However, in a future version, the OSAL library will export these interface properties and this will become important. --- cmake/arch_build.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index 9bceef696..3ca4bd343 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -339,6 +339,20 @@ function(process_arch SYSVAR) include_directories(${MISSION_SOURCE_DIR}/cfe/fsw/cfe-core/src/inc) include_directories(${MISSION_SOURCE_DIR}/cfe/cmake/target/inc) + # propagate any OSAL interface compile definitions and include directories to this build + # This is set as a directory property here at the top level so it will apply to all code. + # This includes MODULE libraries that do not directly/statically link with OSAL but still + # should be compiled with these flags. + get_target_property(OSAL_COMPILE_DEFINITIONS osal INTERFACE_COMPILE_DEFINITIONS) + get_target_property(OSAL_INCLUDE_DIRECTORIES osal INTERFACE_INCLUDE_DIRECTORIES) + + if (OSAL_COMPILE_DEFINITIONS) + set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${OSAL_COMPILE_DEFINITIONS}") + endif (OSAL_COMPILE_DEFINITIONS) + if (OSAL_INCLUDE_DIRECTORIES) + include_directories(${OSAL_INCLUDE_DIRECTORIES}) + endif (OSAL_INCLUDE_DIRECTORIES) + # Append the PSP and OSAL selections to the Doxyfile so it will be included # in the generated documentation automatically. # Also extract the "-D" options within CFLAGS and inform Doxygen about these