Comments (7)
Hi!
I am surprised that for a project supporting android, there is only one bug filed in this project against android.
You mean this one, right? mosra/magnum#310 What's your CMake version? I didn't have a chance to test with 3.16 yet, so there's a possibility they broke something while attempting to fix everything else.
The NDK sysroot should be added to the include path by CMake and that's what the code relies on, I'm not doing anything extra to get that include. Can you run with make VERBOSE=1
and post the full command-line so I can see what exactly it does in your case? In my case it looks like this (with the required include path highlighted):
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android --gcc-toolchain=/opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 --sysroot=/opt/android-ndk/sysroot -I../src -Isrc -isystem /opt/android-ndk/sources/cxx-stl/llvm-libc++/include -isystem /opt/android-ndk/sources/android/support/include -isystem /opt/android-ndk/sources/cxx-stl/llvm-libc++abi/include -isystem /opt/android-ndk/sysroot/usr/include -isystem /opt/android-ndk/sysroot/usr/include/aarch64-linux-android -funwind-tables -no-canonical-prefixes -D__ANDROID_API__=22 -fexceptions -frtti -O3 -DNDEBUG -fPIC -std=c++11 -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wmissing-prototypes -Wno-shorten-64-to-32 -MD -MT src/Corrade/Utility/CMakeFiles/CorradeUtilityObjects.dir/Directory.cpp.o -MF src/Corrade/Utility/CMakeFiles/CorradeUtilityObjects.dir/Directory.cpp.o.d -o src/Corrade/Utility/CMakeFiles/CorradeUtilityObjects.dir/Directory.cpp.o -c ../src/Corrade/Utility/Directory.cpp
from corrade.
Ha, yes, every project I've seen that aims to support multiple platforms always seems to have to dedicate a lot of resources fixing things related the evolution of Android builds, and the people who try to build them. And yes, there's this confusing aspect of Android Studio, in the SDK Manager pane for tools where it lists two different cmakes, one with a version (3.4 old stuff) and a newer one (3.6 or something but it isn't marked). That might be part of the issue, just discovered that looking at a different build I am working on.
As far as the NDK being picked up the by the include path, I see a point on the travis ci page that you have CMAKE_PREFIX_PATH= . Should I point this to the location where my NDK is installed? I am having trouble understanding how it is picking up the NDK from the install path, other than there being an ndk-build in my PATH.
from corrade.
Oh, I think I know where this comes from, then (and the 100-page long Android troubleshooting guide doesn't mention it early enough for some reason -- sorry. Going to update that.).
CMake has builtin Android support since 3.7 (but ideally the newer versions, 3.9 and up), if you're using the vintage ones that are bundled with Android Studio, those won't work -- CMake will ignore all the options passed and then die on the missing include. With 3.6 and below it needs to use some toolchain from hell that's bundled inside the NDK and to be frank I never even tried to use that one (instead made my own, and then scrapped it once CMake's builtin support appeared). I also never used Android Studio so I don't know how hard it is to convince it to use system CMake instead of the bundled one -- probably easiest to build it completely outside via the command line?
Hope this helps, and sorry for the pain :)
from corrade.
Gah , android tool chain .... Thanks for the response. So I'm clear, should I not use the one bundled in Android stuidio? I hate using studio but customers use it so I have to provide things that work with it. As far as the bundled cmake, It's old for sure, clocked at cmake 3.6.x.? So should I just be using whatever latest and greatest cmake 3.16.x version is available?
from corrade.
I can confirm anything between 3.9.2 and 3.15 works, didn't have a chance to test with 3.16 yet but I assume it would work too.
With the bundled 3.6 it should work in some way also but you'd need to figure out what all magic spells Gradle is passing to it to make it work (CMAKE_TOOLCHAIN_FILE
at least) and then repeat that while building on the command line. What I'm doing when interfacing with Gradle is building all dependencies using new CMake (3.9+), installing those somewhere, and only using the bundled old cmake when I really need to build the final APK using Gradle.
Alternatively, you could go the CMake Subproject way -- add_subdirectory(corrade)
etc. from your final project, and build everything from within Gradle, without doing separate installs. Basically what magnum's Getting Started Guide suggests, only adapted for Android -- that way, if the stars align correctly, Gradle's builtin cmake support might "just work" and build everything in one go. That could be also "customer friendly" enough :)
from corrade.
Thanks, I'll try to go though that set up later this week .
from corrade.
Things seem to work well again with NDK r19+ and CMake 3.16+ (and a bunch of extra things to help CMake find libraries), see mosra/magnum@8bc1fa1 for updated instructions.
from corrade.
Related Issues (20)
- Corrade with BUILD_TESTS=ON compilation error: call to non-‘constexpr’ function HOT 5
- Error when installing via HunterGate HOT 7
- Prefix cmake options with CORRADE_ HOT 4
- Windows: inconsistent redefinition of _aligned_malloc HOT 3
- Corrade adds /wd*** warning disablements to "clang.exe" on windows. HOT 1
- Building Corrade with -std=c++20 causes errors inside MinGW <numbers> header HOT 3
- Corrade fails to compile with emscripten 3.1.22 HOT 4
- Opt-in to native UTF-8 support for OS interaction on Windows
- std::tuple_size / tuple_element specializations for Corrade containers HOT 1
- error: cannot initialize a variable of type 'const char *const' with an rvalue of type 'int' HOT 3
- Optimizing compilation time for the test suite -- an analysis HOT 3
- Interconnect - Slots are not called according to their record order HOT 1
- V8::Zone Allocator HOT 1
- NEON code does not build on armv7 HOT 2
- what to set CORRADE_INCLUDE_DIR to for in-source-builds HOT 2
- JsonToken::asObject() odd behavior with empty objects HOT 2
- New Release HOT 1
- Broken Interconnect on Clang-CL 16.0.5 HOT 9
- Packaging location of GDB script files HOT 8
- Container::Pointer does not work with forward declaration anymore 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 corrade.