[CMAKE] Detect if the compiler supports visibility function attribute
Summary:
This diff adds detection for the
__attribute__((visibility("default"))) and
__attribute__((visibility("default"))) visibility function attributes.
This allow to export the expected symbols when building a shared library
while using fvisibility=hidden.
Test Plan:
mkdir buildcmake && cd buildcmake cmake -GNinja .. grep HAVE_FUNC_ATTRIBUTE src/config/bitcoin-config.h
Should be defined to 1 for HAVE_FUNC_ATTRIBUTE_VISIBILITY and
undefined for HAVE_FUNC_ATTRIBUTE_DLLEXPORT when using Clang, and
should be both defined to 1 when using GCC.
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D4152