From e3cf23ab6a2fb249f629025dbae71b8642a2c668 Mon Sep 17 00:00:00 2001 From: Jaewan Kim Date: Wed, 7 Feb 2024 16:33:19 +0000 Subject: [PATCH] Add new build rule for running dtc on Android dtc_static links libfdt statically for simpler test setup. Otherwise libfdt.so should be manually pushed. (tested with data, data_bins, and required with rust_test target) Change-Id: Ic975258c7e0030cbeeb5c8c0df611d8aa439b3c8 Test: Manually --- Android.bp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Android.bp b/Android.bp index f9f2334..f4b1d37 100644 --- a/Android.bp +++ b/Android.bp @@ -66,16 +66,20 @@ cc_defaults { shared_libs: ["libfdt"], stl: "none", - dist: { - targets: [ - "dist_files", - ], - dir: "dtc", + target: { + host: { + dist: { + targets: [ + "dist_files", + ], + dir: "dtc", + }, + }, }, } -cc_binary_host { - name: "dtc", +cc_defaults { + name: "dtc_defaults", defaults: ["dt_defaults"], srcs: [ "checks.c", @@ -92,6 +96,18 @@ cc_binary_host { ], } +cc_binary { + name: "dtc_static", + defaults: ["dtc_defaults"], + static_executable: true, + installable: false, // test only +} + +cc_binary_host { + name: "dtc", + defaults: ["dtc_defaults"], +} + cc_binary_host { name: "fdtget", defaults: ["dt_defaults"],