From 1cc93fe7b40f10a7d1d1189058af98a2bce31381 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 8 Sep 2024 16:34:04 +0100 Subject: [PATCH] build: Delete dead code that implements `IF_CHECK_FAILED` option --- cmake/module/TryAppendCXXFlags.cmake | 15 +-------------- cmake/module/TryAppendLinkerFlag.cmake | 9 +-------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/cmake/module/TryAppendCXXFlags.cmake b/cmake/module/TryAppendCXXFlags.cmake index 0f6e014d437..c07455e89e0 100644 --- a/cmake/module/TryAppendCXXFlags.cmake +++ b/cmake/module/TryAppendCXXFlags.cmake @@ -32,12 +32,6 @@ Usage examples: ) - try_append_cxx_flags("-Werror=return-type" TARGET core_interface - IF_CHECK_FAILED "-Wno-error=return-type" - SOURCE "#include \nint f(){ assert(false); }" - ) - - In configuration output, this function prints a string by the following pattern: -- Performing Test CXX_SUPPORTS_[flags] @@ -49,7 +43,7 @@ function(try_append_cxx_flags flags) TACXXF # prefix "SKIP_LINK" # options "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords - "IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords ) set(flags_as_string "${flags}") @@ -88,13 +82,6 @@ function(try_append_cxx_flags flags) string(STRIP "${${TACXXF_VAR}} ${flags_as_string}" ${TACXXF_VAR}) endif() endif() - elseif(DEFINED TACXXF_IF_CHECK_FAILED) - if(DEFINED TACXXF_TARGET) - target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED}) - endif() - if(DEFINED TACXXF_VAR) - string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TACXXF_VAR}) - endif() endif() if(DEFINED TACXXF_VAR) diff --git a/cmake/module/TryAppendLinkerFlag.cmake b/cmake/module/TryAppendLinkerFlag.cmake index 749120d4458..8cbd83678d9 100644 --- a/cmake/module/TryAppendLinkerFlag.cmake +++ b/cmake/module/TryAppendLinkerFlag.cmake @@ -22,7 +22,7 @@ function(try_append_linker_flag flag) TALF # prefix "" # options "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords - "IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords ) string(MAKE_C_IDENTIFIER "${flag}" result) @@ -58,13 +58,6 @@ function(try_append_linker_flag flag) string(STRIP "${${TALF_VAR}} ${flag}" ${TALF_VAR}) endif() endif() - elseif(DEFINED TALF_IF_CHECK_FAILED) - if(DEFINED TALF_TARGET) - target_link_options(${TALF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED}) - endif() - if(DEFINED TALF_VAR) - string(STRIP "${${TALF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TALF_VAR}) - endif() endif() if(DEFINED TALF_VAR)