Skip to content

Commit

Permalink
Merge pull request #427 from jphickey:fix-426-conditional-modules
Browse files Browse the repository at this point in the history
Fix #426, conditional module inclusion
  • Loading branch information
dzbaker committed Jan 17, 2024
2 parents c08b617 + f152ff8 commit fc602c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ()

8 changes: 8 additions & 0 deletions fsw/pc-rtems/psp_conditional_modules.cmake
Original file line number Diff line number Diff line change
@@ -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()
7 changes: 5 additions & 2 deletions fsw/pc-rtems/psp_module_list.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# 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
eeprom_notimpl
ram_direct
port_notimpl
iodriver
rtems_sysmon

0 comments on commit fc602c5

Please sign in to comment.