[CMAKE] Add an option to reduce exports
Summary:
Port of configure option --enable-reduce-exports.
This tries to reduce the amount of symbols which are exported in the
application binary.
Test Plan:
mkdir buildcmake && cd buildcmake cmake -DENABLE_REDUCE_EXPORTS=OFF -GNinja .. ninja ../contrib/devtools/symbol-check.py src/bitcoind | wc -l
Note the output of the last command.
rm -rf * cmake -DENABLE_REDUCE_EXPORTS=ON -GNinja .. ninja ../contrib/devtools/symbol-check.py src/bitcoind | wc -l
The quantity of line should be greatly reduced (244 => 123 on my
machine)
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D2965