提交 a3969820 编写于 作者: A arvinzzz

refactor: sysroot部件化

close: #I5HF8S
Signed-off-by: Narvinzzz <zhaotianyu9@huawei.com>
Change-Id: I85e5d77620a1cc1895662a8b4aa131598387acaa
上级 5c6061c1
......@@ -48,14 +48,14 @@ Common compilation modes of user-mode programs include:
Example:
```
clang --target=arm-liteos --sysroot=prebuilts/lite/sysroot -o helloworld helloworld.c
clang --target=arm-liteos --sysroot=sysroot -o helloworld helloworld.c
```
Before running the **clang** command, install the LLVM compiler. For details, see [Installing LLVM](../quick-start/quickstart-lite-steps-hi3861-setting.md).
**--target=arm-liteos**: specifies the compilation platform, which is arm-liteos.
**--sysroot=$\{YOUR\_ROOT\_PATH\}/prebuilts/lite/sysroot**: specifies the directory in which you can search for the header file and the dependent standard libraries.
**--sysroot=$\{YOUR\_ROOT\_OUT\_PATH\}/sysroot**: specifies the directory in which you can search for the header file and the dependent standard libraries.
A user-mode program can be started in either of the following ways:
......
......@@ -348,7 +348,7 @@ The following steps show how to configure and modify the toolchains for cross-co
#toolchain: follow up-layer, depend on $ohos_build_compiler
if (ohos_build_compiler == "clang") {
CMAKE_TOOLCHAIN_FLAG = "-DOHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
CMAKE_TOOLCHAIN_FLAG = "-DOHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
} else {
CMAKE_TOOLCHAIN_FLAG = ""
}
......
......@@ -262,9 +262,9 @@ if (ohos_build_thirdparty_migrated_from_fuchisa == true) {
TEST_ENABLE = "YES"
if (TEST_ENABLE == "YES") {
MAKE_COMMAND = "make test OHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
MAKE_COMMAND = "make test OHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
} else {
MAKE_COMMAND = "make OHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
MAKE_COMMAND = "make OHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
}
```
......
......@@ -219,7 +219,7 @@ CMake方式可通过指定工具链进行交叉编译,修改并编译该库,
#toolchain:follow up-layer,depend on $ohos_build_compiler
if (ohos_build_compiler == "clang") {
CMAKE_TOOLCHAIN_FLAG = "-DOHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
CMAKE_TOOLCHAIN_FLAG = "-DOHOS_SYSROOT_PATH=${root_out_dir}sysroot"
} else {
CMAKE_TOOLCHAIN_FLAG = ""
}
......
......@@ -173,9 +173,9 @@ if (ohos_build_thirdparty_migrated_from_fuchisa == true) {
TEST_ENABLE = "YES"
if (TEST_ENABLE == "YES") {
MAKE_COMMAND = "make test OHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
MAKE_COMMAND = "make test OHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
} else {
MAKE_COMMAND = "make OHOS_SYSROOT_PATH=${ohos_root_path}prebuilts/lite/sysroot/"
MAKE_COMMAND = "make OHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
}
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册