提交 674ae22d 编写于 作者: O openharmony_ci 提交者: Gitee

!204 从Make编译切换到GN编译

Merge pull request !204 from Caoruihong/build_gn
......@@ -15,6 +15,7 @@ config("cpu_arch") {
cflags = target_arch_cflags
cflags_cc = cflags
ldflags = cflags
asmflags = cflags
}
config("language_c") {
......@@ -113,6 +114,10 @@ config("ohos_clang") {
"__BUILD_LINUX_WITH_CLANG",
]
}
ldflags = [
"-fuse-ld=lld",
"--rtlib=compiler-rt",
]
}
config("release") {
......
......@@ -76,9 +76,10 @@ if (board_toolchain != "" && use_board_toolchain) {
} else if (board_toolchain_type == "clang") {
ohos_current_cc_command = "${compile_prefix}clang$toolchain_cmd_suffix"
ohos_current_cxx_command = "${compile_prefix}clang++$toolchain_cmd_suffix"
ohos_current_ar_command = "${compile_prefix}llvm-ar$toolchain_cmd_suffix"
compile_prefix += "llvm-"
ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix"
ohos_current_ld_command = ohos_current_cc_command
ohos_current_strip_command = "$compile_prefix/llvm-objcopy$toolchain_cmd_suffix --strip-all"
ohos_current_strip_command = "${compile_prefix}objcopy$toolchain_cmd_suffix --strip-all"
default_target_configs = [ "//build/lite/config:clang_opt" ]
}
# Overwrite ld cmd by customed cmd.
......@@ -89,13 +90,13 @@ if (board_toolchain != "" && use_board_toolchain) {
# OHOS default toolchain
ohos_build_compiler = "clang"
ohos_clang_toolchain_dir = rebase_path("${ohos_build_compiler_dir}/bin")
compile_prefix += rebase_path("${ohos_build_compiler_dir}/bin")
ohos_current_cc_command = "${compile_prefix}/clang$toolchain_cmd_suffix"
ohos_current_cxx_command = "${compile_prefix}/clang++$toolchain_cmd_suffix"
ohos_current_ar_command = "${compile_prefix}/llvm-ar$toolchain_cmd_suffix"
compile_prefix += "$ohos_clang_toolchain_dir/"
ohos_current_cc_command = "${compile_prefix}clang$toolchain_cmd_suffix"
ohos_current_cxx_command = "${compile_prefix}clang++$toolchain_cmd_suffix"
compile_prefix += "llvm-"
ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix"
ohos_current_ld_command = ohos_current_cxx_command
ohos_current_strip_command =
"$ohos_clang_toolchain_dir/llvm-objcopy$toolchain_cmd_suffix --strip-all"
ohos_current_strip_command = "${compile_prefix}objcopy$toolchain_cmd_suffix --strip-all"
set_default_toolchain("//build/lite/toolchain:linux_x86_64_ohos_clang")
default_target_configs = [ "//build/lite/config:ohos_clang" ]
default_target_configs += [ "//build/lite/config:clang_opt" ]
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os
import sys
def main():
return os.WEXITSTATUS(os.system(' '.join(sys.argv[1:])))
if __name__ == '__main__':
sys.exit(main())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册