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