diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d601212..a6d904c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ target_include_directories(psp_module_api INTERFACE # Translate the CFE_PSP_TARGETNAME to a set of additional modules to build file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/fsw/${CFE_PSP_TARGETNAME}/psp_module_list.cmake" PSP_TARGET_MODULE_LIST REGEX "^[a-zA-Z]") +include("${CMAKE_CURRENT_LIST_DIR}/fsw/${CFE_PSP_TARGETNAME}/psp_conditional_modules.cmake" OPTIONAL) # The PSP is currently built in modular parts, consisting of a platform-specific # module(s) combined with a shared component which is built for multiple targets. @@ -72,4 +73,3 @@ if (ENABLE_UNIT_TESTS) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ut-stubs) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/unit-test-coverage) endif () - diff --git a/fsw/pc-rtems/psp_conditional_modules.cmake b/fsw/pc-rtems/psp_conditional_modules.cmake new file mode 100644 index 00000000..b559d224 --- /dev/null +++ b/fsw/pc-rtems/psp_conditional_modules.cmake @@ -0,0 +1,8 @@ +# The sysmon module only works in RTEMS >= 5. +# Ideally this check should be VERSION_GREATER_EQUAL 5, but that conditional does +# not exist in all versions of cmake. +if(CMAKE_SYSTEM_VERSION VERSION_GREATER 4.99) + + list(APPEND PSP_TARGET_MODULE_LIST rtems_sysmon) + +endif() \ No newline at end of file diff --git a/fsw/pc-rtems/psp_module_list.cmake b/fsw/pc-rtems/psp_module_list.cmake index ec59c6a7..f93fe1e6 100644 --- a/fsw/pc-rtems/psp_module_list.cmake +++ b/fsw/pc-rtems/psp_module_list.cmake @@ -1,5 +1,9 @@ # This is a list of modules that is included as a fixed/base set -# when this PSP is selected. They must exist under fsw/modules +# when this PSP is selected. They must exist under fsw/modules. + +# NOTE: This set is REQUIRED for all versions of the platform. +# If a module only works on some versions of the platform, add +# if to psp_conditional_modules.cmake instead soft_timebase timebase_posix_clock @@ -7,4 +11,3 @@ eeprom_notimpl ram_direct port_notimpl iodriver -rtems_sysmon \ No newline at end of file