The bitcoinconsensus library exports the functions from
`src/script/bitcoinconsensus.h`:
- `bitcoinconsensus_verify_script`
- `bitcoinconsensus_verify_script_with_amount`
- `bitcoinconsensus_version`
This diff adds a wrapper around cmake `add_library()` method that allow
for adding static, shared or both library.
This is highly inspired by then LLVM equivalent `llvm_add_library()`,
but simplified by restricting the features and using the
`target_link_libraries()` features for object libraries (which bumps the
cmake minimum version to 3.12 as a consequence).
Note that building with BUILD_SHARED_LIBS=ON set will fail and needs a
fix which is outside the scope of this diff (the failure is not related
to this diff).
This is a replacement for D4197 and D4198.