代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/arkui_napi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# Copyright (c) 2021 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("//build/ohos.gni")
import("//foundation/arkui/ace_engine/ace_config.gni")
import("napi.gni")
config("ace_napi_config") {
include_dirs = [
".",
"interfaces/inner_api",
"interfaces/kits",
"native_engine",
"native_engine/impl/ark",
"//third_party/libuv/include",
"//third_party/node/src",
]
defines = []
cflags_cc = []
if (is_mingw || is_mac || is_linux) {
defines += [ "PREVIEW" ]
}
if (current_os == "ohos" && current_cpu == "x86_64") {
defines += [ "SIMULATOR" ]
}
if (is_ohos) {
defines += [ "OHOS_PLATFORM" ]
} else if (is_mingw) {
defines += [ "WINDOWS_PLATFORM" ]
cflags_cc += [ "-std=c++17" ]
} else if (is_mac) {
defines += [ "MAC_PLATFORM" ]
} else if (is_linux) {
defines += [ "LINUX_PLATFORM" ]
cflags_cc += [ "-std=c++17" ]
} else if (is_cross_platform_build && target_os == "ios") {
defines += [ "IOS_PLATFORM" ]
} else if (is_cross_platform_build && target_os == "android") {
defines += [ "ANDROID_PLATFORM" ]
}
}
config("module_manager_config") {
include_dirs = [ "module_manager" ]
}
ohos_source_set("ace_napi_static") {
defines = []
public_configs = [ ":ace_napi_config" ]
deps = []
external_deps = []
sources = napi_sources
if (current_cpu == "arm64") {
defines += [ "_ARM64_" ]
}
if (is_cross_platform_build) {
if (napi_enable_container_scope) {
deps += [ ":ace_container_scope_static" ]
defines += [ "ENABLE_CONTAINER_SCOPE" ]
}
if (target_os == "android") {
libs = [ "log" ]
}
} else if (!is_mingw && !is_mac && !is_linux && is_ohos_standard_system) {
external_deps += [
"hilog:libhilog",
"hitrace:hitrace_meter",
"hitrace:libhitracechain",
"init:libbegetutil",
]
defines += [ "ENABLE_HITRACE" ]
if (product_name != "ohos-sdk" && napi_enable_container_scope) {
deps += [ ":ace_container_scope" ]
defines += [ "ENABLE_CONTAINER_SCOPE" ]
}
}
configs = [ "//third_party/icu/icu4c:icu_config" ]
# Use static libuv and icu for cross build
if (is_cross_platform_build) {
deps += [
"${ets_runtime_path}:libark_jsruntime_static",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/icu/icu4c:static_icui18n",
"//third_party/icu/icu4c:static_icuuc",
"//third_party/libuv:uv_static",
]
configs += [ "${ets_runtime_path}:ark_jsruntime_public_config" ]
} else {
deps += [
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
"//third_party/libuv:uv",
]
external_deps += [ "ets_runtime:libark_jsruntime" ]
}
cflags_cc = [ "-Wno-missing-braces" ]
subsystem_name = "arkui"
part_name = "napi"
}
if (is_cross_platform_build) {
ohos_source_set("ace_napi") {
deps = [ ":ace_napi_static" ]
public_configs = [ ":ace_napi_config" ]
subsystem_name = "arkui"
part_name = "napi"
}
} else {
ohos_shared_library("ace_napi") {
deps = [ ":ace_napi_static" ]
public_configs = [
":ace_napi_config",
":module_manager_config",
]
public_deps = [
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/libuv:uv",
]
subsystem_name = "arkui"
innerapi_tags = [ "platformsdk" ]
part_name = "napi"
}
}
config("container_scope_config") {
visibility = [ ":*" ]
include_dirs = [ "$ace_root/frameworks" ]
}
ohos_shared_library("ace_container_scope") {
public_configs = [ ":container_scope_config" ]
configs = [ "$ace_root:ace_config" ]
sources = [ "$ace_root/frameworks/core/common/container_scope.cpp" ]
subsystem_name = "arkui"
innerapi_tags = [ "platformsdk_indirect" ]
part_name = "napi"
}
ohos_source_set("ace_container_scope_static") {
public_configs = [ ":container_scope_config" ]
configs = [ "$ace_root:ace_config" ]
sources = [ "$ace_root/frameworks/core/common/container_scope.cpp" ]
}
group("napi_packages") {
deps = [ ":ace_napi" ]
}
ohos_ndk_library("libnapi_ndk") {
ndk_description_file = "./libnapi.ndk.json"
min_compact_version = "1"
output_name = "ace_napi"
}
ohos_ndk_headers("napi_header") {
dest_dir = "$ndk_headers_out_dir/napi"
sources = [
"interfaces/kits/napi/common.h",
"interfaces/kits/napi/native_api.h",
]
}
group("napi_packages_ndk") {
deps = [ ":libnapi_ndk" ]
}
if (!build_ohos_ndk && !is_cross_platform_build) {
group("napi_packages_test") {
testonly = true
deps = [
"sample/native_module_calc:calc",
"sample/native_module_calc:number",
"sample/native_module_callback:callback",
"sample/native_module_demo:demo",
"sample/native_module_netserver:netserver",
"sample/native_module_storage:storage",
"test/fuzztest:fuzztest",
"test/unittest:unittest",
]
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。