[cmake] Refactor native build cmake generation
Summary: This adds a native_add_cmake_flags function for tools to add flags they want to pass to the native build. The flags are collected during the cmake execution process and _gen_native_cmake_target is run at the very end so that all the flags are used by watching when CMAKE_CURRENT_LIST_DIR is set to empty.
Test Plan:
Run cmake build from scratch.
Delete the native folder. Check that it is regenrated when rebuilding.
Run the build a second time to ensure that dependecies for native target are tracked properly.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D5026