• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) 2024 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15set -e
16
17COMPILER_PATH=$1
18TEST_COMPILER_PATH=${COMPILER_PATH}
19CPU_TYPE=$2
20ASSETS_PATH=$3
21ROOT_PATH=$4
22BIN_NAME=$5
23SIZE_NAME=$6
24BASE_NAME=$7
25COPY_PATH=$8
26OUTPUT_OBJ=$9
27FILE_EXTENSIONS=${10}
28
29if [ -z "$FILE_EXTENSIONS" ]; then
30    FILE_EXTENSIONS=".spv;.json;.lsb;.shader;.shadergs;.shadervid;.shaderpl;.rng;.gl;.gles"
31else
32    FILE_EXTENSIONS="${FILE_EXTENSIONS//\"/}"
33fi
34
35compile_asset()
36{
37	echo "Lume5 Compile asset $1 $2 $3 $4 $5 $6 $7 $8 $9 $FILE_EXTENSIONS"
38    if [ ! -f "$TEST_COMPILER_PATH"/LumeAssetCompiler ]; then
39         echo "lume engine assert compiler not exist"
40    fi
41    $TEST_COMPILER_PATH/LumeAssetCompiler -linux $CPU_TYPE -extensions $FILE_EXTENSIONS $ASSETS_PATH $ROOT_PATH $BIN_NAME $SIZE_NAME $BASE_NAME
42    mv $OUTPUT_OBJ $COPY_PATH
43}
44
45compile_asset $COMPILER_PATH $CPU_TYPE $ASSETS_PATH $ROOT_PATH $BIN_NAME $SIZE_NAME $BASE_NAME $COPY_PATH $OUTPUT_OBJ $FILE_EXTENSIONS
46