Comments (19)
Initial android-cmake toolchain pushed to polly/android branch as-is to get things going.
from polly.
Thanks, merged e670b4c
from polly.
OpenCV Android toolchain: https://github.com/Itseez/opencv/blob/master/platforms/android/android.toolchain.cmake
from polly.
After looking at the diff, that seems to be a better starting point. I'll
move the other one aside to serve as a reference and add the latest android
toolchain from OpenCV. It appears to be identical but with a few small
updates.
# LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where
Android
# libraries will be installed.
# Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
# under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
# (depending on the target ABI). This is convenient for Android
packaging.
On Mon, May 4, 2015 at 12:42 PM, Ruslan Baratov [email protected]
wrote:
OpenCV Android toolchain:
https://github.com/Itseez/opencv/blob/master/platforms/android/android.toolchain.cmake—
Reply to this email directly or view it on GitHub
#10 (comment).
from polly.
https://github.com/taka-no-me/android-cmake
from polly.
CMake target properties:
from polly.
Hello world sample: https://github.com/Discordia/android-cmake/tree/master/samples/hello-android-cmake
from polly.
one more example: https://github.com/Discordia/android-cmake-example
from polly.
Merge f930e10 allows the toolchain to be used with hunter.
However there are still a few bits missing for the toolchain file in general:
Once the STL implementation is chosen, its lib directory is not added to the ANDROID_LINKER_FLAGS nor the linking flags to link to the library.
I updated on my repo a fix for this: f85df73 by creating an ANDROID_STL_LIB_DIR and adding it to the ANDROID_LINKER_FLAGS if gnustl_static is chosen, but would be nice to hear from whoever uses other options for ANDROID_STL on a better solution to deal with this.
ping @headupinclouds
EDIT: Maybe it is a bad idea to hardwire the ANDROID_STL on the ANDROID_LINKER_FLAGS (ANDROID_LINKER_FLAGS sets the value for CMAKE_EXE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS and CMAKE_STATIC_LINKER_FLAGS) but ANDROID_STL_LIB_DIR should be useful to know where the directory of the lib for the chosen STL is.
from polly.
I've removed Android*.cmake
from Polly (31dcb9d) since it's not toolchain related stuff.
Can be used by Hunter: https://github.com/ruslo/hunter/wiki/pkg.android.modules
from polly.
@headupinclouds f89ebf3 I think https://github.com/taka-no-me/android-cmake is the original repo so probably version from OpenCV is older. So I guess we can move android.toolchain.cmake.origin
back and remove android.toolchain.cmake
(?)
from polly.
@ruslo Agreed. It looks like the taka-no-me repository is actively being updated ("authored 10 days ago"). I like the idea of using this one, since it will probably be easier to push and pull changes from upstream as needed.
from polly.
I've added android-ndk-r10e
toolchain: https://github.com/ruslo/polly/wiki/Toolchain-list#android-ndk-xxx
Switch between different ndk
versions was made similar to iOS way. You can set different ANDROID_NDK_xxx
environment variables and build.py
will pick the right version and add ANDROID_NDK
CMake variable.
Simple examples compile fine: https://github.com/ruslo/polly/tree/master/examples
from polly.
Guys, if you are going to revert to that toolchain, please be sure that it sets CMAKE_AR CMAKE_ANDROID_API
And be aware that CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU ) sets the forced compiler which makes hunter fail.
from polly.
Guys, if you are going to revert to that toolchain, please be sure that it sets CMAKE_AR CMAKE_ANDROID_API
I'm planning to cherry-pick your changes
from polly.
Sorry, I didn't mean CMAKE_AR, make sure it sets CMAKE_C_PROCESSOR is what I meant - sorry, I wrote it in a hurry.
Anyway, as discussed in #16 (comment) it makes sense that these changes go to upstream and be reviewed by people who have been maintaining this file longer.
from polly.
This has been taken care of with the following pull request: taka-no-me/android-cmake#53
from polly.
Usage example: https://github.com/forexample/android-cmake
from polly.
Well, looks like there is no need to create APK to run executable on device. It's possible to create simple console application and run it using adb shell
. So it's easy to orginize testing with CMake's add_test
:
- New function android_add_test in Android-Apk project
- Usage example
from polly.
Related Issues (20)
- mingw cross compilation from Linux to Windows HOT 9
- CHECK_TYPE_SIZE iOS error HOT 4
- Clang Compiler Test Failing For iOS-10-3-armv7.cmake At Master Commit 3e3f903 HOT 21
- SwiftModule and -Swift.h ObjC compatibility header not copied to framework HOT 7
- xcode8 ios automatic provisioning HOT 1
- Additional C flags required for static-std.cmake to fix behaviour change in CMake HOT 1
- Problem codesigning iOS 11.2 with Xcode 9.2 (9C40b) HOT 5
- build details (active)
- reason for clearing IPHONEOS_DEPLOYMENT_TARGET HOT 4
- How to start for iOS? HOT 4
- --framework fails on codesign for multiple iPhone Developer certificate HOT 3
- ANDROID_NDK_rXX not set HOT 4
- Build failure on latest XCode (10A255) HOT 6
- add support for qnx HOT 2
- colorized ouput HOT 5
- Possible issue with NoCodeSign.xcconfig HOT 11
- "/usr/bin/ld: cannot find -lc++" when using the clang-lto toolchain file HOT 2
- How to reduce Xcodebuild log size? HOT 4
- Add support for Apple's Project Catalyst HOT 2
- Problem with CPack HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polly.