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

Allow removal of text loggers from build with CMake variable. #1071

Merged
merged 2 commits into from
Oct 4, 2021
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions Svc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/WatchDog/")

# Components
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ActiveLogger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ActiveTextLogger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ActiveRateGroup/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/AssertFatalAdapter/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BufferManager/")
Expand All @@ -31,7 +30,6 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/GroundInterface/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Framer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FramingProtocol/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Health/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PassiveConsoleTextLogger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PolyDb/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PrmDb/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/RateGroupDriver/")
Expand All @@ -40,6 +38,13 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Time/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmChan/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmPacketizer/")

# Allow and check for disabling of text loggers
# Building these fails if FW_ENABLE_TEXT_LOGGING == 0
if (NOT FPRIME_DISABLE_TEXT_LOGGERS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly the way I'd disable these from the build. Two comments:

  1. Add an option in cmake/Options.cmake this makes the switch formal, and allows you to set a default.
  2. Our other switches are named in the positive. e.g. FPRIME_ENABLE_TEXT_LOGGERS with an appropriate default.

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PassiveConsoleTextLogger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ActiveTextLogger/")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTime/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTimer/")
Expand Down