aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-07-18 13:29:35 -0700
committerSteven Moreland <smoreland@google.com>2017-07-18 14:44:33 -0700
commit3cf6306f964c9dc2f1923427d033912ebaf6ee2f (patch)
tree08d0ede1abc0cbefd99bf6431111a0bee3bea13d
parentda4a7257b5b4c4fd41b8e8e084713e3e4f20187b (diff)
downloadbuild_soong-3cf6306f964c9dc2f1923427d033912ebaf6ee2f.tar.gz
build_soong-3cf6306f964c9dc2f1923427d033912ebaf6ee2f.tar.bz2
build_soong-3cf6306f964c9dc2f1923427d033912ebaf6ee2f.zip
Move default libnativehelper include to mock dir.
Also export the corresponding variable to make. libnativehelper's include_deprecated contains all of the headers that are currently used by libraries without the "nativehelper/" prefix. The current count of this is this: 2 ScopedLocalFrame.h 4 JniInvocation.h 4 ScopedBytes.h 5 AsynchronousCloseMonitor.h 6 toStringArray.h 7 ScopedStringChars.h 38 JniConstants.h 41 ScopedPrimitiveArray.h 79 ScopedUtfChars.h 80 UniquePtr.h 100 ScopedLocalRef.h 467 JNIHelp.h Now we can remove each file from the global header include on a file by file basis. Bug: 63762847 Test: libs find their headers Change-Id: Iffc0c1ceb55cc59dc4a70c75d7c0b9ce8397b2cf
-rw-r--r--cc/config/global.go2
-rw-r--r--cc/makevars.go10
2 files changed, 11 insertions, 1 deletions
diff --git a/cc/config/global.go b/cc/config/global.go
index 4ae22c95..f4a12302 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -124,7 +124,7 @@ func init() {
// 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.PrefixedExistentPathsForSourcesVariable("CommonNativehelperInclude", "-I",
- []string{"libnativehelper/include/nativehelper"})
+ []string{"libnativehelper/include_deprecated"})
pctx.SourcePathVariable("ClangDefaultBase", ClangDefaultBase)
pctx.VariableFunc("ClangBase", func(config interface{}) (string, error) {
diff --git a/cc/makevars.go b/cc/makevars.go
index 11c31622..294f3e65 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -82,6 +82,16 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("RS_GLOBAL_INCLUDES", "${config.RsGlobalIncludes}")
+ nativeHelperIncludeFlags, err := ctx.Eval("${config.CommonNativehelperInclude}")
+ if err != nil {
+ panic(err)
+ }
+ nativeHelperIncludes, nativeHelperSystemIncludes := splitSystemIncludes(ctx, nativeHelperIncludeFlags)
+ if len(nativeHelperSystemIncludes) > 0 {
+ panic("native helper may not have any system includes")
+ }
+ ctx.Strict("JNI_H_INCLUDE", strings.Join(nativeHelperIncludes, " "))
+
includeFlags, err := ctx.Eval("${config.CommonGlobalIncludes}")
if err != nil {
panic(err)