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 target_type = "shared_library" 33 sources = libpng_source 34 35 public_configs = [ ":libpng_config" ] 36 37 deps = [ "//build/lite/config/component/zlib:zlib_shared" ] 38 } 39} else { 40 import("//build/ohos.gni") 41 42 config("libpng_config") { 43 include_dirs = [ "//third_party/libpng" ] 44 } 45 46 ohos_source_set("png_static") { 47 sources = [ 48 "//third_party/libpng/arm/arm_init.c", 49 "//third_party/libpng/arm/filter_neon_intrinsics.c", 50 "//third_party/libpng/arm/palette_neon_intrinsics.c", 51 "//third_party/libpng/png.c", 52 "//third_party/libpng/pngerror.c", 53 "//third_party/libpng/pngget.c", 54 "//third_party/libpng/pngmem.c", 55 "//third_party/libpng/pngpread.c", 56 "//third_party/libpng/pngread.c", 57 "//third_party/libpng/pngrio.c", 58 "//third_party/libpng/pngrtran.c", 59 "//third_party/libpng/pngrutil.c", 60 "//third_party/libpng/pngset.c", 61 "//third_party/libpng/pngtrans.c", 62 "//third_party/libpng/pngwio.c", 63 "//third_party/libpng/pngwrite.c", 64 "//third_party/libpng/pngwtran.c", 65 "//third_party/libpng/pngwutil.c", 66 ] 67 include_dirs = [ 68 "//third_party/libpng", 69 "//third_party/zlib", 70 ] 71 } 72 73 ohos_shared_library("libpng") { 74 deps = [ ":libpng_static" ] 75 public_configs = [ ":libpng_config" ] 76 subsystem_name = "common" 77 install_images = [ 78 "system", 79 "updater", 80 ] 81 part_name = "graphic_standard" 82 } 83 84 ohos_static_library("libpng_static") { 85 sources = [ 86 "//third_party/libpng/arm/arm_init.c", 87 "//third_party/libpng/arm/filter_neon_intrinsics.c", 88 "//third_party/libpng/arm/palette_neon_intrinsics.c", 89 "//third_party/libpng/png.c", 90 "//third_party/libpng/pngerror.c", 91 "//third_party/libpng/pngget.c", 92 "//third_party/libpng/pngmem.c", 93 "//third_party/libpng/pngpread.c", 94 "//third_party/libpng/pngread.c", 95 "//third_party/libpng/pngrio.c", 96 "//third_party/libpng/pngrtran.c", 97 "//third_party/libpng/pngrutil.c", 98 "//third_party/libpng/pngset.c", 99 "//third_party/libpng/pngtrans.c", 100 "//third_party/libpng/pngwio.c", 101 "//third_party/libpng/pngwrite.c", 102 "//third_party/libpng/pngwtran.c", 103 "//third_party/libpng/pngwutil.c", 104 ] 105 106 include_dirs = [ 107 "//third_party/libpng", 108 "//third_party/zlib", 109 ] 110 deps = [ "//third_party/zlib:libz" ] 111 public_configs = [ ":libpng_config" ] 112 subsystem_name = "common" 113 } 114} 115