From 66ba1baddf801d58aae99bbcb4649ffa83d2fde3 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 5 Jun 2025 13:47:55 -0700 Subject: [PATCH] Follow-ups to configure output reformatting --- CMakeLists.txt | 55 +++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 829228e258..2dc52d478f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1510,9 +1510,14 @@ if (NOT ZEEK_FUZZING_ENGINE) endif () ## Utility method for outputting status information for features that just have a -## string representation. This can also take an option second argument that is a +## string representation. This can also take an optional second argument that is a ## value string to print. function (output_summary_line what) + if ("${ARGV1}" MATCHES "^$") + message("${what}:") + return() + endif () + set(_spaces " ") string(LENGTH ${what} _what_length) math(EXPR _num_spaces "25 - ${_what_length}") @@ -1522,7 +1527,7 @@ endfunction () ## Utility method for outputting status information for features that have an ON/OFF ## state. -function (output_summary_state what state) +function (output_summary_bool what state) if (${state}) output_summary_line("${what}" "ON") else () @@ -1547,8 +1552,8 @@ output_summary_line("State dir" "${ZEEK_STATE_DIR}") output_summary_line("Spicy modules dir" "${ZEEK_SPICY_MODULE_PATH}") message("") -output_summary_state("Debug mode" ${ENABLE_DEBUG}) -output_summary_state("Unit tests" ${ENABLE_ZEEK_UNIT_TESTS}) +output_summary_bool("Debug mode" ${ENABLE_DEBUG}) +output_summary_bool("Unit tests" ${ENABLE_ZEEK_UNIT_TESTS}) message("") output_summary_line("Builtin Plugins" "${_zeek_builtin_plugins}") @@ -1561,46 +1566,46 @@ output_summary_line("CXXFLAGS" "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType output_summary_line("CPP" "${CMAKE_CXX_COMPILER}") message("") -output_summary_state("AF_PACKET" ${ZEEK_HAVE_AF_PACKET}) -output_summary_state("Aux. Tools" ${INSTALL_AUX_TOOLS}) +output_summary_bool("AF_PACKET" ${ZEEK_HAVE_AF_PACKET}) +output_summary_bool("Aux. Tools" ${INSTALL_AUX_TOOLS}) output_summary_line("BifCL" ${_bifcl_exe_path}) output_summary_line("BinPAC" ${_binpac_exe_path}) -output_summary_state("BTest" ${INSTALL_BTEST}) +output_summary_bool("BTest" ${INSTALL_BTEST}) output_summary_line("BTest tooling" ${_install_btest_tools_msg}) output_summary_line("Gen-ZAM" ${_gen_zam_exe_path}) -output_summary_state("JavaScript" ${ZEEK_HAVE_JAVASCRIPT}) +output_summary_bool("JavaScript" ${ZEEK_HAVE_JAVASCRIPT}) output_summary_line("Spicy" ${_spicy}) -output_summary_state("Spicy analyzers" ${USE_SPICY_ANALYZERS}) -output_summary_state("zeek-client" ${INSTALL_ZEEK_CLIENT}) -output_summary_state("ZeekControl" ${INSTALL_ZEEKCTL}) -output_summary_state("zkg" ${INSTALL_ZKG}) +output_summary_bool("Spicy analyzers" ${USE_SPICY_ANALYZERS}) +output_summary_bool("zeek-client" ${INSTALL_ZEEK_CLIENT}) +output_summary_bool("ZeekControl" ${INSTALL_ZEEKCTL}) +output_summary_bool("zkg" ${INSTALL_ZKG}) message("") -output_summary_state("libmaxminddb" ${USE_GEOIP}) -output_summary_state("Kerberos" ${USE_KRB5}) -output_summary_state("gperftools" ${HAVE_PERFTOOLS}) -output_summary_state(" - tcmalloc" ${USE_PERFTOOLS_TCMALLOC}) -output_summary_state(" - debugging" ${USE_PERFTOOLS_DEBUG}) -output_summary_state("jemalloc" ${ENABLE_JEMALLOC}) +output_summary_bool("libmaxminddb" ${USE_GEOIP}) +output_summary_bool("Kerberos" ${USE_KRB5}) +output_summary_bool("gperftools" ${HAVE_PERFTOOLS}) +output_summary_bool(" - tcmalloc" ${USE_PERFTOOLS_TCMALLOC}) +output_summary_bool(" - debugging" ${USE_PERFTOOLS_DEBUG}) +output_summary_bool("jemalloc" ${ENABLE_JEMALLOC}) message("") output_summary_line("Cluster backends") -output_summary_state(" - Broker" ON) -output_summary_state(" - ZeroMQ" ${ENABLE_CLUSTER_BACKEND_ZEROMQ}) +output_summary_bool(" - Broker" ON) +output_summary_bool(" - ZeroMQ" ${ENABLE_CLUSTER_BACKEND_ZEROMQ}) message("") output_summary_line("Storage backends") -output_summary_state(" - SQLite" ON) -output_summary_state(" - Redis" ${ENABLE_STORAGE_BACKEND_REDIS}) +output_summary_bool(" - SQLite" ON) +output_summary_bool(" - Redis" ${ENABLE_STORAGE_BACKEND_REDIS}) message("") -output_summary_state("Fuzz Targets" ${ZEEK_ENABLE_FUZZERS}) +output_summary_bool("Fuzz Targets" ${ZEEK_ENABLE_FUZZERS}) output_summary_line("Fuzz Engine" "${_zeek_fuzzing_engine}") message("") output_summary_line("External Tools/Linters") -output_summary_state(" - Include What You Use" ${ENABLE_IWYU}) -output_summary_state(" - Clang-Tidy" ${ENABLE_CLANG_TIDY}) +output_summary_bool(" - Include What You Use" ${ENABLE_IWYU}) +output_summary_bool(" - Clang-Tidy" ${ENABLE_CLANG_TIDY}) if (${_analyzer_warning}) message("${_analyzer_warning}\n")