2024-03-19 13:11:53 +00:00
|
|
|
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
2021-06-01 16:05:19 +00:00
|
|
|
# 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.
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
import("//build/config/clang/clang.gni")
|
|
|
|
import("//build/ohos.gni")
|
|
|
|
import("//build/test.gni")
|
2021-06-01 16:05:19 +00:00
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
# Config args
|
|
|
|
declare_args() {
|
2021-12-30 16:40:17 +00:00
|
|
|
# ace debug flag, enable debug features: like dcheck, thread-checker, mem-monitor...
|
2021-09-27 13:44:21 +00:00
|
|
|
enable_ace_debug = false
|
|
|
|
|
2021-12-30 16:40:17 +00:00
|
|
|
# show the instance id in logs.
|
|
|
|
enable_ace_instance_log = true
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
# Disable glfw window to build for PC preview scenario.
|
|
|
|
enable_glfw_window = false
|
2022-01-27 03:09:19 +00:00
|
|
|
|
2022-08-05 13:38:51 +00:00
|
|
|
# Enable metal in iOS or MacOS
|
|
|
|
shell_enable_metal = false
|
2022-09-01 01:54:32 +00:00
|
|
|
|
2023-11-21 12:40:24 +00:00
|
|
|
# Enable pgo for building.
|
|
|
|
ace_engine_feature_enable_pgo = false
|
|
|
|
|
|
|
|
# Set pgo profdata path
|
|
|
|
ace_engine_feature_pgo_path = ""
|
|
|
|
|
|
|
|
# Enable atomic for building.
|
|
|
|
ace_engine_feature_enable_atomic = false
|
|
|
|
|
2024-08-05 08:41:34 +00:00
|
|
|
# Set Instruction Sched Model
|
|
|
|
ace_engine_feature_sched_model = ""
|
|
|
|
|
2022-09-01 01:54:32 +00:00
|
|
|
# Enable test coverage
|
|
|
|
ace_engine_feature_enable_coverage = false
|
2022-09-06 08:46:52 +00:00
|
|
|
|
2024-04-24 01:34:53 +00:00
|
|
|
# Enalbe point light
|
|
|
|
ace_engine_feature_enable_point_light = true
|
|
|
|
|
2024-08-02 07:01:58 +00:00
|
|
|
# Set atomicservice basic engine so path
|
|
|
|
ace_engine_feature_asbng_path = ""
|
|
|
|
|
2023-05-20 07:12:17 +00:00
|
|
|
# Sanitize debug
|
|
|
|
ace_sanitize_debug = false
|
2023-08-12 09:43:07 +00:00
|
|
|
|
|
|
|
# Enable when build for text engine adapter
|
2023-08-12 09:43:38 +00:00
|
|
|
enable_graphic_text_gine = true
|
2024-03-14 14:39:33 +00:00
|
|
|
|
2024-06-27 06:24:29 +00:00
|
|
|
# Enable split_mode support
|
2024-07-09 14:21:39 +00:00
|
|
|
ace_engine_feature_enable_split_mode = false
|
2024-07-18 03:14:47 +00:00
|
|
|
|
|
|
|
# Enable navigation split mode support
|
|
|
|
ace_engine_feature_enable_nav_split_mode = false
|
2024-11-09 12:17:23 +00:00
|
|
|
|
|
|
|
# Enable aps framework support
|
|
|
|
ace_engine_feature_enable_aps = false
|
2024-11-19 08:38:48 +00:00
|
|
|
|
|
|
|
# Enable wearable product support
|
|
|
|
ace_engine_feature_wearable = false
|
2021-09-27 13:44:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enable_dump_drawcmd = false
|
2023-11-06 08:45:11 +00:00
|
|
|
is_ohos_standard_system = is_standard_system && !is_arkui_x
|
2021-09-27 13:44:21 +00:00
|
|
|
use_mingw_win = "${current_os}_${current_cpu}" == "mingw_x86_64"
|
2022-07-01 01:52:03 +00:00
|
|
|
use_mac = "${current_os}_${current_cpu}" == "mac_x64" ||
|
2022-07-06 15:43:22 +00:00
|
|
|
"${current_os}_${current_cpu}" == "mac_arm64"
|
2022-10-12 11:48:16 +00:00
|
|
|
use_ios = "${current_os}_${current_cpu}" == "ios_x64" ||
|
|
|
|
"${current_os}_${current_cpu}" == "ios_arm64"
|
2022-09-01 02:07:35 +00:00
|
|
|
use_linux = "${current_os}_${current_cpu}" == "linux_x64"
|
2021-09-27 13:44:21 +00:00
|
|
|
|
2024-03-19 13:11:53 +00:00
|
|
|
use_hilog = is_mingw || is_mac || is_linux || is_ohos || is_ohos_standard_system
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
# Config path
|
2022-04-26 12:00:52 +00:00
|
|
|
ace_root = "//foundation/arkui/ace_engine"
|
2024-03-14 09:22:23 +00:00
|
|
|
hilog_root = "//base/hiviewdfx/hilog"
|
2023-08-12 09:43:07 +00:00
|
|
|
ace_napi_frameworks = "//foundation/arkui/ace_engine/frameworks"
|
2022-04-26 12:00:52 +00:00
|
|
|
ace_napi = "//foundation/arkui/napi"
|
2024-03-19 13:11:53 +00:00
|
|
|
arkui_root = "//foundation/arkui"
|
2023-03-12 11:14:23 +00:00
|
|
|
ace_graphic = "//foundation/graphic/graphic_2d"
|
2021-06-01 16:05:19 +00:00
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
if (!defined(aosp_libs_dir)) {
|
|
|
|
aosp_libs_dir = "//prebuilts/aosp_prebuilt_libs/asdk_libs"
|
|
|
|
}
|
|
|
|
libs_root = "${aosp_libs_dir}/sdk"
|
2021-06-01 16:05:19 +00:00
|
|
|
|
2022-06-27 03:09:48 +00:00
|
|
|
ability_runtime_path = "//foundation/ability/ability_runtime"
|
2023-07-12 01:28:19 +00:00
|
|
|
graphic_2d_path = "//foundation/graphic/graphic_2d"
|
2023-03-02 12:02:10 +00:00
|
|
|
ark_ets_path = "//arkcompiler/ets_runtime"
|
2023-04-08 14:58:15 +00:00
|
|
|
crossplatform_plugin_root = "//plugins"
|
2023-07-13 03:19:04 +00:00
|
|
|
crossplatform_multimedia_root = "//foundation/multimedia"
|
2023-04-17 08:55:01 +00:00
|
|
|
skia_root_new = "//third_party/skia"
|
2024-05-27 07:16:54 +00:00
|
|
|
|
|
|
|
# arkui-x
|
|
|
|
flutter_root = "//third_party/flutter"
|
|
|
|
ace_flutter_engine_root = "$flutter_root/build"
|
2024-05-31 09:11:23 +00:00
|
|
|
ark_toolchain_path = "//arkcompiler/toolchain"
|
2021-06-01 16:05:19 +00:00
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
# Config toolchain
|
|
|
|
windows_buildtool = "//build/toolchain/mingw:mingw_x86_64"
|
|
|
|
if (!defined(default_aosp_source_dir)) {
|
|
|
|
default_aosp_source_dir = "/"
|
|
|
|
}
|
|
|
|
objcopy_default = "${default_aosp_source_dir}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/objcopy"
|
|
|
|
objcopy_mingw = "${default_aosp_source_dir}/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/bin/objcopy"
|
2022-06-17 02:35:39 +00:00
|
|
|
objcopy_x86_64 = "${default_clang_base_path}/bin/llvm-objcopy"
|
2022-07-06 15:43:22 +00:00
|
|
|
if ("${current_os}_${current_cpu}" == "mac_arm64") {
|
|
|
|
mac_buildtool = "//build/toolchain/mac:clang_arm64"
|
|
|
|
} else if ("${current_os}_${current_cpu}" == "mac_x64") {
|
2022-07-01 01:52:03 +00:00
|
|
|
mac_buildtool = "//build/toolchain/mac:clang_x64"
|
|
|
|
}
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
objcopy_clang = "$clang_base_path/bin/llvm-objcopy"
|
|
|
|
|
2023-04-13 01:25:04 +00:00
|
|
|
if (is_ohos_standard_system) {
|
2024-06-13 08:27:19 +00:00
|
|
|
if (host_cpu == "arm64") {
|
2024-06-19 02:20:02 +00:00
|
|
|
objcopy_default =
|
|
|
|
"//prebuilts/clang/ohos/linux-aarch64/llvm/bin/llvm-objcopy"
|
2024-06-13 08:27:19 +00:00
|
|
|
} else {
|
2024-06-19 02:20:02 +00:00
|
|
|
objcopy_default =
|
|
|
|
"//prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-objcopy"
|
2024-06-13 08:27:19 +00:00
|
|
|
}
|
2023-11-06 08:45:11 +00:00
|
|
|
} else if (is_arkui_x) {
|
2022-04-15 06:28:03 +00:00
|
|
|
if (host_os == "mac") {
|
|
|
|
objcopy_default = objcopy_clang
|
|
|
|
} else if (defined(aosp_objcopy)) {
|
|
|
|
objcopy_default = aosp_objcopy
|
|
|
|
}
|
2021-09-14 07:32:51 +00:00
|
|
|
}
|
2021-09-27 13:44:21 +00:00
|
|
|
|
2022-09-09 09:29:55 +00:00
|
|
|
# Config subsystem name
|
|
|
|
ace_engine_subsystem = "arkui"
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
# Config part name
|
2023-04-13 01:25:04 +00:00
|
|
|
if (is_ohos_standard_system) {
|
2022-06-24 01:34:59 +00:00
|
|
|
ace_engine_part = "ace_engine"
|
2023-06-27 11:33:27 +00:00
|
|
|
hilog_deps = [ "hilog:libhilog" ]
|
2022-07-12 02:35:51 +00:00
|
|
|
ark_runtime_path = "//arkcompiler/runtime_core"
|
2021-09-27 13:44:21 +00:00
|
|
|
} else {
|
2023-11-06 08:45:11 +00:00
|
|
|
if (is_arkui_x) {
|
2022-03-22 09:21:16 +00:00
|
|
|
ace_engine_part = "ace_engine_cross"
|
|
|
|
} else {
|
|
|
|
ace_engine_part = "ace_engine_full"
|
|
|
|
}
|
2021-09-27 13:44:21 +00:00
|
|
|
hilog_deps = [ "hilog:libhilog" ]
|
2022-08-15 10:58:17 +00:00
|
|
|
ark_runtime_path = "//arkcompiler/runtime_core"
|
2021-09-27 13:44:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Config defines
|
|
|
|
ace_wearable_defines = [ "WEARABLE_PRODUCT" ]
|
|
|
|
ace_ivi_defines = [ "IVI_PRODUCT" ]
|
2022-10-27 12:08:42 +00:00
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
ace_common_defines = [ "ACE_LOG_TAG=\"Ace\"" ]
|
|
|
|
|
2024-03-19 13:11:53 +00:00
|
|
|
if (use_hilog) {
|
|
|
|
ace_common_defines += [ "USE_HILOG" ]
|
|
|
|
}
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
if (enable_glfw_window) {
|
|
|
|
ace_common_defines += [ "USE_GLFW_WINDOW" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use_clang_coverage) {
|
|
|
|
ace_common_defines += [ "USE_CLANG_COVERAGE" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_ace_debug) {
|
|
|
|
ace_common_defines += [ "ACE_DEBUG" ]
|
2021-12-30 16:40:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_ace_instance_log) {
|
|
|
|
ace_common_defines += [ "ACE_INSTANCE_LOG" ]
|
2021-09-27 13:44:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_dump_drawcmd) {
|
|
|
|
ace_common_defines += [ "DUMP_DRAW_CMD" ]
|
|
|
|
}
|
|
|
|
|
2024-08-29 06:45:34 +00:00
|
|
|
if (build_variant == "user") {
|
|
|
|
ace_common_defines += [ "IS_RELEASE_VERSION" ]
|
|
|
|
}
|
|
|
|
|
2023-10-13 07:56:05 +00:00
|
|
|
ace_use_new_skia = true
|
2023-04-17 08:55:01 +00:00
|
|
|
|
2023-07-14 09:06:46 +00:00
|
|
|
ace_use_rosen_drawing = false
|
|
|
|
if (defined(use_rosen_drawing) && use_rosen_drawing) {
|
|
|
|
ace_use_rosen_drawing = true
|
|
|
|
ace_common_defines += [ "USE_ROSEN_DRAWING" ]
|
|
|
|
}
|
|
|
|
|
2023-08-12 09:43:07 +00:00
|
|
|
if (enable_graphic_text_gine) {
|
|
|
|
ace_common_defines += [ "USE_GRAPHIC_TEXT_GINE" ]
|
|
|
|
}
|
|
|
|
|
2022-04-19 06:12:11 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
2022-05-05 08:03:13 +00:00
|
|
|
defined(global_parts_info.account_os_account)) {
|
2022-04-19 06:12:11 +00:00
|
|
|
os_account_exists = true
|
|
|
|
ace_common_defines += [ "OS_ACCOUNT_EXISTS" ]
|
|
|
|
} else {
|
|
|
|
os_account_exists = false
|
|
|
|
}
|
|
|
|
|
2023-04-24 12:29:21 +00:00
|
|
|
if (is_emulator) {
|
|
|
|
ace_common_defines += [ "IS_EMULATOR" ]
|
|
|
|
}
|
|
|
|
|
2023-02-20 01:41:37 +00:00
|
|
|
if (defined(global_parts_info)) {
|
2023-08-01 12:56:46 +00:00
|
|
|
if (defined(global_parts_info.resourceschedule_frame_aware_sched) ||
|
|
|
|
defined(
|
|
|
|
global_parts_info.hmosresourceschedule_frame_aware_sched_override)) {
|
2023-02-20 01:41:37 +00:00
|
|
|
frame_trace_support = true
|
|
|
|
} else {
|
|
|
|
frame_trace_support = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-15 07:10:49 +00:00
|
|
|
if (defined(global_parts_info.multimedia_camera_framework)) {
|
|
|
|
enable_camera_framework = true
|
|
|
|
ace_common_defines += [ "CAMERA_FRAMEWORK_EXISTS" ]
|
|
|
|
} else {
|
|
|
|
enable_camera_framework = false
|
|
|
|
}
|
|
|
|
|
2024-08-06 07:27:31 +00:00
|
|
|
if (defined(global_parts_info.multimedia_player_framework) || is_arkui_x) {
|
2023-11-15 07:10:49 +00:00
|
|
|
enable_player_framework = true
|
|
|
|
ace_common_defines += [ "PLAYER_FRAMEWORK_EXISTS" ]
|
|
|
|
} else {
|
|
|
|
enable_player_framework = false
|
|
|
|
}
|
|
|
|
|
2024-07-16 06:05:19 +00:00
|
|
|
if (defined(global_parts_info.multimedia_audio_framework)) {
|
|
|
|
enable_audio_framework = true
|
|
|
|
ace_common_defines += [ "AUDIO_FRAMEWORK_EXISTS" ]
|
|
|
|
} else {
|
|
|
|
enable_audio_framework = false
|
|
|
|
}
|
|
|
|
|
2023-05-04 07:23:41 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
2023-09-02 06:18:23 +00:00
|
|
|
defined(global_parts_info.security_security_component_manager)) {
|
2023-05-04 07:23:41 +00:00
|
|
|
security_component_enable = true
|
|
|
|
ace_common_defines += [ "SECURITY_COMPONENT_ENABLE" ]
|
|
|
|
} else {
|
|
|
|
security_component_enable = false
|
|
|
|
}
|
|
|
|
|
2024-05-05 09:40:42 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
|
|
|
defined(global_parts_info.ability_form_fwk)) {
|
|
|
|
form_fwk_enable = true
|
|
|
|
} else {
|
|
|
|
form_fwk_enable = false
|
|
|
|
}
|
|
|
|
|
2024-07-10 12:50:04 +00:00
|
|
|
if (defined(global_parts_info) &&
|
|
|
|
defined(global_parts_info.hiviewdfx_hicollie)) {
|
2024-07-10 12:57:22 +00:00
|
|
|
uiservice_xcollie_enable = true
|
2024-07-10 12:50:04 +00:00
|
|
|
} else {
|
2024-07-10 12:57:22 +00:00
|
|
|
uiservice_xcollie_enable = false
|
2024-07-10 12:50:04 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 12:58:03 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
|
|
|
defined(global_parts_info.graphic_graphic_2d_ext)) {
|
2024-11-09 12:08:10 +00:00
|
|
|
if (ace_engine_feature_enable_aps) {
|
|
|
|
ace_common_defines += [ "APS_ENABLE" ]
|
|
|
|
}
|
2024-10-11 12:58:03 +00:00
|
|
|
}
|
|
|
|
|
2024-08-03 01:44:42 +00:00
|
|
|
if (ace_engine_feature_asbng_path == "") {
|
2024-08-03 02:42:26 +00:00
|
|
|
ace_engine_feature_asbng_path_enable = false
|
2024-08-03 01:44:42 +00:00
|
|
|
} else {
|
2024-08-03 02:42:26 +00:00
|
|
|
ace_engine_feature_asbng_path_enable = true
|
2024-08-03 01:44:42 +00:00
|
|
|
}
|
|
|
|
|
2021-09-27 13:44:21 +00:00
|
|
|
ace_platforms = []
|
|
|
|
|
|
|
|
_ace_adapter_dir = rebase_path("$ace_root/adapter", root_build_dir)
|
|
|
|
_adapters = exec_script("build/search.py", [ _ace_adapter_dir ], "list lines")
|
|
|
|
foreach(item, _adapters) {
|
|
|
|
import_var = {
|
|
|
|
}
|
|
|
|
import_var = {
|
|
|
|
import("$ace_root/adapter/$item/build/platform.gni")
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defined(import_var.platforms)) {
|
|
|
|
foreach(platform, import_var.platforms) {
|
2023-11-06 08:45:11 +00:00
|
|
|
if (!is_arkui_x ||
|
|
|
|
(is_arkui_x && defined(platform.cross_platform_support) &&
|
|
|
|
platform.cross_platform_support)) {
|
2022-04-16 13:51:22 +00:00
|
|
|
if (defined(platform.name)) {
|
|
|
|
ace_platforms += [ platform ]
|
|
|
|
}
|
2021-09-27 13:44:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-03 12:27:39 +00:00
|
|
|
current_platform = {
|
|
|
|
}
|
|
|
|
foreach(item, ace_platforms) {
|
|
|
|
if ((use_mingw_win && item.name == "windows") ||
|
|
|
|
(use_mac && item.name == "mac") || (use_linux && item.name == "linux")) {
|
|
|
|
current_platform = item
|
|
|
|
}
|
|
|
|
}
|
2024-03-14 14:39:33 +00:00
|
|
|
|
2024-07-09 14:21:39 +00:00
|
|
|
if (ace_engine_feature_enable_split_mode) {
|
2024-07-08 10:08:34 +00:00
|
|
|
ace_common_defines += [ "ENABLE_SPLIT_MODE" ]
|
|
|
|
}
|
2024-07-18 03:14:47 +00:00
|
|
|
|
|
|
|
if (ace_engine_feature_enable_nav_split_mode) {
|
|
|
|
ace_common_defines += [ "ENABLE_NAV_SPLIT_MODE" ]
|
|
|
|
}
|
2024-11-19 08:38:48 +00:00
|
|
|
|
|
|
|
if (ace_engine_feature_wearable) {
|
2024-11-20 08:04:12 +00:00
|
|
|
ace_common_defines += [ "ARKUI_WEARABLE" ]
|
2024-11-19 08:38:48 +00:00
|
|
|
}
|