Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #426, conditional module inclusion #427

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading