Use cp instead of install for ndk_headers
ndk_headers currently use ctx.Install to install headers in
out/soong/ndk/sysroot. The files are subsequently used to compile ndk
variants of cc libraries on host.
Since these headers are not actually installed on device, use android.Cp
to assemble the NDK sysroot. By itself, it should be a no-op, but
androd.Cp is more friendly with restricting the installation rules to
PRODUCT_PACKAGES.
To make it explicit that the sysroot is not a typical installation path,
this CL also modifies the type to OutputPath
Test: m
Bug: 332778109
Change-Id: I1131c3c764443cbaac525c6022cd09c47695d275
diff --git a/android/paths.go b/android/paths.go
index 61c1258..a40f482 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -1831,17 +1831,13 @@
return base.Join(ctx, pathComponents...)
}
-func pathForNdkOrSdkInstall(ctx PathContext, prefix string, paths []string) InstallPath {
- base := pathForPartitionInstallDir(ctx, "", prefix, false)
- return base.Join(ctx, paths...)
-}
-
-func PathForNdkInstall(ctx PathContext, paths ...string) InstallPath {
- return pathForNdkOrSdkInstall(ctx, "ndk", paths)
+func PathForNdkInstall(ctx PathContext, paths ...string) OutputPath {
+ return PathForOutput(ctx, append([]string{"ndk"}, paths...)...)
}
func PathForMainlineSdksInstall(ctx PathContext, paths ...string) InstallPath {
- return pathForNdkOrSdkInstall(ctx, "mainline-sdks", paths)
+ base := pathForPartitionInstallDir(ctx, "", "mainline-sdks", false)
+ return base.Join(ctx, paths...)
}
func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string {