Loading android/paths.go +8 −4 Original line number Diff line number Diff line Loading @@ -1831,13 +1831,17 @@ func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string, return base.Join(ctx, pathComponents...) } func PathForNdkInstall(ctx PathContext, paths ...string) OutputPath { return PathForOutput(ctx, append([]string{"ndk"}, paths...)...) 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 PathForMainlineSdksInstall(ctx PathContext, paths ...string) InstallPath { base := pathForPartitionInstallDir(ctx, "", "mainline-sdks", false) return base.Join(ctx, paths...) return pathForNdkOrSdkInstall(ctx, "mainline-sdks", paths) } func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string { Loading cc/ndk_headers.go +9 −7 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package cc import ( "fmt" "path/filepath" "android/soong/android" Loading Loading @@ -44,7 +45,7 @@ func init() { } // Returns the NDK base include path for use with sdk_version current. Usable with -I. func getCurrentIncludePath(ctx android.ModuleContext) android.OutputPath { func getCurrentIncludePath(ctx android.ModuleContext) android.InstallPath { return getNdkSysrootBase(ctx).Join(ctx, "usr/include") } Loading Loading @@ -86,7 +87,7 @@ type headerModule struct { } func getHeaderInstallDir(ctx android.ModuleContext, header android.Path, from string, to string) android.OutputPath { to string) android.InstallPath { // Output path is the sysroot base + "usr/include" + to directory + directory component // of the file without the leading from directory stripped. // Loading Loading @@ -128,12 +129,13 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { for _, header := range m.srcPaths { installDir := getHeaderInstallDir(ctx, header, String(m.properties.From), String(m.properties.To)) installedPath := ctx.InstallFile(installDir, header.Base(), header) installPath := installDir.Join(ctx, header.Base()) ctx.Build(pctx, android.BuildParams{ Rule: android.Cp, Input: header, Output: installPath, }) if installPath != installedPath { panic(fmt.Sprintf( "expected header install path (%q) not equal to actual install path %q", installPath, installedPath)) } m.installPaths = append(m.installPaths, installPath) } Loading cc/ndk_library.go +3 −3 Original line number Diff line number Diff line Loading @@ -518,19 +518,19 @@ func (stub *stubDecorator) nativeCoverage() bool { // Returns the install path for unversioned NDK libraries (currently only static // libraries). func getUnversionedLibraryInstallPath(ctx ModuleContext) android.OutputPath { func getUnversionedLibraryInstallPath(ctx ModuleContext) android.InstallPath { return getNdkSysrootBase(ctx).Join(ctx, "usr/lib", config.NDKTriple(ctx.toolchain())) } // Returns the install path for versioned NDK libraries. These are most often // stubs, but the same paths are used for CRT objects. func getVersionedLibraryInstallPath(ctx ModuleContext, apiLevel android.ApiLevel) android.OutputPath { func getVersionedLibraryInstallPath(ctx ModuleContext, apiLevel android.ApiLevel) android.InstallPath { return getUnversionedLibraryInstallPath(ctx).Join(ctx, apiLevel.String()) } func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) { installDir := getVersionedLibraryInstallPath(ctx, stub.apiLevel) stub.installPath = installDir.Join(ctx, path.Base()) stub.installPath = ctx.InstallFile(installDir, path.Base(), path) } func newStubLibrary() *Module { Loading cc/ndk_sysroot.go +2 −2 Original line number Diff line number Diff line Loading @@ -69,12 +69,12 @@ func RegisterNdkModuleTypes(ctx android.RegistrationContext) { ctx.RegisterParallelSingletonType("ndk", NdkSingleton) } func getNdkInstallBase(ctx android.PathContext) android.OutputPath { func getNdkInstallBase(ctx android.PathContext) android.InstallPath { return android.PathForNdkInstall(ctx) } // Returns the main install directory for the NDK sysroot. Usable with --sysroot. func getNdkSysrootBase(ctx android.PathContext) android.OutputPath { func getNdkSysrootBase(ctx android.PathContext) android.InstallPath { return getNdkInstallBase(ctx).Join(ctx, "sysroot") } Loading Loading
android/paths.go +8 −4 Original line number Diff line number Diff line Loading @@ -1831,13 +1831,17 @@ func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string, return base.Join(ctx, pathComponents...) } func PathForNdkInstall(ctx PathContext, paths ...string) OutputPath { return PathForOutput(ctx, append([]string{"ndk"}, paths...)...) 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 PathForMainlineSdksInstall(ctx PathContext, paths ...string) InstallPath { base := pathForPartitionInstallDir(ctx, "", "mainline-sdks", false) return base.Join(ctx, paths...) return pathForNdkOrSdkInstall(ctx, "mainline-sdks", paths) } func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string { Loading
cc/ndk_headers.go +9 −7 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package cc import ( "fmt" "path/filepath" "android/soong/android" Loading Loading @@ -44,7 +45,7 @@ func init() { } // Returns the NDK base include path for use with sdk_version current. Usable with -I. func getCurrentIncludePath(ctx android.ModuleContext) android.OutputPath { func getCurrentIncludePath(ctx android.ModuleContext) android.InstallPath { return getNdkSysrootBase(ctx).Join(ctx, "usr/include") } Loading Loading @@ -86,7 +87,7 @@ type headerModule struct { } func getHeaderInstallDir(ctx android.ModuleContext, header android.Path, from string, to string) android.OutputPath { to string) android.InstallPath { // Output path is the sysroot base + "usr/include" + to directory + directory component // of the file without the leading from directory stripped. // Loading Loading @@ -128,12 +129,13 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { for _, header := range m.srcPaths { installDir := getHeaderInstallDir(ctx, header, String(m.properties.From), String(m.properties.To)) installedPath := ctx.InstallFile(installDir, header.Base(), header) installPath := installDir.Join(ctx, header.Base()) ctx.Build(pctx, android.BuildParams{ Rule: android.Cp, Input: header, Output: installPath, }) if installPath != installedPath { panic(fmt.Sprintf( "expected header install path (%q) not equal to actual install path %q", installPath, installedPath)) } m.installPaths = append(m.installPaths, installPath) } Loading
cc/ndk_library.go +3 −3 Original line number Diff line number Diff line Loading @@ -518,19 +518,19 @@ func (stub *stubDecorator) nativeCoverage() bool { // Returns the install path for unversioned NDK libraries (currently only static // libraries). func getUnversionedLibraryInstallPath(ctx ModuleContext) android.OutputPath { func getUnversionedLibraryInstallPath(ctx ModuleContext) android.InstallPath { return getNdkSysrootBase(ctx).Join(ctx, "usr/lib", config.NDKTriple(ctx.toolchain())) } // Returns the install path for versioned NDK libraries. These are most often // stubs, but the same paths are used for CRT objects. func getVersionedLibraryInstallPath(ctx ModuleContext, apiLevel android.ApiLevel) android.OutputPath { func getVersionedLibraryInstallPath(ctx ModuleContext, apiLevel android.ApiLevel) android.InstallPath { return getUnversionedLibraryInstallPath(ctx).Join(ctx, apiLevel.String()) } func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) { installDir := getVersionedLibraryInstallPath(ctx, stub.apiLevel) stub.installPath = installDir.Join(ctx, path.Base()) stub.installPath = ctx.InstallFile(installDir, path.Base(), path) } func newStubLibrary() *Module { Loading
cc/ndk_sysroot.go +2 −2 Original line number Diff line number Diff line Loading @@ -69,12 +69,12 @@ func RegisterNdkModuleTypes(ctx android.RegistrationContext) { ctx.RegisterParallelSingletonType("ndk", NdkSingleton) } func getNdkInstallBase(ctx android.PathContext) android.OutputPath { func getNdkInstallBase(ctx android.PathContext) android.InstallPath { return android.PathForNdkInstall(ctx) } // Returns the main install directory for the NDK sysroot. Usable with --sysroot. func getNdkSysrootBase(ctx android.PathContext) android.OutputPath { func getNdkSysrootBase(ctx android.PathContext) android.InstallPath { return getNdkInstallBase(ctx).Join(ctx, "sysroot") } Loading