1 Star 0 Fork 119

fuzijian / arkcompiler_toolchain

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BUILD.gn 5.26 KB
一键复制 编辑 原始数据 按行查看 历史
duning 提交于 2023-11-24 11:04 . 支持命令行-D拉起调试服务
# Copyright (c) 2021-2022 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("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
config("ark_platform_config") {
configs = [ ":hiviewdfx_config" ]
defines = []
if (is_ohos) {
defines += [
"OHOS_PLATFORM",
"UNIX_PLATFORM",
]
} else if (is_linux) {
defines += [
"LINUX_PLATFORM",
"UNIX_PLATFORM",
]
} else if (is_mingw) {
defines += [ "WINDOWS_PLATFORM" ]
} else if (target_os == "android") {
if (!ark_standalone_build) {
defines += [
"ANDROID_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
} else if (target_os == "ios") {
defines += [
"UNIX_PLATFORM",
"IOS_PLATFORM",
]
} else if (is_mac) {
defines += [
"MAC_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
}
config("ark_toolchain_common_config") {
configs = [
":ark_platform_config",
":ark_toolchain_public_config",
":hiviewdfx_config",
]
defines = [ "PANDA_ENABLE_LTO" ]
cflags_cc = [
"-Wall",
"-Wshadow",
"-Werror",
"-Wextra",
"-pedantic",
"-Wno-invalid-offsetof",
"-Wno-gnu-statement-expression",
"-pipe",
"-Wdate-time",
"-funwind-tables",
"-fasynchronous-unwind-tables",
"-Wformat=2",
]
if (is_linux) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_LINUX",
"PANDA_USE_FUTEX",
]
} else if (is_mingw) {
cflags_cc += [
"-std=c++17",
"-Wno-ignored-attributes",
]
defines += [
"PANDA_TARGET_WINDOWS",
"_CRTBLD",
"__LIBMSVCRT__",
]
} else if (is_mac) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_MACOS",
]
} else if (target_os == "android") {
defines += [
"PANDA_TARGET_ANDROID",
"PANDA_TARGET_UNIX",
"PANDA_USE_FUTEX",
]
if (!ark_standalone_build) {
defines += [ "ENABLE_ANLOG" ]
}
} else if (target_os == "ios") {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_IOS",
]
} else {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_USE_FUTEX",
]
if (!is_standard_system && (current_cpu != "arm" || is_wearable_product)) {
defines += [ "PANDA_TARGET_MOBILE" ]
}
}
if (is_debug) {
cflags_cc += [
"-O0",
"-ggdb3",
]
} else {
defines += [ "NDEBUG" ]
}
}
config("ark_toolchain_public_config") {
defines = []
# debug is not compatible with ios for now
if (!is_mingw && !is_mac && target_os != "ios") {
defines += [
"ECMASCRIPT_SUPPORT_CPUPROFILER",
"ECMASCRIPT_SUPPORT_HEAPPROFILER",
"ECMASCRIPT_SUPPORT_HEAPSAMPLING",
"ECMASCRIPT_SUPPORT_SNAPSHOT",
"ECMASCRIPT_SUPPORT_DEBUGGER",
]
} else if (target_os == "android") {
defines += [
"ECMASCRIPT_SUPPORT_CPUPROFILER",
"ECMASCRIPT_SUPPORT_DEBUGGER",
]
}
include_dirs = [
# Dependent on runtime_core include
"$ark_root",
"$js_root",
".",
]
}
# ecmascript unit testcase config
config("toolchain_test_config") {
visibility = [
"./test/fuzztest/*",
"./tooling/test/*",
"./websocket/test/*",
]
configs = [ ":ark_toolchain_common_config" ]
ldflags = [ "-Wl,-rpath=\$ORIGIN/" ]
}
group("ark_toolchain_packages") {
deps = []
if (host_os != "mac") {
deps += [
"./arkdbjs:arkdebugger",
"./inspector:ark_debugger",
"./inspector:connectserver_debugger",
"./tooling:libark_ecma_debugger",
"./tooling/client:libark_client",
"./tooling/client/ark_cli:arkdb",
]
}
}
group("ark_toolchain_unittest") {
testonly = true
deps = []
if (host_os != "mac") {
deps += [
"//arkcompiler/toolchain/tooling/test:unittest",
"//arkcompiler/toolchain/websocket/test:unittest",
]
if (is_ohos && is_standard_system) {
deps += [ "//arkcompiler/toolchain/test/fuzztest:fuzztest" ]
}
}
}
group("ark_toolchain_host_unittest") {
testonly = true
deps = []
if (host_os != "mac") {
# js unittest
deps += [
"//arkcompiler/toolchain/tooling/test:host_unittest",
"//arkcompiler/toolchain/websocket/test:host_unittest",
]
}
}
group("ark_js_host_unittest") {
testonly = true
deps = [
"//arkcompiler/ets_runtime:ark_runtime_host_unittest",
"//arkcompiler/toolchain:ark_toolchain_host_unittest",
]
}
C++
1
https://gitee.com/Freizal/arkcompiler_toolchain.git
git@gitee.com:Freizal/arkcompiler_toolchain.git
Freizal
arkcompiler_toolchain
arkcompiler_toolchain
master

搜索帮助