1# Copyright (c) 2022 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 14import("//build/ohos.gni") 15import("//foundation/graphic/graphic_2d/graphic_config.gni") 16import("//foundation/graphic/graphic_2d/rosen/modules/effect/effect_config.gni") 17 18## Build libegl_effect.so 19 20config("egl_effect_config") { 21 include_dirs = [ 22 "$graphic_2d_root/utils/log", 23 "include", 24 "$graphic_2d_root/rosen/modules/effect/effectChain/include", 25 ] 26 27 cflags = [ 28 "-Wall", 29 "-Werror", 30 "-g3", 31 "-Wall", 32 "-Wno-pointer-arith", 33 "-Wno-non-virtual-dtor", 34 "-Wno-missing-field-initializers", 35 "-Wno-c++11-narrowing", 36 ] 37 38 cflags_cc = [ "-std=c++17" ] 39} 40 41if (current_os == "android") { 42 ohos_source_set("libegl_effect") { 43 configs = [ ":egl_effect_config" ] 44 45 defines = [ "ANDROID_PLATFORM" ] 46 47 include_dirs = [ 48 "//foundation/multimedia/image_framework/interfaces/innerkits/include", 49 ] 50 51 sources = [] 52 53 deps = [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}" ] 54 55 if (effect_enable_gpu) { 56 sources += [ "src/egl_manager.cpp" ] 57 deps += [ 58 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 59 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 60 ] 61 } 62 63 part_name = "graphic_2d" 64 subsystem_name = "graphic" 65 } 66} else { 67 ohos_shared_library("libegl_effect") { 68 configs = [ ":egl_effect_config" ] 69 sources = [] 70 deps = [] 71 external_deps = [ 72 "graphic_surface:surface_headers", 73 "hilog:libhilog", 74 ] 75 76 if (effect_enable_gpu) { 77 sources += [ "src/egl_manager.cpp" ] 78 79 deps += [ 80 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 81 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 82 ] 83 } 84 85 if (effect_enable_gpu) { 86 install_enable = true 87 } else { 88 install_enable = false 89 } 90 91 part_name = "graphic_2d" 92 subsystem_name = "graphic" 93 } 94} 95