1e9297d28Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd. 2e9297d28Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3e9297d28Sopenharmony_ci# you may not use this file except in compliance with the License. 4e9297d28Sopenharmony_ci# You may obtain a copy of the License at 5e9297d28Sopenharmony_ci# 6e9297d28Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7e9297d28Sopenharmony_ci# 8e9297d28Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9e9297d28Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10e9297d28Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11e9297d28Sopenharmony_ci# See the License for the specific language governing permissions and 12e9297d28Sopenharmony_ci# limitations under the License. 13e9297d28Sopenharmony_ci 14e9297d28Sopenharmony_ciimport("//build/ohos.gni") 15e9297d28Sopenharmony_ciimport("//foundation/graphic/graphic_2d/graphic_config.gni") 16e9297d28Sopenharmony_ciimport("//foundation/graphic/graphic_2d/rosen/modules/effect/effect_config.gni") 17e9297d28Sopenharmony_ci 18e9297d28Sopenharmony_ci## Build libegl_effect.so 19e9297d28Sopenharmony_ci 20e9297d28Sopenharmony_ciconfig("egl_effect_config") { 21e9297d28Sopenharmony_ci include_dirs = [ 22e9297d28Sopenharmony_ci "$graphic_2d_root/utils/log", 23e9297d28Sopenharmony_ci "include", 24e9297d28Sopenharmony_ci "$graphic_2d_root/rosen/modules/effect/effectChain/include", 25e9297d28Sopenharmony_ci ] 26e9297d28Sopenharmony_ci 27e9297d28Sopenharmony_ci cflags = [ 28e9297d28Sopenharmony_ci "-Wall", 29e9297d28Sopenharmony_ci "-Werror", 30e9297d28Sopenharmony_ci "-g3", 31e9297d28Sopenharmony_ci "-Wall", 32e9297d28Sopenharmony_ci "-Wno-pointer-arith", 33e9297d28Sopenharmony_ci "-Wno-non-virtual-dtor", 34e9297d28Sopenharmony_ci "-Wno-missing-field-initializers", 35e9297d28Sopenharmony_ci "-Wno-c++11-narrowing", 36e9297d28Sopenharmony_ci ] 37e9297d28Sopenharmony_ci 38e9297d28Sopenharmony_ci cflags_cc = [ "-std=c++17" ] 39e9297d28Sopenharmony_ci} 40e9297d28Sopenharmony_ci 41e9297d28Sopenharmony_ciif (current_os == "android") { 42e9297d28Sopenharmony_ci ohos_source_set("libegl_effect") { 43e9297d28Sopenharmony_ci configs = [ ":egl_effect_config" ] 44e9297d28Sopenharmony_ci 45e9297d28Sopenharmony_ci defines = [ "ANDROID_PLATFORM" ] 46e9297d28Sopenharmony_ci 47e9297d28Sopenharmony_ci include_dirs = [ 48e9297d28Sopenharmony_ci "//foundation/multimedia/image_framework/interfaces/innerkits/include", 49e9297d28Sopenharmony_ci ] 50e9297d28Sopenharmony_ci 51e9297d28Sopenharmony_ci sources = [] 52e9297d28Sopenharmony_ci 53e9297d28Sopenharmony_ci deps = [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}" ] 54e9297d28Sopenharmony_ci 55e9297d28Sopenharmony_ci if (effect_enable_gpu) { 56e9297d28Sopenharmony_ci sources += [ "src/egl_manager.cpp" ] 57e9297d28Sopenharmony_ci deps += [ 58e9297d28Sopenharmony_ci "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 59e9297d28Sopenharmony_ci "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 60e9297d28Sopenharmony_ci ] 61e9297d28Sopenharmony_ci } 62e9297d28Sopenharmony_ci 63e9297d28Sopenharmony_ci part_name = "graphic_2d" 64e9297d28Sopenharmony_ci subsystem_name = "graphic" 65e9297d28Sopenharmony_ci } 66e9297d28Sopenharmony_ci} else { 67e9297d28Sopenharmony_ci ohos_shared_library("libegl_effect") { 68e9297d28Sopenharmony_ci configs = [ ":egl_effect_config" ] 69e9297d28Sopenharmony_ci sources = [] 70e9297d28Sopenharmony_ci deps = [] 71e9297d28Sopenharmony_ci external_deps = [ 72e9297d28Sopenharmony_ci "graphic_surface:surface_headers", 73e9297d28Sopenharmony_ci "hilog:libhilog", 74e9297d28Sopenharmony_ci ] 75e9297d28Sopenharmony_ci 76e9297d28Sopenharmony_ci if (effect_enable_gpu) { 77e9297d28Sopenharmony_ci sources += [ "src/egl_manager.cpp" ] 78e9297d28Sopenharmony_ci 79e9297d28Sopenharmony_ci deps += [ 80e9297d28Sopenharmony_ci "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 81e9297d28Sopenharmony_ci "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 82e9297d28Sopenharmony_ci ] 83e9297d28Sopenharmony_ci } 84e9297d28Sopenharmony_ci 85e9297d28Sopenharmony_ci if (effect_enable_gpu) { 86e9297d28Sopenharmony_ci install_enable = true 87e9297d28Sopenharmony_ci } else { 88e9297d28Sopenharmony_ci install_enable = false 89e9297d28Sopenharmony_ci } 90e9297d28Sopenharmony_ci 91e9297d28Sopenharmony_ci part_name = "graphic_2d" 92e9297d28Sopenharmony_ci subsystem_name = "graphic" 93e9297d28Sopenharmony_ci } 94e9297d28Sopenharmony_ci} 95