1# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. 2 3if (defined(ohos_lite)) { 4 import("//build/lite/config/component/lite_component.gni") 5 6 config("libpng_config") { 7 include_dirs = [ "//third_party/libpng" ] 8 } 9 10 libpng_source = [ 11 "//third_party/libpng/png.c", 12 "//third_party/libpng/pngerror.c", 13 "//third_party/libpng/pngget.c", 14 "//third_party/libpng/pngmem.c", 15 "//third_party/libpng/pngpread.c", 16 "//third_party/libpng/pngread.c", 17 "//third_party/libpng/pngrio.c", 18 "//third_party/libpng/pngrtran.c", 19 "//third_party/libpng/pngrutil.c", 20 "//third_party/libpng/pngset.c", 21 "//third_party/libpng/pngtrans.c", 22 "//third_party/libpng/pngwio.c", 23 "//third_party/libpng/pngwrite.c", 24 "//third_party/libpng/pngwtran.c", 25 "//third_party/libpng/pngwutil.c", 26 "//third_party/libpng/arm/arm_init.c", 27 "//third_party/libpng/arm/filter_neon_intrinsics.c", 28 "//third_party/libpng/arm/palette_neon_intrinsics.c", 29 ] 30 31 lite_library("libpng") { 32 if (ohos_kernel_type == "liteos_m") { 33 target_type = "static_library" 34 deps = [ "//build/lite/config/component/zlib:zlib_static" ] 35 } else { 36 target_type = "shared_library" 37 deps = [ "//build/lite/config/component/zlib:zlib_shared" ] 38 } 39 40 sources = libpng_source 41 public_configs = [ ":libpng_config" ] 42 } 43} else { 44 import("//build/ohos.gni") 45 46 config("libpng_config") { 47 include_dirs = [ "//third_party/libpng" ] 48 } 49 50 config("libpng_wno_config") { 51 cflags = [ "-Wno-implicit-fallthrough" ] 52 } 53 54 ohos_source_set("png_static") { 55 sources = [ 56 "//third_party/libpng/arm/arm_init.c", 57 "//third_party/libpng/arm/filter_neon_intrinsics.c", 58 "//third_party/libpng/arm/palette_neon_intrinsics.c", 59 "//third_party/libpng/png.c", 60 "//third_party/libpng/pngerror.c", 61 "//third_party/libpng/pngget.c", 62 "//third_party/libpng/pngmem.c", 63 "//third_party/libpng/pngpread.c", 64 "//third_party/libpng/pngread.c", 65 "//third_party/libpng/pngrio.c", 66 "//third_party/libpng/pngrtran.c", 67 "//third_party/libpng/pngrutil.c", 68 "//third_party/libpng/pngset.c", 69 "//third_party/libpng/pngtrans.c", 70 "//third_party/libpng/pngwio.c", 71 "//third_party/libpng/pngwrite.c", 72 "//third_party/libpng/pngwtran.c", 73 "//third_party/libpng/pngwutil.c", 74 ] 75 include_dirs = [ 76 "//third_party/libpng", 77 "//third_party/zlib", 78 ] 79 } 80 81 ohos_shared_library("libpng") { 82 deps = [ ":libpng_static" ] 83 public_configs = [ ":libpng_config" ] 84 configs = [ ":libpng_wno_config" ] 85 subsystem_name = "common" 86 install_images = [ 87 "system", 88 "updater", 89 ] 90 part_name = "graphic_standard" 91 } 92 93 ohos_static_library("libpng_static") { 94 sources = [ 95 "//third_party/libpng/arm/arm_init.c", 96 "//third_party/libpng/arm/filter_neon_intrinsics.c", 97 "//third_party/libpng/arm/palette_neon_intrinsics.c", 98 "//third_party/libpng/png.c", 99 "//third_party/libpng/pngerror.c", 100 "//third_party/libpng/pngget.c", 101 "//third_party/libpng/pngmem.c", 102 "//third_party/libpng/pngpread.c", 103 "//third_party/libpng/pngread.c", 104 "//third_party/libpng/pngrio.c", 105 "//third_party/libpng/pngrtran.c", 106 "//third_party/libpng/pngrutil.c", 107 "//third_party/libpng/pngset.c", 108 "//third_party/libpng/pngtrans.c", 109 "//third_party/libpng/pngwio.c", 110 "//third_party/libpng/pngwrite.c", 111 "//third_party/libpng/pngwtran.c", 112 "//third_party/libpng/pngwutil.c", 113 ] 114 115 include_dirs = [ 116 "//third_party/libpng", 117 "//third_party/zlib", 118 ] 119 deps = [ "//third_party/zlib:libz" ] 120 public_configs = [ ":libpng_config" ] 121 configs = [ ":libpng_wno_config" ] 122 subsystem_name = "common" 123 } 124} 125