From 08a70cdee3060e1fb44ef4013b97960e73ab3c7f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 3 Mar 2023 14:09:57 -0600 Subject: [PATCH] CMake: process_feature() disallow general/optimized/debug identifiers --- cmake/macros/macro_process_feature.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/macros/macro_process_feature.cmake b/cmake/macros/macro_process_feature.cmake index a80d8778da..f986d14164 100644 --- a/cmake/macros/macro_process_feature.cmake +++ b/cmake/macros/macro_process_feature.cmake @@ -122,24 +122,24 @@ macro(process_feature _feature) elseif("${_arg}" STREQUAL "OPTIONAL") set(_required FALSE) - elseif(_arg MATCHES "^(optimized|debug|general)$" - AND "${_current_suffix}" STREQUAL "LIBRARIES") - list(APPEND _temp_${_current_suffix} ${_arg}) - else() if ("${_current_suffix}" STREQUAL "") message(FATAL_ERROR "Internal configuration error: the second " "argument to process_feature must be a keyword" ) + elseif(_arg MATCHES "^(optimized|debug|general)$") + message(FATAL_ERROR + "Internal configuration error: process_feature() does not support " + "»debug«, »optimized«, or »general« library identifiers, use the " + "appropriate keyword instead." + ) endif() mark_as_advanced(${_arg}) if("${_current_suffix}" STREQUAL "CLEAR") - if(NOT _arg MATCHES "^(optimized|debug|general)$") - list(APPEND _clear_variables_list ${_arg}) - endif() + list(APPEND _clear_variables_list ${_arg}) else() -- 2.39.5