1# Copyright (C) 2021 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. 13template("ohos_source_set") { 14 source_set(target_name) { 15 sources = invoker.sources 16 if (defined(invoker.configs)) { 17 configs = invoker.configs 18 } 19 if (defined(invoker.cflags)) { 20 cflags = invoker.cflags 21 } 22 if (defined(invoker.include_dirs)) { 23 include_dirs = invoker.include_dirs 24 } 25 if (defined(invoker.deps)) { 26 deps = invoker.deps 27 } 28 if (defined(invoker.cflags_cc)) { 29 cflags_cc = invoker.cflags_cc 30 } 31 public_deps = invoker.public_deps 32 } 33} 34template("ohos_shared_library") { 35 shared_library(target_name) { 36 sources = invoker.sources 37 if (defined(invoker.configs)) { 38 configs = invoker.configs 39 } 40 public_configs = invoker.public_configs 41 if (defined(invoker.defines)) { 42 defines = invoker.defines 43 } 44 if (defined(invoker.cflags)) { 45 cflags = invoker.cflags 46 } 47 if (defined(invoker.include_dirs)) { 48 include_dirs = invoker.include_dirs 49 } 50 if (defined(invoker.cflags_cc)) { 51 cflags_cc = invoker.cflags_cc 52 } 53 if (defined(invoker.deps)) { 54 deps = invoker.deps 55 } 56 } 57} 58template("ohos_static_library") { 59 static_library(target_name) { 60 sources = invoker.sources 61 if (defined(invoker.configs)) { 62 configs = invoker.configs 63 } 64 public_configs = invoker.public_configs 65 if (defined(invoker.defines)) { 66 defines = invoker.defines 67 } 68 if (defined(invoker.cflags)) { 69 cflags = invoker.cflags 70 } 71 if (defined(invoker.include_dirs)) { 72 include_dirs = invoker.include_dirs 73 } 74 if (defined(invoker.cflags_cc)) { 75 cflags_cc = invoker.cflags_cc 76 } 77 if (defined(invoker.deps)) { 78 deps = invoker.deps 79 } 80 } 81} 82template("ohos_executable") { 83 executable(target_name) { 84 if (defined(invoker.include_dirs)) { 85 include_dirs = invoker.include_dirs 86 } 87 sources = invoker.sources 88 if (defined(invoker.defines)) { 89 defines = invoker.defines 90 } 91 if (defined(invoker.cflags)) { 92 cflags = invoker.cflags 93 } 94 if (defined(invoker.deps)) { 95 deps = invoker.deps 96 } 97 if (defined(invoker.cflags_cc)) { 98 cflags_cc = invoker.cflags_cc 99 } 100 } 101} 102