class="hide-preCode-box">

- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
然后在文件device\soc\bestechnic\bes2600\BUILD.gn里组装编译链接选项,相关代码片段如下:
# config bin from vendor/bestechnic//config.json
foreach(bin_file, bin_list) {
......
if (build_enable == "true") {
......
# force link invisible function ,which ar to lib
ldflags += [ "-Wl,--whole-archive" ]
foreach(force_link_lib, bin_file.force_link_libs) {
ldflags += [ "-l${force_link_lib}" ]
}
ldflags += [ "-lbsp${bsp_target_name}" ]
ldflags += [ "-Wl,--no-whole-archive" ]
......
}
}
class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}">
class="hide-preCode-box">
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
在文件vendor_asrmicro\xts_demo\config.json中,存在这样的配置片段。
"xts_list": [
{
"enable": "true",
"xts_modules": [
"ActsKvStoreTest",
"ActsDfxFuncTest",
"ActsHieventLiteTest",
"ActsSamgrTest",
"ActsParameterTest",
"ActsWifiServiceTest",
"ActsWifiIotTest",
"ActsBootstrapTest"
]
}
]
class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}">
然后,在文件device_soc_asrmicro\asr582x\liteos_m\sdk\BUILD.gn文件中组装编译链接选项。
foreach(xts_item, xts_list) {
xts_enable = xts_item.enable
if(xts_enable == "true")
{
defines = [ "CFG_HARMONY_SUPPORT" ]
ldflags += [
"-Llibs",
"-Wl,--whole-archive",
"-lhctest",
"-lbootstrap",
"-lbroadcast",
]
foreach(xts_module, xts_item.xts_modules) {
ldflags += [ "-lmodule_${xts_module}" ]
}
ldflags += [ "-Wl,--no-whole-archive" ]
}
}
class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}">
class="hide-preCode-box">
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
在产品解决方案配置文件中增加的bin_list、xts_list这些配置选项都不是config.json中的默认的标准选项。各个方案实现的风格差异比较大,建议使用第一种,写在文件vendor\goodix\gr5515_sk_xts_demo\BUILD.gn中会比较好。另外,需要使用hb命令触发debug版本(非debug版本不会触发测试编译)。
如果大家想更加深入的学习 OpenHarmony 开发的内容,不妨可以参考以下相关学习文档进行学习,助你快速提升自己:

- 搭建开发环境
- Windows 开发环境的搭建
- Ubuntu 开发环境搭建
- Linux 与 Windows 之间的文件共享
- ……

- 构建子系统
- 启动流程
- 子系统
- 分布式任务调度子系统
- 分布式通信子系统
- 驱动子系统
- ……



写在最后
- 如果你觉得这篇内容对你还蛮有帮助,我想邀请你帮我三个小忙:
- 点赞,转发,有你们的 『点赞和评论』,才是我创造的动力。
- 关注小编,同时可以期待后续文章ing🚀,不定期分享原创知识。
- 想要获取更多完整鸿蒙最新学习资源,请移步前往小编:
https://qr21.cn/FV7h05

data-report-view="{"mod":"1585297308_001","spm":"1001.2101.3001.6548","dest":"https://blog.csdn.net/maniuT/article/details/139804104","extend1":"pc","ab":"new"}">>
id="blogExtensionBox" style="width:400px;margin:auto;margin-top:12px" class="blog-extension-box"> class="blog_extension blog_extension_type2" id="blog_extension">
class="extension_official" data-report-click="{"spm":"1001.2101.3001.6471"}" data-report-view="{"spm":"1001.2101.3001.6471"}">
class="blog_extension_card_left">
class="blog_extension_card_cont">
鸿蒙开发学习资料领取!!!
class="blog_extension_card_cont_r">
微信名片
评论记录:
回复评论: