Add 'name-ndk' output lib linking against NDK.
aidl_interface instance now create Java, CPP, and NDK backends. The NDK
backend creates interfaces in a separate '::aidl' namespace in order to
avoid ODR violations when it is used in conjunction with the CPP lib.
Bug: 112664205
Test: atest android.binder.cts
Change-Id: Ie19720ad933147a4175acd51554b570dee44736a
diff --git a/options.cpp b/options.cpp
index f646c27..069d848 100644
--- a/options.cpp
+++ b/options.cpp
@@ -185,6 +185,9 @@
} else if (lang == "cpp") {
language_ = Options::Language::CPP;
task_ = Options::Task::COMPILE;
+ } else if (lang == "ndk") {
+ language_ = Options::Language::NDK;
+ task_ = Options::Task::COMPILE;
} else {
error_message_ << "Unsupported language: '" << lang << "'" << endl;
return;
@@ -299,7 +302,7 @@
output_file_ = output_dir_ + output_file_;
}
}
- } else if (language_ == Options::Language::CPP) {
+ } else if (IsCppOutput()) {
input_files_.emplace_back(argv[optind++]);
if (argc - optind < 2) {
error_message_ << "No HEADER_DIR or OUTPUT." << endl;
@@ -342,7 +345,7 @@
// filter out invalid combinations
if (lang_option_found) {
- if (language_ == Options::Language::CPP && task_ == Options::Task::COMPILE) {
+ if (IsCppOutput() && task_ == Options::Task::COMPILE) {
if (output_dir_.empty()) {
error_message_ << "Output directory is not set. Set with --out." << endl;
return;