From b2adc2d8ccfb162e48d7dbd3d73413829f6b6a7a Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Sat, 5 Aug 2023 11:38:49 -0500 Subject: [PATCH 1/3] Add AutoOptionHelpers.cmake This module assists with making the usage of optional libraries consistent and in agreement with automake. It provides functions to register new options, and to print out the state of all associated features. Each option based on a package will follow the format ENABLE_XXX, and will have an associated feature variable (e.g. TS_HAS_JEMALLOC). Its value can be ON, 1, TRUE, OFF, 0, FALSE, or AUTO. When the states of the features are printed out, features that are ON or OFF will generally be color coded green or red respectively to help configuration mistakes stand out. Options that were explicitly turned off are given special treatment: if the feature is off, it will not be color coded, because this is expected; if the feature is found to be enabled despite the user's request, it will be colored red and a CMake warning will be issued. All of this should help keep things consistent and avoid any potentially annoying bugs caused by misconfiguration. --- CMakeLists.txt | 31 ++++++--- cmake/AutoOptionHelpers.cmake | 104 ++++++++++++++++++++++++++++ cmake/FindTSMallocReplacement.cmake | 76 -------------------- 3 files changed, 127 insertions(+), 84 deletions(-) create mode 100644 cmake/AutoOptionHelpers.cmake delete mode 100644 cmake/FindTSMallocReplacement.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ea47090d63..97cab329891 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,14 +47,16 @@ execute_process(COMMAND id -ng OUTPUT_VARIABLE BUILD_GROUP OUTPUT_STRIP_TRAILING execute_process(COMMAND uname -n OUTPUT_VARIABLE BUILD_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # Options +include(AutoOptionHelpers) +auto_off_feature_package(jemalloc TS_HAS_JEMALLOC "Use jemalloc (default OFF)") +auto_off_feature_package(mimalloc TS_HAS_MIMALLOC "Use mimalloc (default OFF)") +auto_off_feature_package(LuaJIT LuaJIT_FOUND "Use LuaJIT (default OFF)") + option(ENABLE_ASAN "Use address sanitizer (default OFF)") option(BUILD_REGRESSION_TESTING "Build regression tests (default ON)" ON) option(BUILD_EXPERIMENTAL_PLUGINS "Build the experimental plugins (default OFF)") set(DEFAULT_STACK_SIZE 1048576 CACHE STRING "Default stack size (default 1048576)") option(ENABLE_FAST_SDK "Use fast SDK APIs (default OFF)") -option(ENABLE_JEMALLOC "Use jemalloc (default OFF)") -option(ENABLE_LUAJIT "Use LuaJIT (default OFF)") -option(ENABLE_MIMALLOC "Use mimalloc (default OFF)") option(ENABLE_DOCS "Build docs (default OFF)") option(ENABLE_DISK_FAILURE_TESTS "Build disk failure tests (enables AIO fault injection, default OFF)" OFF) if(ENABLE_DISK_FAILURE_TESTS) @@ -102,7 +104,10 @@ set(ENABLE_TPROXY anything else to enable." ) option(ENABLE_QUICHE "Use quiche (default OFF)") -option(ENABLE_UNWIND "Use libunwind if found on system (default ON)" ON) +auto_feature_package(unwind + TS_USE_REMOTE_UNWINDING + "Use libunwind if found on system (default ON)" +) option(ENABLE_WCCP "Use WCCP v2 (default OFF)") option(ENABLE_EXAMPLE "Build example directory (default OFF)") set(TS_MAX_HOST_NAME_LEN 256 CACHE STRING "Max host name length (default 256)") @@ -120,8 +125,11 @@ set(MAX_THREADS_PER_TYPE ) set(TS_USE_SET_RBIO 1 CACHE STRING "Use openssl set_rbio (default 1)") set(TS_USE_DIAGS 1 CACHE STRING "Use diags (default 1)") -option(TS_USE_HWLOC "Use hwloc (default OFF)") option(ENABLE_CRIPTS "Build and install the Cripts library and headers (default OFF)") +auto_feature_package(hwloc + TS_USE_HWLOC + "Use hwloc" +) set(TS_USE_FAST_SDK ${ENABLE_FAST_SDK}) @@ -222,9 +230,14 @@ if(ENABLE_PROFILER) set(TS_HAS_PROFILER ${profiler_FOUND}) endif() -find_package(TSMallocReplacement QUIET MODULE) -if(TSMallocReplacement_FOUND) - link_libraries(ts::TSMallocReplacement) +if(TS_HAS_JEMALLOC AND TS_HAS_MIMALLOC) + message(FATAL_ERROR "Cannot build with both jemalloc and mimalloc.") +endif() + +if(TS_HAS_JEMALLOC) + link_libraries(jemalloc) +elseif(TS_HAS_MIMALLOC) + link_libraries(mimalloc) endif() if(ENABLE_UNWIND) @@ -530,3 +543,5 @@ cmake_print_variables(TS_PKGSYSGROUP) cmake_print_variables(BUILD_MACHINE) cmake_print_variables(DEFAULT_STACK_SIZE) cmake_print_variables(CMAKE_INSTALL_RPATH) +cmake_print_variables(OPENSSL_VERSION) +print_auto_options_summary() diff --git a/cmake/AutoOptionHelpers.cmake b/cmake/AutoOptionHelpers.cmake new file mode 100644 index 00000000000..24c10511c35 --- /dev/null +++ b/cmake/AutoOptionHelpers.cmake @@ -0,0 +1,104 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +set(GLOBAL_AUTO_OPTION_VARS "") + +function(_REGISTER_AUTO_OPTION _NAME _FEATURE_VAR _DESCRIPTION) + add_custom_target(${_NAME}_target) + set_target_properties(${_NAME}_target + PROPERTIES + AUTO_OPTION_FEATURE_VAR ${_FEATURE_VAR} + ) + + set(${_NAME} AUTO CACHE STRING ${_DESCRIPTION}) + set_property(CACHE ${_NAME} PROPERTY STRINGS AUTO ON OFF) + + set(LOCAL_AUTO_OPTION_VARS ${GLOBAL_AUTO_OPTION_VARS}) + list(APPEND LOCAL_AUTO_OPTION_VARS "${_NAME}") + set(GLOBAL_AUTO_OPTION_VARS ${LOCAL_AUTO_OPTION_VARS} PARENT_SCOPE) +endfunction() + +# Add a new auto feature that uses find_package. +# Creates an option ENABLE_. +macro(AUTO_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) + set(OPTION_VAR ENABLE_${_PACKAGE_NAME}) + + _register_auto_option(${OPTION_VAR} ${_FEATURE_VAR} ${_DESCRIPTION}) + + if(${OPTION_VAR} STREQUAL AUTO) + find_package(${_PACKAGE_NAME} QUIET) + elseif(${OPTION_VAR}) + find_package(${_PACKAGE_NAME} REQUIRED) + endif() + + # This is for consistency so all feature vars are TRUE or FALSE. + if(${_PACKAGE_NAME}_FOUND) + set(${_FEATURE_VAR} TRUE) + else() + set(${_FEATURE_VAR} FALSE) + endif() + + unset(OPTION_VAR) + unset(FEATURE_VAR) +endmacro() + +macro(AUTO_OFF_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) + # Need to set our cache string before the default one gets set. + set(ENABLE_${_PACKAGE_NAME} OFF CACHE STRING ${_DESCRIPTION}) + auto_feature_package(${_PACKAGE_NAME} ${_FEATURE_VAR} ${_DESCRIPTION}) +endmacro() + +# Prints a colorized summary of one auto option. +function(PRINT_AUTO_OPTION _NAME) + string(ASCII 27 ESC) + set(COLOR_RED "${ESC}[31m") + set(COLOR_GREEN "${ESC}[32m") + set(COLOR_RESET "${ESC}[m") + + set(OPTION_VALUE ${${_NAME}}) + + get_target_property(FEATURE "${_NAME}_target" AUTO_OPTION_FEATURE_VAR) + set(FEATURE_VALUE ${${FEATURE}}) + + set(RESET ${COLOR_RESET}) + if(FEATURE_VALUE) + if(OPTION_VALUE) + set(COLOR ${COLOR_GREEN}) + else() + message(WARNING "${FEATURE} truthy but ${_NAME} isn't!") + set(COLOR ${COLOR_RED}) + endif() + else() + if(OPTION_VALUE) + set(COLOR ${COLOR_RED}) + else() + set(RESET "") + endif() + endif() + + message(STATUS "${FEATURE}: ${COLOR}${FEATURE_VALUE}${RESET} (${OPTION_VALUE})") +endfunction() + +# Prints out a colorized summary of all auto options. +function(PRINT_AUTO_OPTIONS_SUMMARY) + message(STATUS "") + message(STATUS "-------- AUTO OPTIONS SUMMARY") + foreach(OPTION_NAME ${GLOBAL_AUTO_OPTION_VARS}) + print_auto_option(${OPTION_NAME}) + endforeach() + message(STATUS "") +endfunction() diff --git a/cmake/FindTSMallocReplacement.cmake b/cmake/FindTSMallocReplacement.cmake deleted file mode 100644 index 110a4f684d5..00000000000 --- a/cmake/FindTSMallocReplacement.cmake +++ /dev/null @@ -1,76 +0,0 @@ -####################### -# -# Licensed to the Apache Software Foundation (ASF) under one or more contributor license -# agreements. See the NOTICE file distributed with this work for additional information regarding -# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# -####################### - -# FindTSMallocReplacement.cmake -# -# This will define the following variables -# -# TSMallocReplacement_FOUND -# TS_HAS_MALLOC_REPLACEMENT -# TS_HAS_JEMALLOC -# TS_HAS_MIMALLOC -# -# and the following imported targets -# -# ts::TSMallocReplacement -# - -if(ENABLE_JEMALLOC AND ENABLE_MIMALLOC) - message(FATAL_ERROR "Cannot build with both jemalloc and mimalloc.") -endif() - -if(ENABLE_JEMALLOC) - find_package(jemalloc REQUIRED) -endif() -set(TS_HAS_JEMALLOC ${jemalloc_FOUND}) - -if(ENABLE_MIMALLOC) - find_package(mimalloc REQUIRED) -endif() -set(TS_HAS_MIMALLOC ${mimalloc_FOUND}) - -if(TS_HAS_JEMALLOC OR TS_HAS_MIMALLOC) - set(TS_HAS_MALLOC_REPLACEMENT TRUE) -endif() - -mark_as_advanced( - TSMallocReplacement_FOUND - TS_HAS_MALLOC_REPLACEMENT - TS_HAS_JEMALLOC - TS_HAS_MIMALLOC -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(TSMallocReplacement - REQUIRED_VARS TS_HAS_MALLOC_REPLACEMENT -) - -if(TSMallocReplacement_FOUND AND NOT TARGET ts::TSMallocReplacement) - add_library(ts::TSMallocReplacement INTERFACE IMPORTED) - if(TS_HAS_JEMALLOC) - target_link_libraries(ts::TSMallocReplacement - INTERFACE - jemalloc::jemalloc - ) - elseif(TS_HAS_MIMALLOC) - add_library(mimalloc::mimalloc ALIAS mimalloc) - target_link_libraries(ts::TSMallocReplacement - INTERFACE - mimalloc::mimalloc - ) - endif() -endif() From 148fd221b8fdc1665b12c7bac2323a08f9670d84 Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Sat, 16 Sep 2023 09:11:16 -0500 Subject: [PATCH 2/3] Expose more conventional macro for auto_options This refactors auto_options to take arguments using cmake_parse_arguments, thereby making available a more familiar and flexible interface. --- cmake/AutoOptionHelpers.cmake | 113 ++++++++++++++++++++++++++++------ 1 file changed, 93 insertions(+), 20 deletions(-) diff --git a/cmake/AutoOptionHelpers.cmake b/cmake/AutoOptionHelpers.cmake index 24c10511c35..a09e62859be 100644 --- a/cmake/AutoOptionHelpers.cmake +++ b/cmake/AutoOptionHelpers.cmake @@ -17,14 +17,14 @@ set(GLOBAL_AUTO_OPTION_VARS "") -function(_REGISTER_AUTO_OPTION _NAME _FEATURE_VAR _DESCRIPTION) +function(_REGISTER_AUTO_OPTION _NAME _FEATURE_VAR _DESCRIPTION _DEFAULT) add_custom_target(${_NAME}_target) set_target_properties(${_NAME}_target PROPERTIES AUTO_OPTION_FEATURE_VAR ${_FEATURE_VAR} ) - set(${_NAME} AUTO CACHE STRING ${_DESCRIPTION}) + set(${_NAME} ${_DEFAULT} CACHE STRING "${_DESCRIPTION}") set_property(CACHE ${_NAME} PROPERTY STRINGS AUTO ON OFF) set(LOCAL_AUTO_OPTION_VARS ${GLOBAL_AUTO_OPTION_VARS}) @@ -32,34 +32,107 @@ function(_REGISTER_AUTO_OPTION _NAME _FEATURE_VAR _DESCRIPTION) set(GLOBAL_AUTO_OPTION_VARS ${LOCAL_AUTO_OPTION_VARS} PARENT_SCOPE) endfunction() -# Add a new auto feature that uses find_package. -# Creates an option ENABLE_. -macro(AUTO_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) - set(OPTION_VAR ENABLE_${_PACKAGE_NAME}) +macro(_CHECK_PACKAGE_DEPENDS _OPTION_VAR _PACKAGE_DEPENDS _FEATURE_VAR) + if(${${_OPTION_VAR}} STREQUAL AUTO) + set(STRICTNESS QUIET) + else() + set(STRICTNESS REQUIRED) + endif() + + foreach(PACKAGE_NAME ${_PACKAGE_DEPENDS}) + find_package(${PACKAGE_NAME} ${STRICTNESS}) + if(NOT ${PACKAGE_NAME}_FOUND) + set(_FEATURE_VAR FALSE) + endif() + endforeach() +endmacro() + +# auto_option( +# [DESCRIPTION ] +# [DEFAULT ] +# [FEATURE_VAR ] +# [PACKAGE_DEPENDS ...] +# ) +# +# This macro registers a new auto option and sets its corresponding feature +# variable based on the requirements. The option it creates will be named +# ENABLE_, and the default feature variable will be +# USE_. +# +# It is necessary to have separate variables for the option and the feature +# because the option may be AUTO, but the feature must be enabled or not. +# It is expected that the option will have one of the values ON, OFF, or AUTO, +# and the feature will have one of the values TRUE, or FALSE. +# +# Behavior of the option is as follows: +# - The option is falsey: the feature variable will be FALSE. +# - The option is AUTO: if all requirements are satisfied, the +# feature variable will be TRUE, otherwise FALSE. +# - The option is truthy: if all requirements are satisfied, the +# feature variable will be TRUE, otherwise a fatal error is produced. +# +# DESCRIPTION is the description that will go with the cache entry for the +# option. If not provided, it will be empty. +# +# DEFAULT is the default value of the option. Permitted values are OFF, FALSE, 0 +# ON, TRUE, 1, AUTO. If no default is provided, AUTO is the default. +# +# FEATURE_VAR is the variable that will represent whether the feature should be +# used, given the value of the option and whether the requirements for the +# feature are satisfied. By default, it is USE_. +# +# PACKAGE_DEPENDS is a list of packages that are required for the feature. +macro(auto_option _FEATURE_NAME) + cmake_parse_arguments(ARG + "" + "DESCRIPTION;DEFAULT;FEATURE_VAR" + "PACKAGE_DEPENDS" + ${ARGN} + ) - _register_auto_option(${OPTION_VAR} ${_FEATURE_VAR} ${_DESCRIPTION}) + set(OPTION_VAR "ENABLE_${_FEATURE_NAME}") + if(ARG_FEATURE_VAR) + set(FEATURE_VAR ${ARG_FEATURE_VAR}) + else() + set(FEATURE_VAR "USE_${_FEATURE_NAME}") + endif() - if(${OPTION_VAR} STREQUAL AUTO) - find_package(${_PACKAGE_NAME} QUIET) - elseif(${OPTION_VAR}) - find_package(${_PACKAGE_NAME} REQUIRED) + if(NOT ARG_DEFAULT) + set(DEFAULT AUTO) + elseif(ARG_DEFAULT MATCHES "(ON)|(AUTO)|(TRUE)|(1)") + set(DEFAULT ${ARG_DEFAULT}) + else() + message(FATAL_ERROR "Invalid auto_option default ${ARG_DEFAULT}") endif() - # This is for consistency so all feature vars are TRUE or FALSE. - if(${_PACKAGE_NAME}_FOUND) - set(${_FEATURE_VAR} TRUE) + _register_auto_option(${OPTION_VAR} ${FEATURE_VAR} "${ARG_DESCRIPTION}" "${DEFAULT}") + + if(${${OPTION_VAR}}) + set(${FEATURE_VAR} TRUE) + _check_package_depends(${OPTION_VAR} "${ARG_PACKAGE_DEPENDS}" ${FEATURE_VAR}) else() - set(${_FEATURE_VAR} FALSE) + set(${FEATURE_VAR} FALSE) endif() +endmacro() - unset(OPTION_VAR) - unset(FEATURE_VAR) +macro(AUTO_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) + string(TOUPPER ${_PACKAGE_NAME} UP) + auto_option(${UP} + DESCRIPTION ${_DESCRIPTION} + FEATURE_VAR ${_FEATURE_VAR} + PACKAGE_DEPENDS ${_PACKAGE_NAME} + ) endmacro() macro(AUTO_OFF_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) # Need to set our cache string before the default one gets set. - set(ENABLE_${_PACKAGE_NAME} OFF CACHE STRING ${_DESCRIPTION}) - auto_feature_package(${_PACKAGE_NAME} ${_FEATURE_VAR} ${_DESCRIPTION}) + string(TOUPPER ${_PACKAGE_NAME} UP) + auto_feature_package(${UP} + DESCRIPTION ${_DESCRIPTION} + FEATURE_VAR ${_FEATURE_VAR} + PACKAGE_DEPENDS ${_PACKAGE_NAME} + DEFAULT OFF + ) endmacro() # Prints a colorized summary of one auto option. @@ -96,7 +169,7 @@ endfunction() # Prints out a colorized summary of all auto options. function(PRINT_AUTO_OPTIONS_SUMMARY) message(STATUS "") - message(STATUS "-------- AUTO OPTIONS SUMMARY") + message(STATUS "-------- AUTO OPTIONS SUMMARY --------") foreach(OPTION_NAME ${GLOBAL_AUTO_OPTION_VARS}) print_auto_option(${OPTION_NAME}) endforeach() From 15222ae4055f57a32596fc39ea6e1d9f42e20dcf Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Sat, 16 Sep 2023 10:18:38 -0500 Subject: [PATCH 3/3] Update CMakeLists.txt to use auto_option --- CMakeLists.txt | 30 ++++++++++++++---------------- cmake/AutoOptionHelpers.cmake | 20 -------------------- plugins/CMakeLists.txt | 2 +- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97cab329891..922ace33b97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,9 +48,19 @@ execute_process(COMMAND uname -n OUTPUT_VARIABLE BUILD_MACHINE OUTPUT_STRIP_TRAI # Options include(AutoOptionHelpers) -auto_off_feature_package(jemalloc TS_HAS_JEMALLOC "Use jemalloc (default OFF)") -auto_off_feature_package(mimalloc TS_HAS_MIMALLOC "Use mimalloc (default OFF)") -auto_off_feature_package(LuaJIT LuaJIT_FOUND "Use LuaJIT (default OFF)") +auto_option(HWLOC FEATURE_VAR TS_USE_HWLOC PACKAGE_DEPENDS hwloc) +auto_option(JEMALLOC + FEATURE_VAR TS_HAS_JEMALLOC + PACKAGE_DEPENDS jemalloc + DEFAULT OFF +) +auto_option(MIMALLOC + FEATURE_VAR TS_HAS_MIMALLOC + PACKAGE_DEPENDS mimalloc + DEFAULT OFF +) +auto_option(LUAJIT PACKAGE_DEPENDS LuaJIT) +auto_option(UNWIND FEATURE_VAR TS_USE_REMOTE_UNWINDING PACKAGE_DEPENDS unwind) option(ENABLE_ASAN "Use address sanitizer (default OFF)") option(BUILD_REGRESSION_TESTING "Build regression tests (default ON)" ON) @@ -104,10 +114,7 @@ set(ENABLE_TPROXY anything else to enable." ) option(ENABLE_QUICHE "Use quiche (default OFF)") -auto_feature_package(unwind - TS_USE_REMOTE_UNWINDING - "Use libunwind if found on system (default ON)" -) + option(ENABLE_WCCP "Use WCCP v2 (default OFF)") option(ENABLE_EXAMPLE "Build example directory (default OFF)") set(TS_MAX_HOST_NAME_LEN 256 CACHE STRING "Max host name length (default 256)") @@ -126,10 +133,6 @@ set(MAX_THREADS_PER_TYPE set(TS_USE_SET_RBIO 1 CACHE STRING "Use openssl set_rbio (default 1)") set(TS_USE_DIAGS 1 CACHE STRING "Use diags (default 1)") option(ENABLE_CRIPTS "Build and install the Cripts library and headers (default OFF)") -auto_feature_package(hwloc - TS_USE_HWLOC - "Use hwloc" -) set(TS_USE_FAST_SDK ${ENABLE_FAST_SDK}) @@ -185,10 +188,6 @@ if(brotli_FOUND) set(HAVE_BROTLI_ENCODE_H TRUE) endif() -if(ENABLE_LUAJIT) - find_package(LuaJIT REQUIRED) -endif() - if(ENABLE_POSIX_CAP) find_package(cap REQUIRED) set(TS_USE_POSIX_CAP ${cap_FOUND}) @@ -543,5 +542,4 @@ cmake_print_variables(TS_PKGSYSGROUP) cmake_print_variables(BUILD_MACHINE) cmake_print_variables(DEFAULT_STACK_SIZE) cmake_print_variables(CMAKE_INSTALL_RPATH) -cmake_print_variables(OPENSSL_VERSION) print_auto_options_summary() diff --git a/cmake/AutoOptionHelpers.cmake b/cmake/AutoOptionHelpers.cmake index a09e62859be..2527123715e 100644 --- a/cmake/AutoOptionHelpers.cmake +++ b/cmake/AutoOptionHelpers.cmake @@ -115,26 +115,6 @@ macro(auto_option _FEATURE_NAME) endif() endmacro() -macro(AUTO_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) - string(TOUPPER ${_PACKAGE_NAME} UP) - auto_option(${UP} - DESCRIPTION ${_DESCRIPTION} - FEATURE_VAR ${_FEATURE_VAR} - PACKAGE_DEPENDS ${_PACKAGE_NAME} - ) -endmacro() - -macro(AUTO_OFF_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION) - # Need to set our cache string before the default one gets set. - string(TOUPPER ${_PACKAGE_NAME} UP) - auto_feature_package(${UP} - DESCRIPTION ${_DESCRIPTION} - FEATURE_VAR ${_FEATURE_VAR} - PACKAGE_DEPENDS ${_PACKAGE_NAME} - DEFAULT OFF - ) -endmacro() - # Prints a colorized summary of one auto option. function(PRINT_AUTO_OPTION _NAME) string(ASCII 27 ESC) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 65a41b04fe9..925e48e56a5 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -48,7 +48,7 @@ if(NOT OPENSSL_IS_BORINGSSL) add_subdirectory(ja3_fingerprint) endif() -if(ENABLE_LUAJIT) +if(USE_LUAJIT) add_subdirectory(lua) endif()