Migration of https://github.com/hebasto/bitcoin/pull/340
try_append_cxx_flags
and try_append_linker_flag
are CMake functions used to test and conditionally apply compiler and linker flags to ensure compatibility with the build environment.
Currently the only case when the SOURCE
parameter was overwritten was bitcoin/bitcoin@8b6f1c4/CMakeLists.txt#L383-L389.
So currently the values would be unique without the hash, but overwriting a source in the future would cause a false hit, so I kept the full (uppercase) hash - and also added the werror_flag
to the cache key, since the result of the compilation depends on it as well.
After this change we will have logs such as:
0-- Performing Test CXX_SUPPORTS__FSANITIZE_UNDEFINED_ADDRESS_FUZZER
1-- Performing Test CXX_SUPPORTS__FSANITIZE_UNDEFINED_ADDRESS_FUZZER - Success
2-- Performing Test LINKER_SUPPORTS__FSANITIZE_UNDEFINED_ADDRESS_FUZZER__WL__FATAL_WARNINGS_A797852B32447D9D3594B7F06EFE65790DAAEFCBEFCE4144D7B1F480F6FA4B6A
3-- Performing Test LINKER_SUPPORTS__FSANITIZE_UNDEFINED_ADDRESS_FUZZER__WL__FATAL_WARNINGS_A797852B32447D9D3594B7F06EFE65790DAAEFCBEFCE4144D7B1F480F6FA4B6A - Success
4-- Performing Test FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION
5-- Performing Test FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION - Success
On top of that, try_append_cxx_flags
currently doesn’t even need a SOURCE
parameter - I’ve removed it for now, we can add it back once we need it.