diff options
| author | Pascal Thomet <pthomet@gmail.com> | 2020-05-14 01:42:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-13 16:42:13 -0700 |
| commit | 55be137d5ba6230f62aa7fb0994fda1728ce7fef (patch) | |
| tree | 792e2271f25c1c2fad7bc0cc32baddb6a59046c5 /docs/examples/vcpkg_android_example_cmake_script/compile.sh | |
| parent | e57b024ccb77aa8dc5a126167b2ea2b4a1d44801 (diff) | |
| download | vcpkg-55be137d5ba6230f62aa7fb0994fda1728ce7fef.tar.gz vcpkg-55be137d5ba6230f62aa7fb0994fda1728ce7fef.zip | |
[vcpkg] Improve Android doc (triplets, usage with cmake and prefab) (#11264)
* Android: add docs/examples/vcpkg_android_example_cmake/
* Add docs/users/android.md
* Improve Android prefab doc
Following additional informations given by @atkawa7 at
https://github.com/microsoft/vcpkg/pull/11264
* Link to android.md
* Update the prefab usage instructions: "vcpkg install"
the 4 archs before exporting a prefab
* added --prefab-debug flag
* added gradle integration info
* reviewed the prefab output directory structure
(from a dump of an actual export)
* docs/users/triplets.md: link to android.md
* docs/index.md: link to android.md
* android.md: specify 2 possibiities for android_ndk_home
* Added examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake
Usage:
1. Main CMakeLists:
if (VCPKG_TARGET_ANDROID)
include("cmake/vcpkg_android.cmake")
endif()
2. cmake invocation:
cmake .. -DVCPKG_TARGET_ANDROID=ON -DANDROID_ABI=armeabi-v7a
* trigger pipeline build
* trigger pipelines
Diffstat (limited to 'docs/examples/vcpkg_android_example_cmake_script/compile.sh')
| -rwxr-xr-x | docs/examples/vcpkg_android_example_cmake_script/compile.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/examples/vcpkg_android_example_cmake_script/compile.sh b/docs/examples/vcpkg_android_example_cmake_script/compile.sh new file mode 100755 index 000000000..abd981a6a --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/compile.sh @@ -0,0 +1,37 @@ +# 1. Install the library via vcpkg +# This install jsoncpp for the 4 android target ABIs and for the host computer. +# see the correspondence between ABIs and vcpkg triplets in the table below: +# +# |VCPKG_TARGET_TRIPLET | ANDROID_ABI | +# |---------------------------|----------------------| +# |arm64-android | arm64-v8a | +# |arm-android | armeabi-v7a | +# |x64-android | x86_64 | +# |x86-android | x86 | +$VCPKG_ROOT/vcpkg install \ + jsoncpp \ + jsoncpp:arm-android \ + jsoncpp:arm64-android \ + jsoncpp:x86-android \ + jsoncpp:x64-android + + +# 2. Test the build +# +# First, select an android ABI +# Uncomment one of the four possibilities below +# +android_abi=armeabi-v7a +# android_abi=x86 +# android_abi=arm64-v8a +# android_abi=x86_64 + +rm -rf build +mkdir build && cd build + +# DVCPKG_TARGET_ANDROID will load vcpkg_android.cmake, +# which will then load the android + vcpkg toolchains. +cmake .. \ + -DVCPKG_TARGET_ANDROID=ON \ + -DANDROID_ABI=$android_abi +make |
