From 1a3639b2f2674f35860bf71fce9ec49c1bdcb397 Mon Sep 17 00:00:00 2001 From: John Moon Date: Tue, 21 Mar 2023 12:43:59 -0700 Subject: [PATCH] ANDROID: build: Set DTC target compatibility Currently, there's no guarantee that the device tree compiler in our build is being built for the host target. Use native Bazel compatibility attributes to make sure DTC is only built for linux (not Android). Change-Id: Ibe06aa76004caf6e087f11e29679c045c68ab129 Signed-off-by: John Moon --- BUILD.dtc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BUILD.dtc b/BUILD.dtc index 81ecf50c10f6..6c50a3001ade 100644 --- a/BUILD.dtc +++ b/BUILD.dtc @@ -10,6 +10,7 @@ cc_library( "libfdt/*.h", "libfdt/*.c", ]), + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -48,6 +49,7 @@ cc_library( ] + glob(["*.h"]), includes = ["."], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -68,6 +70,7 @@ cc_binary( ] + glob(["*.h"]), includes = ["."], deps = [":libfdt", ":dtc_gen"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -82,6 +85,7 @@ cc_binary( "version_non_gen.h", ], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -96,6 +100,7 @@ cc_binary( "version_non_gen.h", ], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -110,6 +115,7 @@ cc_binary( "version_non_gen.h", ], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -124,6 +130,7 @@ cc_binary( "version_non_gen.h", ], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], ) @@ -138,6 +145,7 @@ cc_binary( "version_non_gen.h", ], deps = [":libfdt"], + target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], )