From 185460b9970f33aa34dc2c380f022ee6d61960e3 Mon Sep 17 00:00:00 2001 From: Lloyd Pique Date: Mon, 27 Feb 2023 21:17:58 -0800 Subject: Uniquify generated source filenames Soong uses a distinct generated source path for each "gensrcs" rule in the Android.bp file. However when trying out the autogenerated Bazel conversion, the Bazel "gensrcs" rule uses a per-package path for generated code. In other words, all "gensrcs" in the same BUILD.bazel file use the same path. This led to an error with the two generated "wayland-protocol.c" files. The simple fix is just to use distinct file names for the two cases. The file names do not otherwise matter, as the code is compiled into a static library, which already has a distinct name for each case. Note: external/wayland is not currently on the Soong allowlist for Bazel, but this gets it ready for when it will be built that way. Bug: 144185560 Test: b build //external/wayland:libwayland_client Test: b build //external/wayland:libwayland_client_static //external/wayland:libwayland_server --config=android Change-Id: I142cf0187a421b6b251996c05e4dea4cc3163ecd --- Android.bp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Android.bp b/Android.bp index 07d917a..b3709e0 100644 --- a/Android.bp +++ b/Android.bp @@ -83,7 +83,7 @@ genrule { name: "wayland_core_protocol_sources_static", cmd: "$(location wayland_scanner) -s private-code < $(in) > $(out)", srcs: [":wayland_core_protocol"], - out: ["wayland-protocol.c"], + out: ["wayland-protocol-private.c"], tools: ["wayland_scanner"], } @@ -92,7 +92,7 @@ genrule { name: "wayland_core_protocol_sources_shared", cmd: "$(location wayland_scanner) -s public-code < $(in) > $(out)", srcs: [":wayland_core_protocol"], - out: ["wayland-protocol.c"], + out: ["wayland-protocol-public.c"], tools: ["wayland_scanner"], } -- cgit v1.2.3