Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 17 | #include "aidl.h" |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 18 | #include "io_delegate.h" |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 19 | #include "logging.h" |
| 20 | #include "options.h" |
| 21 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 22 | #include <iostream> |
| 23 | |
| 24 | using android::aidl::Options; |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 25 | |
Andreas Gampe | d7f9001 | 2017-04-28 10:33:50 -0700 | [diff] [blame] | 26 | // aidl is leaky. Turn off LeakSanitizer by default. b/37749857 |
| 27 | extern "C" const char *__asan_default_options() { |
| 28 | return "detect_leaks=0"; |
| 29 | } |
| 30 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 31 | int main(int argc, char* argv[]) { |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 32 | android::base::InitLogging(argv); |
| 33 | LOG(DEBUG) << "aidl starting"; |
| 34 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 35 | Options options(argc, argv, Options::Language::CPP); |
| 36 | if (!options.Ok()) { |
| 37 | std::cerr << options.GetErrorMessage(); |
| 38 | std::cerr << options.GetUsage(); |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 39 | return 1; |
| 40 | } |
| 41 | |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 42 | android::aidl::IoDelegate io_delegate; |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 43 | return android::aidl::compile_aidl(options, io_delegate); |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 44 | } |