From c2c34148caeccf5efb792606da332743b24d52c0 Mon Sep 17 00:00:00 2001 From: Dominik Charousset Date: Tue, 2 May 2023 20:43:33 +0200 Subject: [PATCH] Fix CMake option defaults on Windows --- CMakeLists.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7801938e3b..bc1698da18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,20 +20,26 @@ if ( NOT GENERATOR_IS_MULTI_CONFIG ) unset(build_type_lower) endif () +# On UNIX, install additional Zeek tools by default and build shared objects. +if ( NOT WIN32 ) + set(ZEEK_INSTALL_TOOLS_DEFAULT ON) + option(BUILD_SHARED_LIBS "Build targets as shared libraries." ON) +else () + set(ZEEK_INSTALL_TOOLS_DEFAULT OFF) +endif () + # CMake options (Boolean flags). -option(BUILD_SHARED_LIBS "Build targets as shared libraries." ON) option(ENABLE_DEBUG "Build Zeek with additional debugging support." ${ENABLE_DEBUG_DEFAULT}) option(ENABLE_JEMALLOC "Link against jemalloc." OFF) option(ENABLE_PERFTOOLS "Build with support for Google perftools." OFF) -option(ENABLE_ZEEK_UNIT_TESTS "Build the C++ (doctest) unit tests?" ON) option(ENABLE_ZEEK_UNIT_TESTS "Build the C++ unit tests." ON) -option(INSTALL_AUX_TOOLS "Install additional tools from auxil." ON) -option(INSTALL_BTEST "Install btest alongside Zeek." ON) -option(INSTALL_BTEST_PCAPS "Install pcap files for testing." ON) -option(INSTALL_ZEEKCTL "Install zeekctl." ON) -option(INSTALL_ZEEK_ARCHIVER "Install the zeek-archiver." ON) -option(INSTALL_ZEEK_CLIENT "Install the zeek-client." ON) -option(INSTALL_ZKG "Install zkg." ON) +option(INSTALL_AUX_TOOLS "Install additional tools from auxil." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_BTEST "Install btest alongside Zeek." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_BTEST_PCAPS "Install pcap files for testing." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_ZEEKCTL "Install zeekctl." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_ZEEK_ARCHIVER "Install the zeek-archiver." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_ZEEK_CLIENT "Install the zeek-client." ${ZEEK_INSTALL_TOOLS_DEFAULT}) +option(INSTALL_ZKG "Install zkg." ${ZEEK_INSTALL_TOOLS_DEFAULT}) option(PREALLOCATE_PORT_ARRAY "Pre-allocate all ports for zeek::Val." ON) option(ZEEK_STANDALONE "Build Zeek as stand-alone binary?" ON)