From 9a419f7eff1572744bb2e7e9085a00f42d1f9fc6 Mon Sep 17 00:00:00 2001 From: huanghuijin Date: Wed, 4 Sep 2024 20:48:20 +0800 Subject: [PATCH] add build targets section Signed-off-by: huanghuijin --- .gitee/ISSUE_TEMPLATE.en.md | 11 +++++++++++ .gitee/ISSUE_TEMPLATE.zh-CN.md | 11 +++++++++++ .gitee/PULL_REQUEST_TEMPLATE.en.md | 19 +++++++++++++++++++ .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md | 19 +++++++++++++++++++ docs/howto_add.md | 18 +++++++++++++++++- 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .gitee/ISSUE_TEMPLATE.en.md create mode 100644 .gitee/ISSUE_TEMPLATE.zh-CN.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.en.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md diff --git a/.gitee/ISSUE_TEMPLATE.en.md b/.gitee/ISSUE_TEMPLATE.en.md new file mode 100644 index 000000000..f1a77b33d --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.en.md @@ -0,0 +1,11 @@ +### Description? + + + +### Steps to reproduce + + + +### Error results + + diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100644 index 000000000..84543046a --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,11 @@ +### 该问题是怎么引起的? + + + +### 重现步骤 + + + +### 报错信息 + + diff --git a/.gitee/PULL_REQUEST_TEMPLATE.en.md b/.gitee/PULL_REQUEST_TEMPLATE.en.md new file mode 100644 index 000000000..073fa0eac --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.en.md @@ -0,0 +1,19 @@ +### Issue + + +### Reason + + +### how to fix + + +### Test (libc-test is mandatory, but not limited to) +- [ ] pass c syntax checker +- [ ] pass interface checker +- [ ] add symbol to json +- [ ] merge the implementation +- [ ] add target to ndk.targets in build + +### Compatibility impact assessment, please indicate (Y/N) +- [ ] not compatible + - [ ] evaluated by committee diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100644 index 000000000..5af541eea --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,19 @@ +### 相关的Issue + + +### 原因(目的、解决的问题等) + + +### 描述(做了什么,变更了什么) + + +### 自检结果(结果截图添加到下面) +- [ ] 是否通过C语法扫描 +- [ ] 是否通过注释规则扫描 +- [ ] 是否更新json文件 +- [ ] 实现代码是否已经合入 +- [ ] 目标是否已经添加到build仓ndk依赖目标里 + +### 兼容性影响评估,如有影响请写明(Y/N) +- [ ] 不兼容 + - [ ] 是否经过评审 diff --git a/docs/howto_add.md b/docs/howto_add.md index aeb70e52f..9ff64faba 100644 --- a/docs/howto_add.md +++ b/docs/howto_add.md @@ -17,7 +17,7 @@ GN语法,https://zhuanlan.zhihu.com/p/136954435 ``` ./build.sh --product-name ohos-sdk ``` -更加详细的SDK编译指导,请参考[如何编译full-SDK](http://https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-compile-guide.md)。 +更加详细的SDK编译指导,请参考[如何编译full-SDK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-compile-guide.md)。 ## 编译结果 @@ -113,6 +113,22 @@ sources = [ 这个模板只针对mac/win/linux平台的几个工具链,一般开发同学使用不到。 输入参数含义同ohos_ndk_headers。ohos_ndk_toolchains目标的默认dest_dir为$root_out_dir/sdk-native/sysroot/usr/lib +## 添加到build系统 + +上面添加的目标需要加到build的[ndk依赖目标](https://gitee.com/openharmony/build/blob/master/ohos/ndk/ndk_targets.gni)文件的_ndk_library_targets变量里面,这样在编译 +SDK的时候,才会被依赖到。 + +新增如下 +``` +_ndk_library_targets = [ + "//interface/sdk_c/sensors/miscdevice/vibrator:lib_vibrator_ndk", + "//interface/sdk_c/sensors/miscdevice/vibrator:ndk_vibrator_header", + ... + "//interface/sdk_c/sensors/sensor:libsensor_ndk", + "//interface/sdk_c/sensors/sensor:sensor_ndk_header", +] +``` + ## 文档 C API的文档生成在docs目录,需要安装doxygen工具,在ubuntu上使用`sudo apt-get install doxygen`即可安装。如果编译机上没有安装doxygen,文档将无法生成。