• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14declare_args() {
15  #BUILDTYPE="Release"
16  #BUILDTYPE="MinSizeRel"
17  #BUILDTYPE="RelWithDebInfo"
18  BUILDTYPE = "Release"
19
20  LUME_PATH = "foundation/graphic/graphic_3d/lume/"
21
22  BASE_DIR_NAME = "LumeBase"
23  CORE_DIR_NAME = "LumeEngine"
24  RENDER_DIR_NAME = "LumeRender"
25  CORE3D_DIR_NAME = "Lume_3D"
26  LUME3DTEXT_DIR_NAME = "Lume3DText"
27  BINARY_DIR_NAME = "LumeBinaryCompile"
28  META_DIR_NAME = "LumeMeta"
29  SCENE_DIR_NAME = "LumeScene"
30  FONT_DIR_NAME = "LumeFont"
31  PNG_DIR_NAME = "LumePng"
32  JPG_DIR_NAME = "LumeJpg"
33  ECS_SERIALIZER_DIR_NAME = "LumeEcsSerializer"
34
35  LUME_OHOS_BUILD = true
36  CORE_DEV_ENABLED = 1
37
38  USE_LIB_PNG_JPEG_DYNAMIC_PLUGIN = true
39  LIB_ENGINE_CORE = "libAGPDLL"
40  LIB_RENDER = "libPluginAGPRender"
41  LIB_CORE3D = "libPluginAGP3D"
42  LIB_3DTEXT = "libPluginAGP3DText"
43  LIB_JPG = "libPluginAGPJpg"
44  LIB_PNG = "libPluginAGPPng"
45  LIB_CAM_PREVIEW = "libPluginCamPreview"
46  LIB_VULKAN_3D = "//third_party/vulkan-loader:vulkan_loader"
47  METAOBJECT_DIR_NAME = "metaobject"
48  SCENEWIDGETPLUGIN_DIR_NAME = "scenewidgetplugin"
49  ECS_HELPER = "ecshelper"
50  CAM_PREIVEW_DIR_NAME = "camera_preview_plugin"
51}
52
53declare_args() {
54  LUME_ROOT = "//${LUME_PATH}"
55}
56
57declare_args() {
58  LUME_BASE_PATH = "${LUME_ROOT}/${BASE_DIR_NAME}/"
59  LUME_CORE_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/"
60  LUME_RENDER_PATH = "${LUME_ROOT}/${RENDER_DIR_NAME}/"
61  LUME_CORE3D_PATH = "${LUME_ROOT}/${CORE3D_DIR_NAME}/"
62  LUME_BINARY_PATH = "${LUME_ROOT}/${BINARY_DIR_NAME}/"
63  LUME_ECS_HELPER_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/${ECS_HELPER}/"
64  LUME_METAOBJECT_PATH = "${LUME_ROOT}/${METAOBJECT_DIR_NAME}"
65  LUME_SCP_PATH = "${LUME_ROOT}/${SCENEWIDGETPLUGIN_DIR_NAME}"
66  LUME_META_PATH = "${LUME_ROOT}/${META_DIR_NAME}"
67  LUME_SCENE_PATH = "${LUME_ROOT}/${SCENE_DIR_NAME}"
68  LUME_PNG_PATH = "${LUME_ROOT}/${PNG_DIR_NAME}/"
69  LUME_JPG_PATH = "${LUME_ROOT}/${JPG_DIR_NAME}/"
70  LUME_FONT_PATH = "${LUME_ROOT}/${FONT_DIR_NAME}/"
71  LUME_SERIALIZER_PATH = "${LUME_ROOT}/${ECS_SERIALIZER_DIR_NAME}/"
72  LUME_LUME3DTEXT_PATH = "${LUME_ROOT}/${LUME3DTEXT_DIR_NAME}/"
73
74  LUME_CORE_DLL_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/DLL/"
75  LUME_CORE3D_DLL_PATH = "${LUME_ROOT}/${CORE3D_DIR_NAME}/DLL/"
76}
77
78declare_args() {
79  CORE_STATIC_PLUGIN_HEADER =
80      "\"${LUME_PATH}/${CORE_DIR_NAME}/src/static_plugin_decl.h\""
81}
82
83declare_args() {
84  USE_LIB_PNG_JPEG = true
85  USE_STB_IMAGE = false
86  STB_IMAGE_PATH = "//foundation/graphic/graphic_3d/lume/TMP_STB/"
87}
88
89declare_args() {
90  KIT_3D_ENABLE = true
91}
92
93template("lume_rofs") {
94  name = target_name
95  action(name) {
96    outputs = [ invoker.outputs ]
97    script = invoker.script
98    cpu_type = ""
99    output_obj = ""
100    if (target_cpu == "arm") {
101      cpu_type = "armeabi-v7a"
102      output_obj = "${invoker.base_name}_32.o"
103    }
104
105    if (target_cpu == "arm64") {
106      cpu_type = "arm64-v8a"
107      output_obj = "${invoker.base_name}_64.o"
108    }
109
110    if (target_cpu == "x86") {
111      cpu_type = "armeabi-v7a"
112      output_obj = "${invoker.base_name}_x32.o"
113    }
114
115    if (target_cpu == "x64") {
116      cpu_type = "arm64-v8a"
117      output_obj = "${invoker.base_name}_x64.o"
118    }
119
120    args = [
121      rebase_path(invoker.tool_path, root_build_dir),
122      "-${cpu_type}",
123      rebase_path(invoker.copy_path, root_build_dir),
124      invoker.root,
125      invoker.bin_name,
126      invoker.size_name,
127      invoker.base_name,
128      rebase_path(invoker.copy_path, root_build_dir),
129      output_obj,
130      invoker.file_extension,
131    ]
132
133    deps = []
134    if (defined(invoker.compileShader_deps)) {
135      deps += invoker.compileShader_deps
136    }
137  }
138}
139
140template("lume_binary_complile") {
141  name = target_name
142  action(name) {
143    outputs = invoker.outputs
144    script = invoker.script
145    args = [ rebase_path(invoker.dest_gen_path, root_build_dir) ]
146  }
147}
148
149template("lume_compile_shader") {
150  name = target_name
151  action(name) {
152    script = invoker.script
153    outputs = invoker.outputs
154    args = [
155      rebase_path(invoker.dest_gen_path, root_build_dir),
156      invoker.asset_path,
157      rebase_path(invoker.tool_path, root_build_dir),
158      rebase_path(invoker.shader_path, root_build_dir),
159      invoker.include_path,
160    ]
161
162    if (defined(invoker.render_include_path)) {
163      args += [ invoker.render_include_path ]
164    }
165    deps = []
166    if (defined(invoker.compileShader_deps)) {
167      deps += invoker.compileShader_deps
168    }
169  }
170}
171