1: fix cmake cross-ios failed caused by df118a87
build static lib for APPLE define for XCODE third_party framework including require
2: megbrain_test/megdnn_test build when MGE_INFERENCE_ONLY=ON
now u can build megbrain_test/megdnn_test by:
EXTRA_CMAKE_ARGS="-DMGE_WITH_TEST=ON" ./scripts/cmake-build/xxx.sh
example macos-cross-ios build megdnn_test for IOS by
EXTRA_CMAKE_ARGS="-DMGE_WITH_TEST=ON" ./scripts/cmake-build/cross_build_ios_arm_inference.sh
3: reuse host flatc build when cross build mode
GitOrigin-RevId: 132f4bf893567bdb1d54de506449950513a5841f
Also, upgrade to CMake 3.13.
The commit also contains significant refactors, as otherwise it is not
possible to properly export target `megengine` to
MegEngine-targets.cmake:
1. Optionally use system provided Flatbuffers.
2. Optionally use system provided MKL-DNN (Tested with Debian).
3. Refactor megbrain and megdnn targets into object libraries.
4. Set different path in BUILD_INTERFACE and INSTALL_INTERFACE of
various target_include_directories.
5. Specify PUBLIC/PRIVATE on various target_link_libraries.
GitOrigin-RevId: df118a879e