• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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  BINARY_DIR_NAME="LumeBinaryCompile"
27
28  LUME_OHOS_BUILD=true
29  CORE_DEV_ENABLED=1
30
31  LIB_ENGINE_CORE="libAGPDLL"
32  LIB_RENDER="libPluginAGPRender"
33  LIB_CORE3D="libPluginAGP3D"
34}
35
36declare_args() {
37  LUME_ROOT="//${LUME_PATH}"
38}
39
40declare_args() {
41
42  LUME_BASE_PATH="${LUME_ROOT}/${BASE_DIR_NAME}/"
43  LUME_CORE_PATH="${LUME_ROOT}/${CORE_DIR_NAME}/"
44  LUME_RENDER_PATH="${LUME_ROOT}/${RENDER_DIR_NAME}/"
45  LUME_CORE3D_PATH="${LUME_ROOT}/${CORE3D_DIR_NAME}/"
46  LUME_BINARY_PATH="${LUME_ROOT}/${BINARY_DIR_NAME}/"
47
48  LUME_CORE_DLL_PATH="${LUME_ROOT}/${CORE_DIR_NAME}/DLL/"
49  LUME_CORE3D_DLL_PATH="${LUME_ROOT}/${CORE3D_DIR_NAME}/DLL/"
50}
51
52declare_args() {
53  CORE_STATIC_PLUGIN_HEADER = "\"${LUME_PATH}/${CORE_DIR_NAME}/src/static_plugin_decl.h\""
54}
55
56declare_args() {
57  USE_LIB_PNG_JPEG = true
58  USE_STB_IMAGE = false
59  STB_IMAGE_PATH = "//third_party/minimp3/player/"
60}
61
62template("lume_rofs") {
63  name = target_name
64  action(name) {
65    outputs = [invoker.outputs]
66    script = invoker.script
67    cpu_type = ""
68    output_obj = ""
69    if (target_cpu == "arm") {
70      cpu_type = "armeabi-v7a"
71      output_obj = "${invoker.base_name}_32.o"
72    }
73
74    if (target_cpu == "arm64") {
75      cpu_type = "arm64-v8a"
76      output_obj = "${invoker.base_name}_64.o"
77    }
78
79    args = [
80      rebase_path(invoker.tool_path, root_build_dir),
81      "-${cpu_type}",
82      rebase_path(invoker.copy_path, root_build_dir),
83      invoker.root,
84      invoker.bin_name,
85      invoker.size_name,
86      invoker.base_name,
87      rebase_path(invoker.copy_path, root_build_dir),
88      output_obj,
89      invoker.file_extension
90    ]
91
92    deps = []
93    if (defined(invoker.compileShader_deps)) {
94      deps += invoker.compileShader_deps
95    }
96  }
97}
98
99template("lume_binary_complile") {
100  name = target_name
101  action(name) {
102    outputs = invoker.outputs
103    script = invoker.script
104    args = [
105      rebase_path(invoker.dest_gen_path, root_build_dir)
106    ]
107  }
108}
109
110template("lume_compile_shader") {
111  name = target_name
112  action(name) {
113    script = invoker.script
114    outputs = invoker.outputs
115    args = [
116      rebase_path(invoker.dest_gen_path, root_build_dir),
117      invoker.asset_path,
118      rebase_path(invoker.tool_path, root_build_dir),
119      rebase_path(invoker.shader_path, root_build_dir),
120      invoker.include_path,
121    ]
122
123    if (defined(invoker.render_include_path)) {
124      args += [
125        invoker.render_include_path
126      ]
127    }
128    deps = []
129    if (defined(invoker.compileShader_deps)) {
130      deps += invoker.compileShader_deps
131    }
132  }
133}
134