aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-12-20 04:05:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-12-20 04:05:39 +0000
commit6f866134207ef198396c041d30176ecd71e7c062 (patch)
tree8d28847d75eb44b5c3f943581e4152fa3065fb6a
parent731c8dac6dd43a23f44420b8c2828b1ed53c29d4 (diff)
parent70ba5a38d13516e39704adec2a4b1d4ba16421a9 (diff)
downloadbuild_soong-6f866134207ef198396c041d30176ecd71e7c062.tar.gz
build_soong-6f866134207ef198396c041d30176ecd71e7c062.tar.bz2
build_soong-6f866134207ef198396c041d30176ecd71e7c062.zip
Merge "Add compile-time pathDeps as implicit dependencies"
-rw-r--r--cc/builder.go11
-rw-r--r--cc/compiler.go14
-rw-r--r--cc/library.go12
-rw-r--r--cc/ndk_library.go2
4 files changed, 21 insertions, 18 deletions
diff --git a/cc/builder.go b/cc/builder.go
index e583834e..de85d6e7 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -290,7 +290,7 @@ func (a Objects) Append(b Objects) Objects {
// Generate rules for compiling multiple .c, .cpp, or .S files to individual .o files
func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles android.Paths,
- flags builderFlags, deps android.Paths) Objects {
+ flags builderFlags, pathDeps android.Paths, genDeps android.Paths) Objects {
objFiles := make(android.Paths, len(srcFiles))
var tidyFiles android.Paths
@@ -363,7 +363,8 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
Description: "yasm " + srcFile.Rel(),
Output: objFile,
Input: srcFile,
- OrderOnly: deps,
+ Implicits: pathDeps,
+ OrderOnly: genDeps,
Args: map[string]string{
"asFlags": flags.yasmFlags,
},
@@ -375,7 +376,8 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
Description: "windres " + srcFile.Rel(),
Output: objFile,
Input: srcFile,
- OrderOnly: deps,
+ Implicits: pathDeps,
+ OrderOnly: genDeps,
Args: map[string]string{
"windresCmd": gccCmd(flags.toolchain, "windres"),
"flags": flags.toolchain.WindresFlags(),
@@ -443,7 +445,8 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
Output: objFile,
ImplicitOutputs: implicitOutputs,
Input: srcFile,
- OrderOnly: deps,
+ Implicits: pathDeps,
+ OrderOnly: genDeps,
Args: map[string]string{
"cFlags": moduleCflags,
"ccCmd": ccCmd,
diff --git a/cc/compiler.go b/cc/compiler.go
index 4eae8982..c9dcf953 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -157,7 +157,8 @@ func NewBaseCompiler() *baseCompiler {
type baseCompiler struct {
Properties BaseCompilerProperties
Proto android.ProtoProperties
- deps android.Paths
+ genDeps android.Paths
+ pathDeps android.Paths
flags builderFlags
// Sources that were passed to the C/C++ compiler
@@ -536,17 +537,16 @@ func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathD
srcs := append(android.Paths(nil), compiler.srcsBeforeGen...)
srcs, genDeps := genSources(ctx, srcs, buildFlags)
-
- pathDeps = append(pathDeps, genDeps...)
pathDeps = append(pathDeps, flags.CFlagsDeps...)
- compiler.deps = pathDeps
+ compiler.pathDeps = pathDeps
+ compiler.genDeps = genDeps
// Save src, buildFlags and context
compiler.srcs = srcs
// Compile files listed in c.Properties.Srcs into objects
- objs := compileObjs(ctx, buildFlags, "", srcs, compiler.deps)
+ objs := compileObjs(ctx, buildFlags, "", srcs, pathDeps, genDeps)
if ctx.Failed() {
return Objects{}
@@ -557,7 +557,7 @@ func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathD
// Compile a list of source files into objects a specified subdirectory
func compileObjs(ctx android.ModuleContext, flags builderFlags,
- subdir string, srcFiles, deps android.Paths) Objects {
+ subdir string, srcFiles, pathDeps android.Paths, genDeps android.Paths) Objects {
- return TransformSourceToObj(ctx, subdir, srcFiles, flags, deps)
+ return TransformSourceToObj(ctx, subdir, srcFiles, flags, pathDeps, genDeps)
}
diff --git a/cc/library.go b/cc/library.go
index d53bcfcb..9bd12a98 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -384,11 +384,11 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
if library.static() {
srcs := android.PathsForModuleSrc(ctx, library.Properties.Static.Srcs)
objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceStaticLibrary,
- srcs, library.baseCompiler.deps))
+ srcs, library.baseCompiler.pathDeps, library.baseCompiler.genDeps))
} else if library.shared() {
srcs := android.PathsForModuleSrc(ctx, library.Properties.Shared.Srcs)
objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceSharedLibrary,
- srcs, library.baseCompiler.deps))
+ srcs, library.baseCompiler.pathDeps, library.baseCompiler.genDeps))
}
return objs
@@ -671,8 +671,8 @@ func (library *libraryDecorator) link(ctx ModuleContext,
}
library.reexportFlags(flags)
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
- library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to aidl deps
- library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.deps...)
+ library.reexportDeps(library.baseCompiler.genDeps) // TODO: restrict to aidl deps
+ library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.genDeps...)
}
}
@@ -684,8 +684,8 @@ func (library *libraryDecorator) link(ctx ModuleContext,
}
library.reexportFlags(flags)
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
- library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to proto deps
- library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.deps...)
+ library.reexportDeps(library.baseCompiler.genDeps) // TODO: restrict to proto deps
+ library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.genDeps...)
}
}
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index 459d9808..5a76666e 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -288,7 +288,7 @@ func compileStubLibrary(ctx ModuleContext, flags Flags, symbolFile, apiLevel, vn
subdir := ""
srcs := []android.Path{stubSrcPath}
- return compileObjs(ctx, flagsToBuilderFlags(flags), subdir, srcs, nil), versionScriptPath
+ return compileObjs(ctx, flagsToBuilderFlags(flags), subdir, srcs, nil, nil), versionScriptPath
}
func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) Objects {