• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

LOCAL_EXPORT_C_INCLUDES和LOCALC_INCLUDES的差别

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

http://stackoverflow.com/questions/6595208/what-does-this-line-mean-local-export-c-includes

LOCAL_EXPORT_C_INCLUDES和LOCALC_INCLUDES 的差别。同理LOCAL_EXPORT_CFLAGS与LOCAL_CFLAGS也一样

编译某模块是,如果它依赖别的模块,那么别的模块的LOCAL_EXPORT*类的值,会自动加入到本模块。(但是反过来不会有作用)

LOCAL_EXPORT_CFLAGS
Define this variable to record a set of C/C++ compiler flags that will
be added to the LOCAL_CFLAGS definition of any other module that uses
this one with LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES.

For example, consider the module 'foo' with the following definition:

   include $(CLEAR_VARS)
   LOCAL_MODULE := foo
   LOCAL_SRC_FILES := foo/foo.c
   LOCAL_EXPORT_CFLAGS :=-DFOO=1
   include $(BUILD_STATIC_LIBRARY)

And another module, named 'bar' that depends on it as:

   include $(CLEAR_VARS)
   LOCAL_MODULE := bar
   LOCAL_SRC_FILES := bar.c
   LOCAL_CFLAGS :=-DBAR=2
   LOCAL_STATIC_LIBRARIES := foo
   include $(BUILD_SHARED_LIBRARY)

Then, the flags '-DFOO=1 -DBAR=2' will be passed to the compiler when
building bar.c

Exported flags are prepended to your module's LOCAL_CFLAGS so you can
easily override them. They are also transitive: if 'zoo' depends on
'bar' which depends on 'foo', then 'zoo' will also inherit all flags
exported by 'foo'.

Finally, exported flags are not used when building the module that
exports them. In the above example, -DFOO=1 would not be passed to the
compiler when building foo/foo.c.

LOCAL_EXPORT_CPPFLAGS
Same as LOCAL_EXPORT_CFLAGS, but for C++ flags only.

LOCAL_EXPORT_C_INCLUDES
Same as LOCAL_EXPORT_CFLAGS, but for C include paths.
This can be useful if 'bar.c' wants to include headers
that are provided by module 'foo'.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C#中DataGridView属性说明(转载)发布时间:2022-07-13
下一篇:
Linux系统下输出某进程内存占用信息的c程序实现发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap