| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/python/python_binary.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/lib/android/aidl/aidl.gni") |
| |
| if (is_host) { |
| executable("aidl_gen") { |
| # The aidl binary depends on gtest, while not being a test only target. The |
| # only way to allow this is to rebuild gtest in this target, which requires |
| # that it ignores gn checks. |
| check_includes = false |
| sources = [ |
| "//third_party/android/platform/system/tools/aidl/aidl.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_checkapi.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_checkapi.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_const_expressions.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_dumpapi.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_dumpapi.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_language.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_language.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_common.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_common.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_cpp.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_cpp.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_cpp_common.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_cpp_common.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_java.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_java.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_ndk.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_ndk.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_rust.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_to_rust.h", |
| "//third_party/android/platform/system/tools/aidl/aidl_typenames.cpp", |
| "//third_party/android/platform/system/tools/aidl/aidl_typenames.h", |
| "//third_party/android/platform/system/tools/aidl/ast_java.cpp", |
| "//third_party/android/platform/system/tools/aidl/ast_java.h", |
| "//third_party/android/platform/system/tools/aidl/check_valid.cpp", |
| "//third_party/android/platform/system/tools/aidl/check_valid.h", |
| "//third_party/android/platform/system/tools/aidl/code_writer.cpp", |
| "//third_party/android/platform/system/tools/aidl/code_writer.h", |
| "//third_party/android/platform/system/tools/aidl/comments.cpp", |
| "//third_party/android/platform/system/tools/aidl/comments.h", |
| "//third_party/android/platform/system/tools/aidl/diagnostics.cpp", |
| "//third_party/android/platform/system/tools/aidl/diagnostics.h", |
| "//third_party/android/platform/system/tools/aidl/generate_aidl_mappings.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_aidl_mappings.h", |
| "//third_party/android/platform/system/tools/aidl/generate_cpp.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_cpp.h", |
| "//third_party/android/platform/system/tools/aidl/generate_cpp_analyzer.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_cpp_analyzer.h", |
| "//third_party/android/platform/system/tools/aidl/generate_java.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_java.h", |
| "//third_party/android/platform/system/tools/aidl/generate_java_binder.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_ndk.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_ndk.h", |
| "//third_party/android/platform/system/tools/aidl/generate_rust.cpp", |
| "//third_party/android/platform/system/tools/aidl/generate_rust.h", |
| "//third_party/android/platform/system/tools/aidl/import_resolver.cpp", |
| "//third_party/android/platform/system/tools/aidl/import_resolver.h", |
| "//third_party/android/platform/system/tools/aidl/io_delegate.cpp", |
| "//third_party/android/platform/system/tools/aidl/io_delegate.h", |
| "//third_party/android/platform/system/tools/aidl/location.cpp", |
| "//third_party/android/platform/system/tools/aidl/location.h", |
| "//third_party/android/platform/system/tools/aidl/logging.cpp", |
| "//third_party/android/platform/system/tools/aidl/logging.h", |
| "//third_party/android/platform/system/tools/aidl/main.cpp", |
| "//third_party/android/platform/system/tools/aidl/options.cpp", |
| "//third_party/android/platform/system/tools/aidl/options.h", |
| "//third_party/android/platform/system/tools/aidl/os.h", |
| "//third_party/android/platform/system/tools/aidl/parser.cpp", |
| "//third_party/android/platform/system/tools/aidl/parser.h", |
| "//third_party/android/platform/system/tools/aidl/permission.cpp", |
| "//third_party/android/platform/system/tools/aidl/permission.h", |
| "//third_party/android/platform/system/tools/aidl/preprocess.cpp", |
| "//third_party/android/platform/system/tools/aidl/preprocess.h", |
| "//third_party/googletest/src/googletest/src/gtest-assertion-result.cc", |
| "//third_party/googletest/src/googletest/src/gtest-death-test.cc", |
| "//third_party/googletest/src/googletest/src/gtest-filepath.cc", |
| "//third_party/googletest/src/googletest/src/gtest-port.cc", |
| "//third_party/googletest/src/googletest/src/gtest-printers.cc", |
| "//third_party/googletest/src/googletest/src/gtest-test-part.cc", |
| "//third_party/googletest/src/googletest/src/gtest.cc", |
| "generated-files/aidl_language_l.cpp", |
| "generated-files/aidl_language_y.cpp", |
| "generated-files/aidl_language_y.h", |
| "generated-files/location.hh", |
| "generated-files/position.hh", |
| ] |
| |
| include_dirs = [ |
| "//third_party/android/platform/system/tools/aidl", |
| "generated-files", |
| "//third_party/googletest/src/googletest/include", |
| "//third_party/googletest/src/googletest", |
| ] |
| deps = [ |
| "//src/lib/android/libbase", |
| "//src/lib/android/logging", |
| ] |
| |
| # TODO(https://fxbug.dev/418047052): Remove when upstream googletest |
| # resolves https://github.com/google/googletest/issues/4762 |
| configs += [ "//build/config:Wno-character-conversion" ] |
| } |
| |
| rustc_binary("aidl_wrapper") { |
| edition = "2021" |
| source_root = "aidl_wrapper/main.rs" |
| sources = [ "aidl_wrapper/main.rs" ] |
| deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:pathdiff", |
| "//third_party/rust_crates:walkdir", |
| ] |
| data_deps = [ ":aidl_gen" ] |
| } |
| |
| python_binary("aidl_rust_glue") { |
| # TODO(b/367413842): Enable MyPy type checking |
| enable_mypy = false |
| main_source = "//third_party/android/platform/system/tools/aidl/build/aidl_rust_glue.py" |
| main_callable = "execute" |
| } |
| } |