From e0378dd4df0e121863cd506307b3658acc34fa55 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 7 Jan 2016 17:42:34 -0800 Subject: [PATCH] Allow libnativehelper to be missing Some branches may not include libnativehelper, or anything that depends on jni.h Change-Id: Id8bb9c101aecfacc5d62048818ea0c1c88b7d77c --- cc/cc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go index 6e7eb5c51..ce3a464ce 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -137,6 +137,10 @@ func init() { "frameworks/av/include", "frameworks/base/include", }) + // This is used by non-NDK modules to get jni.h. export_include_dirs doesn't help + // with this, since there is no associated library. + pctx.PrefixedPathsForOptionalSourceVariable("commonNativehelperInclude", "-I", + []string{"libnativehelper/include/nativehelper"}) pctx.SourcePathVariable("clangPath", "prebuilts/clang/host/${HostPrebuiltTag}/3.8/bin") } @@ -502,7 +506,7 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha flags.GlobalFlags = append(flags.GlobalFlags, "${commonGlobalIncludes}", toolchain.IncludeFlags(), - "-I"+common.PathForSource(ctx, "libnativehelper/include/nativehelper").String()) + "${commonNativehelperInclude}") } flags.GlobalFlags = append(flags.GlobalFlags, []string{