From d2130a93594455a62d842930e9c03908a2f5b435 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 29 Mar 2017 18:33:28 -0700 Subject: [PATCH] Use a timestamp file for preprocessed_ndk_headers. Having a directory as an output causes superfluous rebuilds, but we can't have *only* implicit outputs. Test: make ndk && make ndk Bug: None Change-Id: I8c2cd1df2ebf6e0cdb3a0441365d486708554010 --- cc/ndk_headers.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go index c1a3df4e8..6a083aed1 100644 --- a/cc/ndk_headers.go +++ b/cc/ndk_headers.go @@ -27,11 +27,13 @@ import ( var ( preprocessBionicHeaders = pctx.AndroidStaticRule("preprocessBionicHeaders", blueprint.RuleParams{ - Command: "$versionerCmd -o $out $srcDir $depsPath", + // The `&& touch $out` isn't really necessary, but Blueprint won't + // let us have only implicit outputs. + Command: "$versionerCmd -o $outDir $srcDir $depsPath && touch $out", CommandDeps: []string{"$versionerCmd"}, Description: "versioner preprocess $in", }, - "depsPath", "srcDir") + "depsPath", "srcDir", "outDir") ) func init() { @@ -229,14 +231,16 @@ func (m *preprocessedHeaderModule) GenerateAndroidBuildActions(ctx android.Modul } } + timestampFile := android.PathForModuleOut(ctx, "versioner.timestamp") ctx.ModuleBuild(pctx, android.ModuleBuildParams{ Rule: preprocessBionicHeaders, - Output: toOutputPath, + Output: timestampFile, Implicits: append(srcFiles, depsGlob...), ImplicitOutputs: installPaths, Args: map[string]string{ "depsPath": depsPath.String(), "srcDir": fromSrcPath.String(), + "outDir": toOutputPath.String(), }, }) }