]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/platform-build-soong.git/commitdiff
Enable native bridge support by default for certain ndk modules
authordimitry <dimitry@google.com>
Thu, 9 May 2019 12:07:34 +0000 (14:07 +0200)
committerdimitry <dimitry@google.com>
Thu, 9 May 2019 14:37:16 +0000 (16:37 +0200)
The ndk_library, ndk_prebuilt_object and ndk_prebuilt_static_stl
modules are natural targets to have native bridge support enabled,
since they build user facing object which have to be supported for
translated architectures.

Bug: http://b/77159578
Test: make
Change-Id: Ic556f4c1c41e5b3dc92f9c290b4482dee8faed33

android/module.go
cc/ndk_library.go
cc/ndk_prebuilt.go

index fb5c00acb57cd8b2c1aefd72bf6001f0a6758e3d..3906fd7debc100ed30faa795050845e8c04d9f77 100644 (file)
@@ -1299,6 +1299,10 @@ func (a *ModuleBase) MakeAsPlatform() {
        a.commonProperties.Product_services_specific = boolPtr(false)
 }
 
+func (a *ModuleBase) EnableNativeBridgeSupportByDefault() {
+       a.commonProperties.Native_bridge_supported = boolPtr(true)
+}
+
 func (a *androidModuleContext) InstallInData() bool {
        return a.module.InstallInData()
 }
index c63b200a26aa13b3f59ad0d14256a341a85fb6b5..57fad7caaf564943fb5741405f972746b79bdc43 100644 (file)
@@ -382,5 +382,6 @@ func newStubLibrary() *Module {
 func ndkLibraryFactory() android.Module {
        module := newStubLibrary()
        android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
+       module.ModuleBase.EnableNativeBridgeSupportByDefault()
        return module
 }
index 8451295e5a0f325234ba3900fc0ae431c6adfd89..026ff220a53bc48fa9e88441438e14b5b027d382 100644 (file)
@@ -70,6 +70,7 @@ func (*ndkPrebuiltObjectLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
 // ./prebuilts/ndk/current/platforms/android-<sdk_version>/arch-$(HOST_ARCH)/usr/lib/<NAME>.o.
 func ndkPrebuiltObjectFactory() android.Module {
        module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
+       module.ModuleBase.EnableNativeBridgeSupportByDefault()
        module.linker = &ndkPrebuiltObjectLinker{
                objectLinker: objectLinker{
                        baseLinker: NewBaseLinker(nil),
@@ -134,6 +135,7 @@ func ndkPrebuiltStaticStlFactory() android.Module {
        }
        module.installer = nil
        module.Properties.HideFromMake = true
+       module.ModuleBase.EnableNativeBridgeSupportByDefault()
        return module.Init()
 }