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 BINARY_DIR_NAME = "LumeBinaryCompile" 27 META_DIR_NAME = "LumeMeta" 28 SCENE_DIR_NAME = "LumeScene" 29 FONT_DIR_NAME = "LumeFont" 30 PNG_DIR_NAME = "LumePng" 31 JPG_DIR_NAME = "LumeJpg" 32 ECS_SERIALIZER_DIR_NAME = "LumeEcsSerializer" 33 34 LUME_OHOS_BUILD = true 35 CORE_DEV_ENABLED = 1 36 37 USE_LIB_PNG_JPEG_DYNAMIC_PLUGIN = true 38 LIB_ENGINE_CORE = "libAGPDLL" 39 LIB_RENDER = "libPluginAGPRender" 40 LIB_CORE3D = "libPluginAGP3D" 41 LIB_JPG = "libPluginAGPJpg" 42 LIB_PNG = "libPluginAGPPng" 43 LIB_CAM_PREVIEW = "libPluginCamPreview" 44 LIB_VULKAN_3D = "//third_party/vulkan-loader:vulkan_loader" 45 METAOBJECT_DIR_NAME = "metaobject" 46 SCENEWIDGETPLUGIN_DIR_NAME = "scenewidgetplugin" 47 ECS_HELPER = "ecshelper" 48 CAM_PREIVEW_DIR_NAME = "camera_preview_plugin" 49} 50 51declare_args() { 52 LUME_ROOT = "//${LUME_PATH}" 53} 54 55declare_args() { 56 LUME_BASE_PATH = "${LUME_ROOT}/${BASE_DIR_NAME}/" 57 LUME_CORE_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/" 58 LUME_RENDER_PATH = "${LUME_ROOT}/${RENDER_DIR_NAME}/" 59 LUME_CORE3D_PATH = "${LUME_ROOT}/${CORE3D_DIR_NAME}/" 60 LUME_BINARY_PATH = "${LUME_ROOT}/${BINARY_DIR_NAME}/" 61 LUME_ECS_HELPER_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/${ECS_HELPER}/" 62 LUME_METAOBJECT_PATH = "${LUME_ROOT}/${METAOBJECT_DIR_NAME}" 63 LUME_SCP_PATH = "${LUME_ROOT}/${SCENEWIDGETPLUGIN_DIR_NAME}" 64 LUME_META_PATH = "${LUME_ROOT}/${META_DIR_NAME}" 65 LUME_SCENE_PATH = "${LUME_ROOT}/${SCENE_DIR_NAME}" 66 LUME_PNG_PATH = "${LUME_ROOT}/${PNG_DIR_NAME}/" 67 LUME_JPG_PATH = "${LUME_ROOT}/${JPG_DIR_NAME}/" 68 LUME_FONT_PATH = "${LUME_ROOT}/${FONT_DIR_NAME}/" 69 LUME_SERIALIZER_PATH = "${LUME_ROOT}/${ECS_SERIALIZER_DIR_NAME}/" 70 71 LUME_CORE_DLL_PATH = "${LUME_ROOT}/${CORE_DIR_NAME}/DLL/" 72 LUME_CORE3D_DLL_PATH = "${LUME_ROOT}/${CORE3D_DIR_NAME}/DLL/" 73} 74 75declare_args() { 76 CORE_STATIC_PLUGIN_HEADER = 77 "\"${LUME_PATH}/${CORE_DIR_NAME}/src/static_plugin_decl.h\"" 78} 79 80declare_args() { 81 USE_LIB_PNG_JPEG = true 82 USE_STB_IMAGE = false 83 STB_IMAGE_PATH = "//foundation/graphic/graphic_3d/lume/TMP_STB/" 84} 85 86declare_args() { 87 KIT_3D_ENABLE = true 88} 89 90template("lume_rofs") { 91 name = target_name 92 action(name) { 93 outputs = [ invoker.outputs ] 94 script = invoker.script 95 cpu_type = "" 96 output_obj = "" 97 if (target_cpu == "arm") { 98 cpu_type = "armeabi-v7a" 99 output_obj = "${invoker.base_name}_32.o" 100 } 101 102 if (target_cpu == "arm64") { 103 cpu_type = "arm64-v8a" 104 output_obj = "${invoker.base_name}_64.o" 105 } 106 107 args = [ 108 rebase_path(invoker.tool_path, root_build_dir), 109 "-${cpu_type}", 110 rebase_path(invoker.copy_path, root_build_dir), 111 invoker.root, 112 invoker.bin_name, 113 invoker.size_name, 114 invoker.base_name, 115 rebase_path(invoker.copy_path, root_build_dir), 116 output_obj, 117 invoker.file_extension, 118 ] 119 120 deps = [] 121 if (defined(invoker.compileShader_deps)) { 122 deps += invoker.compileShader_deps 123 } 124 } 125} 126 127template("lume_binary_complile") { 128 name = target_name 129 action(name) { 130 outputs = invoker.outputs 131 script = invoker.script 132 args = [ rebase_path(invoker.dest_gen_path, root_build_dir) ] 133 } 134} 135 136template("lume_compile_shader") { 137 name = target_name 138 action(name) { 139 script = invoker.script 140 outputs = invoker.outputs 141 args = [ 142 rebase_path(invoker.dest_gen_path, root_build_dir), 143 invoker.asset_path, 144 rebase_path(invoker.tool_path, root_build_dir), 145 rebase_path(invoker.shader_path, root_build_dir), 146 invoker.include_path, 147 ] 148 149 if (defined(invoker.render_include_path)) { 150 args += [ invoker.render_include_path ] 151 } 152 deps = [] 153 if (defined(invoker.compileShader_deps)) { 154 deps += invoker.compileShader_deps 155 } 156 } 157} 158