2016-06-18 01:45:24 +02:00
|
|
|
// Copyright 2016 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package cc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
2016-08-08 06:17:54 +02:00
|
|
|
"sync"
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
"github.com/google/blueprint"
|
|
|
|
|
|
|
|
"android/soong/android"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
toolPath = pctx.SourcePathVariable("toolPath", "build/soong/cc/gen_stub_libs.py")
|
|
|
|
|
2016-08-30 01:14:13 +02:00
|
|
|
genStubSrc = pctx.AndroidStaticRule("genStubSrc",
|
2016-06-18 01:45:24 +02:00
|
|
|
blueprint.RuleParams{
|
2017-03-29 00:00:46 +02:00
|
|
|
Command: "$toolPath --arch $arch --api $apiLevel --api-map " +
|
2018-12-07 08:25:39 +01:00
|
|
|
"$apiMap $flags $in $out",
|
2016-06-18 01:45:24 +02:00
|
|
|
CommandDeps: []string{"$toolPath"},
|
2018-12-07 08:25:39 +01:00
|
|
|
}, "arch", "apiLevel", "apiMap", "flags")
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
ndkLibrarySuffix = ".ndk"
|
2016-07-29 21:48:20 +02:00
|
|
|
|
|
|
|
ndkPrebuiltSharedLibs = []string{
|
|
|
|
"android",
|
2018-08-30 05:14:18 +02:00
|
|
|
"binder_ndk",
|
2016-07-29 21:48:20 +02:00
|
|
|
"c",
|
|
|
|
"dl",
|
|
|
|
"EGL",
|
|
|
|
"GLESv1_CM",
|
|
|
|
"GLESv2",
|
|
|
|
"GLESv3",
|
|
|
|
"jnigraphics",
|
|
|
|
"log",
|
|
|
|
"mediandk",
|
|
|
|
"m",
|
|
|
|
"OpenMAXAL",
|
|
|
|
"OpenSLES",
|
|
|
|
"stdc++",
|
2019-02-07 03:40:16 +01:00
|
|
|
"sync",
|
2016-07-29 21:48:20 +02:00
|
|
|
"vulkan",
|
|
|
|
"z",
|
|
|
|
}
|
|
|
|
ndkPrebuiltSharedLibraries = addPrefix(append([]string(nil), ndkPrebuiltSharedLibs...), "lib")
|
|
|
|
|
|
|
|
// These libraries have migrated over to the new ndk_library, which is added
|
|
|
|
// as a variation dependency via depsMutator.
|
2016-08-08 06:17:54 +02:00
|
|
|
ndkMigratedLibs = []string{}
|
2018-10-03 07:25:58 +02:00
|
|
|
ndkMigratedLibsLock sync.Mutex // protects ndkMigratedLibs writes during parallel BeginMutator
|
2016-06-18 01:45:24 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// Creates a stub shared library based on the provided version file.
|
|
|
|
//
|
|
|
|
// Example:
|
|
|
|
//
|
|
|
|
// ndk_library {
|
2017-04-08 00:21:13 +02:00
|
|
|
// name: "libfoo",
|
2016-06-18 01:45:24 +02:00
|
|
|
// symbol_file: "libfoo.map.txt",
|
|
|
|
// first_version: "9",
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
type libraryProperties struct {
|
|
|
|
// Relative path to the symbol map.
|
|
|
|
// An example file can be seen here: TODO(danalbert): Make an example.
|
2017-11-07 19:57:05 +01:00
|
|
|
Symbol_file *string
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
// The first API level a library was available. A library will be generated
|
|
|
|
// for every API level beginning with this one.
|
2017-11-07 19:57:05 +01:00
|
|
|
First_version *string
|
2016-06-18 01:45:24 +02:00
|
|
|
|
2017-01-04 00:16:29 +01:00
|
|
|
// The first API level that library should have the version script applied.
|
|
|
|
// This defaults to the value of first_version, and should almost never be
|
|
|
|
// used. This is only needed to work around platform bugs like
|
|
|
|
// https://github.com/android-ndk/ndk/issues/265.
|
2017-11-07 19:57:05 +01:00
|
|
|
Unversioned_until *string
|
2017-01-04 00:16:29 +01:00
|
|
|
|
2016-06-18 01:45:24 +02:00
|
|
|
// Private property for use by the mutator that splits per-API level.
|
2016-11-08 22:35:12 +01:00
|
|
|
ApiLevel string `blueprint:"mutated"`
|
2018-11-28 17:30:10 +01:00
|
|
|
|
|
|
|
// True if this API is not yet ready to be shipped in the NDK. It will be
|
|
|
|
// available in the platform for testing, but will be excluded from the
|
|
|
|
// sysroot provided to the NDK proper.
|
|
|
|
Draft bool
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
type stubDecorator struct {
|
|
|
|
*libraryDecorator
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
properties libraryProperties
|
2016-07-29 02:40:28 +02:00
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
versionScriptPath android.ModuleGenPath
|
2017-11-29 02:34:01 +01:00
|
|
|
installPath android.Path
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// OMG GO
|
2016-08-06 01:37:52 +02:00
|
|
|
func intMax(a int, b int) int {
|
|
|
|
if a > b {
|
2016-06-18 01:45:24 +02:00
|
|
|
return a
|
|
|
|
} else {
|
|
|
|
return b
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-18 01:19:59 +02:00
|
|
|
func normalizeNdkApiLevel(ctx android.BaseContext, apiLevel string,
|
|
|
|
arch android.Arch) (string, error) {
|
|
|
|
|
2016-11-08 23:34:24 +01:00
|
|
|
if apiLevel == "current" {
|
|
|
|
return apiLevel, nil
|
|
|
|
}
|
|
|
|
|
2017-11-29 09:27:14 +01:00
|
|
|
minVersion := ctx.Config().MinSupportedSdkVersion()
|
2017-04-13 22:00:26 +02:00
|
|
|
firstArchVersions := map[android.ArchType]int{
|
2017-08-18 01:19:59 +02:00
|
|
|
android.Arm: minVersion,
|
2017-04-13 22:00:26 +02:00
|
|
|
android.Arm64: 21,
|
2017-08-18 01:19:59 +02:00
|
|
|
android.Mips: minVersion,
|
2017-04-13 22:00:26 +02:00
|
|
|
android.Mips64: 21,
|
2017-08-18 01:19:59 +02:00
|
|
|
android.X86: minVersion,
|
2017-04-13 22:00:26 +02:00
|
|
|
android.X86_64: 21,
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2017-04-13 22:00:26 +02:00
|
|
|
firstArchVersion, ok := firstArchVersions[arch.ArchType]
|
2017-03-30 03:22:39 +02:00
|
|
|
if !ok {
|
2017-04-13 22:00:26 +02:00
|
|
|
panic(fmt.Errorf("Arch %q not found in firstArchVersions", arch.ArchType))
|
2017-03-30 03:22:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if apiLevel == "minimum" {
|
|
|
|
return strconv.Itoa(firstArchVersion), nil
|
|
|
|
}
|
|
|
|
|
2016-06-18 01:45:24 +02:00
|
|
|
// If the NDK drops support for a platform version, we don't want to have to
|
2016-08-06 01:37:52 +02:00
|
|
|
// fix up every module that was using it as its SDK version. Clip to the
|
2016-06-18 01:45:24 +02:00
|
|
|
// supported version here instead.
|
2016-08-06 01:37:52 +02:00
|
|
|
version, err := strconv.Atoi(apiLevel)
|
2016-06-18 01:45:24 +02:00
|
|
|
if err != nil {
|
2016-11-08 23:34:24 +01:00
|
|
|
return "", fmt.Errorf("API level must be an integer (is %q)", apiLevel)
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
2016-08-06 01:37:52 +02:00
|
|
|
version = intMax(version, minVersion)
|
2016-06-18 01:45:24 +02:00
|
|
|
|
2016-11-08 23:34:24 +01:00
|
|
|
return strconv.Itoa(intMax(version, firstArchVersion)), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func getFirstGeneratedVersion(firstSupportedVersion string, platformVersion int) (int, error) {
|
|
|
|
if firstSupportedVersion == "current" {
|
|
|
|
return platformVersion + 1, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return strconv.Atoi(firstSupportedVersion)
|
2016-08-06 01:37:52 +02:00
|
|
|
}
|
|
|
|
|
2018-05-04 00:42:34 +02:00
|
|
|
func shouldUseVersionScript(ctx android.BaseContext, stub *stubDecorator) (bool, error) {
|
2018-07-24 21:37:24 +02:00
|
|
|
// unversioned_until is normally empty, in which case we should use the version script.
|
|
|
|
if String(stub.properties.Unversioned_until) == "" {
|
|
|
|
return true, nil
|
|
|
|
}
|
2017-01-04 00:16:29 +01:00
|
|
|
|
2017-11-07 19:57:05 +01:00
|
|
|
if String(stub.properties.Unversioned_until) == "current" {
|
2017-01-06 00:49:09 +01:00
|
|
|
if stub.properties.ApiLevel == "current" {
|
|
|
|
return true, nil
|
|
|
|
} else {
|
|
|
|
return false, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-04 00:16:29 +01:00
|
|
|
if stub.properties.ApiLevel == "current" {
|
|
|
|
return true, nil
|
|
|
|
}
|
|
|
|
|
2018-07-24 21:37:24 +02:00
|
|
|
unversionedUntil, err := android.ApiStrToNum(ctx, String(stub.properties.Unversioned_until))
|
2017-01-04 00:16:29 +01:00
|
|
|
if err != nil {
|
|
|
|
return true, err
|
|
|
|
}
|
|
|
|
|
2018-07-24 21:37:24 +02:00
|
|
|
version, err := android.ApiStrToNum(ctx, stub.properties.ApiLevel)
|
2017-01-04 00:16:29 +01:00
|
|
|
if err != nil {
|
|
|
|
return true, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return version >= unversionedUntil, nil
|
|
|
|
}
|
|
|
|
|
2016-08-06 01:37:52 +02:00
|
|
|
func generateStubApiVariants(mctx android.BottomUpMutatorContext, c *stubDecorator) {
|
2017-11-29 09:27:14 +01:00
|
|
|
platformVersion := mctx.Config().PlatformSdkVersionInt()
|
2016-08-06 01:37:52 +02:00
|
|
|
|
2017-11-07 19:57:05 +01:00
|
|
|
firstSupportedVersion, err := normalizeNdkApiLevel(mctx, String(c.properties.First_version),
|
2016-08-06 01:37:52 +02:00
|
|
|
mctx.Arch())
|
|
|
|
if err != nil {
|
|
|
|
mctx.PropertyErrorf("first_version", err.Error())
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
2016-08-06 01:37:52 +02:00
|
|
|
|
2016-11-08 23:34:24 +01:00
|
|
|
firstGenVersion, err := getFirstGeneratedVersion(firstSupportedVersion, platformVersion)
|
|
|
|
if err != nil {
|
|
|
|
// In theory this is impossible because we've already run this through
|
|
|
|
// normalizeNdkApiLevel above.
|
|
|
|
mctx.PropertyErrorf("first_version", err.Error())
|
|
|
|
}
|
|
|
|
|
2016-11-08 22:35:12 +01:00
|
|
|
var versionStrs []string
|
2016-11-08 23:34:24 +01:00
|
|
|
for version := firstGenVersion; version <= platformVersion; version++ {
|
2016-11-08 22:35:12 +01:00
|
|
|
versionStrs = append(versionStrs, strconv.Itoa(version))
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
2017-11-29 09:27:14 +01:00
|
|
|
versionStrs = append(versionStrs, mctx.Config().PlatformVersionActiveCodenames()...)
|
2016-11-08 22:35:12 +01:00
|
|
|
versionStrs = append(versionStrs, "current")
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
modules := mctx.CreateVariations(versionStrs...)
|
|
|
|
for i, module := range modules {
|
2016-11-08 22:35:12 +01:00
|
|
|
module.(*Module).compiler.(*stubDecorator).properties.ApiLevel = versionStrs[i]
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func ndkApiMutator(mctx android.BottomUpMutatorContext) {
|
|
|
|
if m, ok := mctx.Module().(*Module); ok {
|
2017-04-13 21:53:07 +02:00
|
|
|
if m.Enabled() {
|
|
|
|
if compiler, ok := m.compiler.(*stubDecorator); ok {
|
|
|
|
generateStubApiVariants(mctx, compiler)
|
|
|
|
}
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
func (c *stubDecorator) compilerInit(ctx BaseModuleContext) {
|
2016-08-04 22:02:36 +02:00
|
|
|
c.baseCompiler.compilerInit(ctx)
|
|
|
|
|
2017-04-08 00:21:13 +02:00
|
|
|
name := ctx.baseModuleName()
|
|
|
|
if strings.HasSuffix(name, ndkLibrarySuffix) {
|
|
|
|
ctx.PropertyErrorf("name", "Do not append %q manually, just use the base name", ndkLibrarySuffix)
|
|
|
|
}
|
|
|
|
|
2016-08-08 06:17:54 +02:00
|
|
|
ndkMigratedLibsLock.Lock()
|
|
|
|
defer ndkMigratedLibsLock.Unlock()
|
2016-08-04 22:02:36 +02:00
|
|
|
for _, lib := range ndkMigratedLibs {
|
|
|
|
if lib == name {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ndkMigratedLibs = append(ndkMigratedLibs, name)
|
|
|
|
}
|
|
|
|
|
2017-07-19 20:39:53 +02:00
|
|
|
func addStubLibraryCompilerFlags(flags Flags) Flags {
|
|
|
|
flags.CFlags = append(flags.CFlags,
|
|
|
|
// We're knowingly doing some otherwise unsightly things with builtin
|
|
|
|
// functions here. We're just generating stub libraries, so ignore it.
|
|
|
|
"-Wno-incompatible-library-redeclaration",
|
|
|
|
"-Wno-builtin-requires-header",
|
|
|
|
"-Wno-invalid-noreturn",
|
2017-11-14 23:09:14 +01:00
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
2017-07-19 20:39:53 +02:00
|
|
|
// These libraries aren't actually used. Don't worry about unwinding
|
|
|
|
// (avoids the need to link an unwinder into a fake library).
|
|
|
|
"-fno-unwind-tables",
|
|
|
|
)
|
|
|
|
return flags
|
|
|
|
}
|
|
|
|
|
2017-11-16 23:33:08 +01:00
|
|
|
func (stub *stubDecorator) compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags {
|
|
|
|
flags = stub.baseCompiler.compilerFlags(ctx, flags, deps)
|
2017-07-19 20:39:53 +02:00
|
|
|
return addStubLibraryCompilerFlags(flags)
|
|
|
|
}
|
|
|
|
|
2018-12-07 08:25:39 +01:00
|
|
|
func compileStubLibrary(ctx ModuleContext, flags Flags, symbolFile, apiLevel, genstubFlags string) (Objects, android.ModuleGenPath) {
|
2016-06-18 01:45:24 +02:00
|
|
|
arch := ctx.Arch().ArchType.String()
|
|
|
|
|
2017-03-19 21:44:32 +01:00
|
|
|
stubSrcPath := android.PathForModuleGen(ctx, "stub.c")
|
|
|
|
versionScriptPath := android.PathForModuleGen(ctx, "stub.map")
|
|
|
|
symbolFilePath := android.PathForModuleSrc(ctx, symbolFile)
|
2017-03-29 00:00:46 +02:00
|
|
|
apiLevelsJson := android.GetApiLevelsJson(ctx)
|
2017-10-24 02:16:14 +02:00
|
|
|
ctx.Build(pctx, android.BuildParams{
|
2017-05-09 22:45:28 +02:00
|
|
|
Rule: genStubSrc,
|
|
|
|
Description: "generate stubs " + symbolFilePath.Rel(),
|
|
|
|
Outputs: []android.WritablePath{stubSrcPath, versionScriptPath},
|
|
|
|
Input: symbolFilePath,
|
|
|
|
Implicits: []android.Path{apiLevelsJson},
|
2016-06-18 01:45:24 +02:00
|
|
|
Args: map[string]string{
|
|
|
|
"arch": arch,
|
2017-03-19 21:44:32 +01:00
|
|
|
"apiLevel": apiLevel,
|
2017-03-29 00:00:46 +02:00
|
|
|
"apiMap": apiLevelsJson.String(),
|
2018-12-07 08:25:39 +01:00
|
|
|
"flags": genstubFlags,
|
2016-06-18 01:45:24 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
subdir := ""
|
2016-10-26 19:03:47 +02:00
|
|
|
srcs := []android.Path{stubSrcPath}
|
2017-12-20 00:11:01 +01:00
|
|
|
return compileObjs(ctx, flagsToBuilderFlags(flags), subdir, srcs, nil, nil), versionScriptPath
|
2017-03-19 21:44:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) Objects {
|
2017-11-07 19:57:05 +01:00
|
|
|
if !strings.HasSuffix(String(c.properties.Symbol_file), ".map.txt") {
|
2017-06-14 00:14:56 +02:00
|
|
|
ctx.PropertyErrorf("symbol_file", "must end with .map.txt")
|
|
|
|
}
|
|
|
|
|
2017-11-07 19:57:05 +01:00
|
|
|
objs, versionScript := compileStubLibrary(ctx, flags, String(c.properties.Symbol_file),
|
|
|
|
c.properties.ApiLevel, "")
|
2017-03-19 21:44:32 +01:00
|
|
|
c.versionScriptPath = versionScript
|
|
|
|
return objs
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2016-12-14 02:06:13 +01:00
|
|
|
func (linker *stubDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
2016-06-18 01:45:24 +02:00
|
|
|
return Deps{}
|
|
|
|
}
|
|
|
|
|
2017-04-08 00:21:13 +02:00
|
|
|
func (linker *stubDecorator) Name(name string) string {
|
|
|
|
return name + ndkLibrarySuffix
|
|
|
|
}
|
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
func (stub *stubDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
2017-04-08 00:21:13 +02:00
|
|
|
stub.libraryDecorator.libName = ctx.baseModuleName()
|
2016-07-30 02:28:03 +02:00
|
|
|
return stub.libraryDecorator.linkerFlags(ctx, flags)
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
func (stub *stubDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps,
|
2016-09-27 02:33:01 +02:00
|
|
|
objs Objects) android.Path {
|
2016-07-29 02:40:28 +02:00
|
|
|
|
2018-05-04 00:42:34 +02:00
|
|
|
useVersionScript, err := shouldUseVersionScript(ctx, stub)
|
2017-01-04 00:16:29 +01:00
|
|
|
if err != nil {
|
|
|
|
ctx.ModuleErrorf(err.Error())
|
|
|
|
}
|
|
|
|
|
|
|
|
if useVersionScript {
|
|
|
|
linkerScriptFlag := "-Wl,--version-script," + stub.versionScriptPath.String()
|
|
|
|
flags.LdFlags = append(flags.LdFlags, linkerScriptFlag)
|
|
|
|
}
|
|
|
|
|
2016-09-27 02:33:01 +02:00
|
|
|
return stub.libraryDecorator.link(ctx, flags, deps, objs)
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2019-03-25 18:21:31 +01:00
|
|
|
func (stub *stubDecorator) nativeCoverage() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) {
|
2016-06-18 01:45:24 +02:00
|
|
|
arch := ctx.Target().Arch.ArchType.Name
|
2016-07-30 02:28:03 +02:00
|
|
|
apiLevel := stub.properties.ApiLevel
|
2016-06-18 01:45:24 +02:00
|
|
|
|
|
|
|
// arm64 isn't actually a multilib toolchain, so unlike the other LP64
|
|
|
|
// architectures it's just installed to lib.
|
|
|
|
libDir := "lib"
|
|
|
|
if ctx.toolchain().Is64Bit() && arch != "arm64" {
|
|
|
|
libDir = "lib64"
|
|
|
|
}
|
|
|
|
|
|
|
|
installDir := getNdkInstallBase(ctx).Join(ctx, fmt.Sprintf(
|
2016-11-08 22:35:12 +01:00
|
|
|
"platforms/android-%s/arch-%s/usr/%s", apiLevel, arch, libDir))
|
2017-11-29 02:34:01 +01:00
|
|
|
stub.installPath = ctx.InstallFile(installDir, path.Base(), path)
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2017-06-24 00:06:31 +02:00
|
|
|
func newStubLibrary() *Module {
|
2016-12-09 23:46:15 +01:00
|
|
|
module, library := NewLibrary(android.DeviceSupported)
|
|
|
|
library.BuildOnlyShared()
|
2016-06-18 01:45:24 +02:00
|
|
|
module.stl = nil
|
2016-07-30 02:28:03 +02:00
|
|
|
module.sanitize = nil
|
2017-11-07 19:57:05 +01:00
|
|
|
library.StripProperties.Strip.None = BoolPtr(true)
|
2016-06-18 01:45:24 +02:00
|
|
|
|
2016-07-30 02:28:03 +02:00
|
|
|
stub := &stubDecorator{
|
|
|
|
libraryDecorator: library,
|
|
|
|
}
|
|
|
|
module.compiler = stub
|
|
|
|
module.linker = stub
|
|
|
|
module.installer = stub
|
2016-06-18 01:45:24 +02:00
|
|
|
|
2017-06-24 00:06:31 +02:00
|
|
|
module.AddProperties(&stub.properties, &library.MutatedProperties)
|
|
|
|
|
|
|
|
return module
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|
|
|
|
|
2019-04-03 17:43:30 +02:00
|
|
|
// ndk_library creates a stub library that exposes dummy implementation
|
|
|
|
// of functions and variables for use at build time only.
|
2017-06-24 00:06:31 +02:00
|
|
|
func ndkLibraryFactory() android.Module {
|
|
|
|
module := newStubLibrary()
|
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
|
|
|
|
return module
|
2016-06-18 01:45:24 +02:00
|
|
|
}
|