1 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 config("libpng_config") { 6 include_dirs = [ 7 ".", 8 ] 9 10 defines = [ 11 "CHROME_PNG_WRITE_SUPPORT", 12 "PNG_USER_CONFIG", 13 ] 14 15 if (is_android) { 16 #'toolsets': ['target', 'host'], 17 defines += [ 18 "CHROME_PNG_READ_PACK_SUPPORT", # Required by freetype. 19 ] 20 } 21 22 if (is_win) { 23 if (component_mode == "shared_library") { 24 defines += [ 25 "PNG_USE_DLL", 26 "PNG_NO_MODULEDEF", 27 ] 28 } 29 } 30 } 31 32 source_set("libpng_sources") { 33 sources = [ 34 "png.c", 35 "png.h", 36 "pngconf.h", 37 "pngerror.c", 38 "pnggccrd.c", 39 "pngget.c", 40 "pngmem.c", 41 "pngpread.c", 42 "pngread.c", 43 "pngrio.c", 44 "pngrtran.c", 45 "pngrutil.c", 46 "pngset.c", 47 "pngtrans.c", 48 "pngusr.h", 49 "pngvcrd.c", 50 "pngwio.c", 51 "pngwrite.c", 52 "pngwtran.c", 53 "pngwutil.c", 54 ] 55 56 configs -= [ "//build/config/compiler:chromium_code" ] 57 configs += [ "//build/config/compiler:no_chromium_code" ] 58 59 if (is_win) { 60 cflags = [ "/wd4267" ] # TODO(jschuh): http://crbug.com/167187 61 62 if (component_mode == "shared_library") { 63 defines = [ "PNG_BUILD_DLL" ] 64 } 65 } 66 67 public_configs = [ ":libpng_config" ] 68 69 public_deps = [ "//third_party/zlib" ] 70 } 71 72 if (is_win) { 73 component("libpng") { 74 public_deps = [ ":libpng_sources" ] 75 } 76 } else { 77 group("libpng") { 78 public_deps = [ ":libpng_sources" ] 79 } 80 } 81