Androidstudio Rebuilds Everything Every Time If Multiple Abis Are Supported
If I build my AndroidStudio for one ABI, it works as expected. If I support two ABIs, say for 'armeabi-v7a' and 'arm64-v8a', then Android Studio will rebuild every file, every time
Solution 1:
This was caused by the fact that the build variants all had the same output directory for the .o files.
You need to split out the build directory into release/debug and into the different ABIs.
The way to do this, is by using the CMAKE_CURRENT_BINARY_DIR macro as such:
set( gpgoap_src_DIR $ENV{HOME}/src/GPGOAP )
add_subdirectory( ${gpgoap_src_DIR}${CMAKE_CURRENT_BINARY_DIR}/gpgoap )
If you do this, then the arm7 debug object files will end up in:
app/.externalNativeBuild/cmake/debug/armeabi-v7a
so they will not clash with other ABIs.
Note that you cannot re-use output directories, so you do need to postfix them for each add_subdirectory() that you do.
One final remark: the cmake documentation says that the output directory is optional for add_subdirectory() but I found this not to be the case. You need to supply it at least two arguments.
Post a Comment for "Androidstudio Rebuilds Everything Every Time If Multiple Abis Are Supported"