fuzz: Configure check for main function
Summary:
This determines at cmake time if the main needs to be provided rather than relying on the compiler preprocessor definitions.
Backport of core#20065 and core#21080.
Test Plan:
cmake -GNinja .. -DCMAKE_C_COMPILER=afl-gcc \ -DCMAKE_CXX_COMPILER=afl-g++ \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
Check in the cmake output that all the fuzz target need a main()
ninja bitcoin-fuzzer cmake -GNinja .. -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DENABLE_SANITIZERS="fuzzer;address;undefined"
Check in the cmake output that no fuzz target need a main()
ninja bitcoin-fuzzer
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D15140