add build targets section

Signed-off-by: huanghuijin <huanghuijin@huawei.com>
This commit is contained in:
huanghuijin 2024-09-04 20:48:20 +08:00
parent a9eeb24e2e
commit 9a419f7eff
5 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,11 @@
### Description
### Steps to reproduce
### Error results

View File

@ -0,0 +1,11 @@
### 该问题是怎么引起的?
### 重现步骤
### 报错信息

View File

@ -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

View File

@ -0,0 +1,19 @@
### 相关的Issue
### 原因(目的、解决的问题等)
### 描述(做了什么,变更了什么)
### 自检结果(结果截图添加到下面)
- [ ] 是否通过C语法扫描
- [ ] 是否通过注释规则扫描
- [ ] 是否更新json文件
- [ ] 实现代码是否已经合入
- [ ] 目标是否已经添加到build仓ndk依赖目标里
### 兼容性影响评估如有影响请写明Y/N
- [ ] 不兼容
- [ ] 是否经过评审

View File

@ -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文档将无法生成。