mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-30 16:01:20 +02:00
cmake: Add NO_CACHE_IF_FAILED
option for checking linker flags
Use it for checking `-fsanitize`.
This change improves the user experience when the configuration step
fails due to a missing library. Now, there is no need to manually clean
the CMake cache after installing the required library.
Github-Pull: #32027
Rebased-From: 52ac17757e
This commit is contained in:
committed by
glozow
parent
7bc7af9951
commit
477345207b
@@ -20,7 +20,7 @@ In configuration output, this function prints a string by the following pattern:
|
||||
function(try_append_linker_flag flag)
|
||||
cmake_parse_arguments(PARSE_ARGV 1
|
||||
TALF # prefix
|
||||
"" # options
|
||||
"NO_CACHE_IF_FAILED" # options
|
||||
"TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords
|
||||
"IF_CHECK_PASSED" # multi_value_keywords
|
||||
)
|
||||
@@ -68,6 +68,10 @@ function(try_append_linker_flag flag)
|
||||
if(DEFINED TALF_RESULT_VAR)
|
||||
set(${TALF_RESULT_VAR} "${${result}}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(NOT ${result} AND TALF_NO_CACHE_IF_FAILED)
|
||||
unset(${result} CACHE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(MSVC)
|
||||
|
Reference in New Issue
Block a user