X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fandroidcompiler.cpp;h=cdd98af34f5095dd853521535091e5b37e0fc4e8;hb=d774d554c4c15b963215212b26a9ee5df3d705e8;hp=3616cf450686ec5c1c10ad74592883d33f2ccb00;hpb=ec7da8076eede6c47126c8e58e478b9c93d73f5f;p=builder.git diff --git a/source/androidcompiler.cpp b/source/androidcompiler.cpp index 3616cf4..cdd98af 100644 --- a/source/androidcompiler.cpp +++ b/source/androidcompiler.cpp @@ -13,11 +13,28 @@ using namespace std; using namespace Msp; AndroidCompiler::AndroidCompiler(Builder &b, const Architecture &a, const string &t, const AndroidNdk &n): - GnuCompiler(b, a, t, n.get_platform_sysroot()), + GnuCompiler(b, a, t), ndk(n) { - set_command((ndk.get_bin_dir()/command).str()); - build_info.incpath.insert(build_info.incpath.end(), system_path.begin(), system_path.end()); + if(ndk.get_root_dir().empty()) + problems.push_back("Android NDK not found"); + else if(ndk.get_bin_dir().empty()) + problems.push_back("Android NDK toolchain not found"); + else + set_command((ndk.get_bin_dir()/command).str()); + + if(ndk.get_platform_sysroot().empty()) + problems.push_back("Android platform not found"); + else if(!ndk.get_common_sysroot().empty()) + { + build_info.sysroot = ndk.get_common_sysroot(); + /* The common sysroot has asm headers in arch directories and the + compiler doesn't pick them up automatically */ + build_info.incpath.push_back(ndk.get_common_sysroot()/"usr/include"/architecture->get_cross_prefix()); + } + else + build_info.sysroot = ndk.get_platform_sysroot(); + if(tag=="CXX") build_info.libs.push_back("gnustl_static"); }