]> git.tdb.fi Git - builder.git/commitdiff
Check for existence of Android NDK in AndroidLinker
authorMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 16:34:21 +0000 (18:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 16:34:21 +0000 (18:34 +0200)
plugins/android/androidlinker.cpp

index ec9024996c5b7358236047e4553e908e2432067f..8c6e9a49c7849a7e1983b3b0f1a603b3389717a9 100644 (file)
@@ -6,10 +6,15 @@ using namespace std;
 AndroidLinker::AndroidLinker(Builder &b, const Architecture &a, const AndroidNdk &ndk):
        CustomizedTool(b, "LINK", a)
 {
-       build_info.sysroot = ndk.get_platform_sysroot();
-
        set_command("gcc", true);
-       set_command((ndk.get_bin_dir()/command).str());
+       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());
+
+       build_info.sysroot = ndk.get_platform_sysroot();
 }
 
 Target *AndroidLinker::create_target(const vector<Target *> &sources, const string &)