Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir am: f96b001064 am: b6888a8b12

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2806397

Change-Id: I8b6b6fda94e719d8102079d2c740131722e03de8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Colin Cross
2023-11-02 19:52:45 +00:00
committed by Automerger Merge Worker
4 changed files with 5 additions and 5 deletions

View File

@@ -534,7 +534,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs
toolingCppflags += " ${config.NoOverride64GlobalCflags}" toolingCppflags += " ${config.NoOverride64GlobalCflags}"
} }
modulePath := android.PathForModuleSrc(ctx).String() modulePath := ctx.ModuleDir()
if android.IsThirdPartyPath(modulePath) { if android.IsThirdPartyPath(modulePath) {
cflags += " ${config.NoOverrideExternalGlobalCflags}" cflags += " ${config.NoOverrideExternalGlobalCflags}"
toolingCflags += " ${config.NoOverrideExternalGlobalCflags}" toolingCflags += " ${config.NoOverrideExternalGlobalCflags}"

View File

@@ -339,7 +339,7 @@ func parseCStd(cStdPtr *string) string {
// per-target values, module type values, and per-module Blueprints properties // per-target values, module type values, and per-module Blueprints properties
func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags { func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags {
tc := ctx.toolchain() tc := ctx.toolchain()
modulePath := android.PathForModuleSrc(ctx).String() modulePath := ctx.ModuleDir()
compiler.srcsBeforeGen = android.PathsForModuleSrcExcludes(ctx, compiler.Properties.Srcs, compiler.Properties.Exclude_srcs) compiler.srcsBeforeGen = android.PathsForModuleSrcExcludes(ctx, compiler.Properties.Srcs, compiler.Properties.Exclude_srcs)
compiler.srcsBeforeGen = append(compiler.srcsBeforeGen, deps.GeneratedSources...) compiler.srcsBeforeGen = append(compiler.srcsBeforeGen, deps.GeneratedSources...)

View File

@@ -303,7 +303,7 @@ func (j *Javadoc) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Op
} }
flags = append(flags, android.JoinWithPrefix(aidlIncludes.Strings(), "-I")) flags = append(flags, android.JoinWithPrefix(aidlIncludes.Strings(), "-I"))
flags = append(flags, "-I"+android.PathForModuleSrc(ctx).String()) flags = append(flags, "-I"+ctx.ModuleDir())
if src := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "src"); src.Valid() { if src := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "src"); src.Valid() {
flags = append(flags, "-I"+src.String()) flags = append(flags, "-I"+src.String())
} }

View File

@@ -288,7 +288,7 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
} }
// Disallow experimental features // Disallow experimental features
modulePath := android.PathForModuleSrc(ctx).String() modulePath := ctx.ModuleDir()
if !(android.IsThirdPartyPath(modulePath) || strings.HasPrefix(modulePath, "prebuilts")) { if !(android.IsThirdPartyPath(modulePath) || strings.HasPrefix(modulePath, "prebuilts")) {
rustcFlags = append(rustcFlags, "-Zallow-features=\"\"") rustcFlags = append(rustcFlags, "-Zallow-features=\"\"")
} }
@@ -436,7 +436,7 @@ func Rustdoc(ctx ModuleContext, main android.Path, deps PathDeps,
docTimestampFile := android.PathForModuleOut(ctx, "rustdoc.timestamp") docTimestampFile := android.PathForModuleOut(ctx, "rustdoc.timestamp")
// Silence warnings about renamed lints for third-party crates // Silence warnings about renamed lints for third-party crates
modulePath := android.PathForModuleSrc(ctx).String() modulePath := ctx.ModuleDir()
if android.IsThirdPartyPath(modulePath) { if android.IsThirdPartyPath(modulePath) {
rustdocFlags = append(rustdocFlags, " -A warnings") rustdocFlags = append(rustdocFlags, " -A warnings")
} }