ds211107
2018-12-27 14:23
浏览 19

如何根据以Android.bp w.r.t. 宋?

I'm writing a wrapper over a Soong's module type, where I want to add some additional checks.

First, I have registered my custom module type :

func init() {
    android.RegisterModuleType("my_cc_library_static", MyStaticLibrary)
}

Second, I've defined the function for this -

func MyStaticLibrary() android.Module {
    m, library := cc.NewLibrary(android.HostAndDeviceSupported)
    library.BuildOnlyStatic()
    module := m.Init()
    prop := module.GetProperties()
    for _, properties := range prop {
        propertiesValue := reflect.ValueOf(properties).Elem()
        fmt.Printf("Prop Value Ele : %+v
  ", propertiesValue)
    }
}

The output of this shows an empty structure. However, I expect this struct to be filled with the values provided in Android.bp of the component.

Chances are the module.GetPropeties() should not be called so early (in registration phase), but then I'm not exactly sure where else to call. Or do I need to add any Hooks ?

I want to read Cflags from Android.bp and based on it's value, need to append/remove some additional cflags.

图片转代码服务由CSDN问答提供 功能建议

我正在为Soong的模块类型编写包装器,我想在其中添加一些其他检查。

首先,我已经注册了自定义模块类型:

  func init(){
 android.RegisterModuleType(“ my_cc_library_static”,  MyStaticLibrary)
} 
   
 
 

第二,我为此定义了函数-

  func MyStaticLibrary(  )android.Module {
m,library:= cc.NewLibrary(android.HostAndDeviceSupported)
 library.BuildOnlyStatic()
 module:= m.Init()
 prop:= module.GetProperties()
为_  ,properties:= range prop {
 propertiesValue:= reflect.ValueOf(properties).Elem()
 fmt.Printf(“ Prop Value Ele:%+ v 
”,propertiesValue)
} 
} 
    
 
 

其输出显示为空结构。 但是,我希望此结构被该组件的Android.bp中提供的值填充。

机会是模块。GetPropeties()不应提早调用(在注册阶段) ),但我不确定要在哪里打电话。 还是需要添加任何挂钩?

我想从Android.bp读取Cflags,并根据其值添加/删除一些其他的cflags。 \ n

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐 更多相似问题