window_window_manager/previewer/BUILD.gn
rsyys f77fac6af7 fix previewer,tdd build and 2024
Signed-off-by: rsyys <renzhao5@h-partners.com>
2024-10-26 18:06:10 +08:00

199 lines
5.9 KiB
Plaintext

# Copyright (c) 2022-2024 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("../windowmanager_aafwk.gni")
ispreview = false
if (is_mingw || is_mac || is_linux) {
ispreview = true
}
if (!ispreview) {
group("previewer_window") {
}
group("previewer_window_napi") {
}
} else {
if (current_os == "mac") {
suffix = ".dylib"
} else if (current_os == "linux") {
suffix = ".so"
} else if (current_os == "mingw") {
suffix = ".dll"
}
config("previewer_window_config") {
visibility = [ "*:*" ]
visibility += [
"${graphic_base_path}/graphic_2d/rosen/modules/platform/image_native",
"${graphic_base_path}/graphic_2d/rosen/modules/platform/ipc_core",
"${graphic_base_path}/graphic_2d/rosen/modules/platform/utils",
]
include_dirs = [
"include",
"../utils/include",
"${graphic_base_path}/graphic_2d/rosen/modules/platform/utils",
"${graphic_base_path}/graphic_2d/rosen/modules/platform/ipc_core",
"${graphic_base_path}/graphic_2d/rosen/modules/platform/image_native",
"${window_base_path}/interfaces/innerkits/wm",
]
}
ohos_shared_library("previewer_window") {
libs = []
public_configs = [
":previewer_window_config",
"${ability_runtime_path}/frameworks/simulator/common:ability_simulator_common_config",
]
sources = [
"../utils/src/window_transition_info.cpp",
"../utils/src/wm_math.cpp",
"src/vsync_station.cpp",
"src/window.cpp",
"src/window_display.cpp",
"src/window_impl.cpp",
"src/window_model.cpp",
"src/window_option.cpp",
"src/window_scene.cpp",
]
include_dirs = [
"include",
"${arkui_path}/ace_engine/adapter/preview/external/multimodalinput",
"${arkui_path}/ace_engine/",
"mock",
"../utils/include",
"${ide_previewer_external_path}",
]
public_deps = [
"${graphic_base_path}/graphic_2d/rosen/modules/platform:ipc_core",
"${graphic_base_path}/graphic_2d/rosen/modules/platform:utils",
]
deps = [ "../utils:libwmutil_base" ]
external_deps = [
"ace_engine:ace_uicontent",
"graphic_2d:librender_service_client",
"hilog:libhilog",
]
cflags = [ "-std=c++11" ]
part_name = "window_manager"
subsystem_name = "window"
}
config("previewer_window_napi_config") {
visibility = [ ":*" ]
include_dirs = [
"../interfaces/kits/napi/window_runtime/window_napi",
"../interfaces/kits/napi/window_runtime/window_stage_napi",
]
}
ohos_shared_library("previewer_window_napi") {
public_configs = [ ":previewer_window_napi_config" ]
libs = []
sources = [
"${ability_runtime_path}/frameworks/simulator/ability_simulator/src/js_runtime_utils.cpp",
"../interfaces/kits/napi/window_runtime/window_napi/js_window.cpp",
"../interfaces/kits/napi/window_runtime/window_napi/js_window_utils.cpp",
"../interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp",
# mock
"mock/js_transition_controller.cpp",
"mock/js_window_listener.cpp",
"mock/js_window_register_manager.cpp",
"mock/permission.cpp",
"mock/pixel_map_napi.cpp",
"mock/window_manager_napi/js_window_manager.cpp",
"mock/window_manager_napi/window_manager_module.cpp",
]
include_dirs = [
".",
"include",
"../utils/include",
"mock",
"${ability_runtime_path}/interfaces/inner_api/runtime/include",
]
deps = [
":previewer_window",
"${graphic_base_path}/graphic_2d/rosen/modules/platform:eventhandler",
"${graphic_base_path}/graphic_2d/rosen/modules/platform:utils",
]
external_deps = [
"ace_engine:ace_uicontent",
"hilog:libhilog",
"napi:ace_napi",
]
cflags_cc = [ "-DWINDOW_PREVIEW" ]
cflags = [ "-std=c++11" ]
part_name = "window_manager"
subsystem_name = "window"
}
ohos_copy("window_stage_copy_modules") {
deps = []
sources = []
napi_modules = [ "window_stage_modules:windowstage" ]
foreach(module, napi_modules) {
deps += [ module ]
out_path = get_label_info(module, "root_out_dir")
out_name = get_label_info(module, "name")
sources += [ out_path + "/window/window_manager/lib" + out_name + suffix ]
}
target_path = get_label_info(":copy_previewer_library", "target_out_dir")
outputs =
[ target_path +
"/previewer/common/bin/module/application/{{source_file_part}}" ]
part_name = "window_manager"
subsystem_name = "window"
}
ohos_copy("copy_previewer_library") {
shared_library_path = get_label_info(":previewer_window", "root_out_dir")
sources = [ shared_library_path +
"/window/window_manager/libpreviewer_window" + suffix ]
deps = [ ":previewer_window" ]
if (current_os == "mingw" || current_os == "mac") {
deps += [ ":window_stage_copy_modules" ]
shared_library_path =
get_label_info(":previewer_window_napi", "root_out_dir")
sources += [ shared_library_path +
"/window/window_manager/libpreviewer_window_napi" + suffix ]
deps += [ ":previewer_window_napi" ]
}
outputs = [ target_out_dir + "/previewer/common/bin/{{source_file_part}}" ]
module_source_dir = target_out_dir + "/previewer/common/bin/"
module_install_name = ""
part_name = "window_manager"
subsystem_name = "window"
}
}