cmake_build_type does not include flavors
DartNyan4 opened this issue · comments
In cmake you have the following command:
add_custom_command( TARGET native-lib
POST_BUILD
COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -R .comment -g -S -d --strip-unneeded ${CMAKE_HOME_DIRECTORY}/../../../build/intermediates/cmake/${CMAKE_BUILD_TYPE}/obj/${ANDROID_ABI}/libnative-lib.so
COMMENT "Stripped native library")
And it uses ${CMAKE_BUILD_TYPE} to locate .so, but if project has flavors this will not be valid path
Is there any modification to include flavors?
${ANDROID_ABI} points to the right flavor right?
yes, the problem was in ${CMAKE_BUILD_TYPE}
to use with flavors we had to add arguments:
flavorDimensions "version"
productFlavors {
free {
dimension "version"
externalNativeBuild.cmake {
arguments "-DFLAVOR=FREE"
}
}
full {
dimension "version"
externalNativeBuild.cmake {
arguments "-DFLAVOR=FULL"
}
}
}
and then modify the path .../cmake/${FLAVOR}${CMAKE_BUILD_TYPE}/...