Skip to content

Commit

Permalink
Rework based on review comments. Made switch named in the positive, a…
Browse files Browse the repository at this point in the history
…nd added a default to cmake/Options.cmake.
  • Loading branch information
abcouwer-jpl authored and LeStarch committed Oct 4, 2021
1 parent aecd80d commit 00dd602
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Svc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ 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)
# Text logger components included by default,
# but can be disabled if FW_ENABLE_TEXT_LOGGING=0 is desired.
if (FPRIME_ENABLE_TEXT_LOGGERS)
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PassiveConsoleTextLogger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ActiveTextLogger/")
endif()
Expand Down
16 changes: 16 additions & 0 deletions cmake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ else()
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
endif()

####
# `FPRIME_ENABLE_TEXT_LOGGERS:`
#
# When FPRIME_ENABLE_TEXT_LOGGERS is set, the ActiveTextLogger and PassiveConsoleTextLogger
# svc components are included in the build. When unset, those components are excluded,
# allowing FpConfig.hpp:FW_ENABLE_TEXT_LOGGING to be unset as well, to save space.
# TextLoggers will fail to build if FW_ENABLE_TEXT_LOGGING=0.
#
# **Values:**
# - ON: (default) retains the text logger components in the target list
# - OFF: removes text logger components from the target list
#
# e.g. `-DFPRIME_ENABLE_TEXT_LOGGERS=OFF`
####
option(FPRIME_ENABLE_TEXT_LOGGERS "Enable text loggers in build" ON)

####
# `CMAKE_BUILD_TYPE:`
#
Expand Down

0 comments on commit 00dd602

Please sign in to comment.