blob: 488ef4367f8264762257ce5bc8906cc48a2ecfac [file] [log] [blame]
James Robinson646469d2014-10-03 15:33:28 -07001# 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
5config("libpng_config") {
James Robinson6a64b812014-12-03 13:38:42 -08006 include_dirs = [ "." ]
James Robinson646469d2014-10-03 15:33:28 -07007
8 defines = [
9 "CHROME_PNG_WRITE_SUPPORT",
10 "PNG_USER_CONFIG",
11 ]
12
13 if (is_android) {
14 #'toolsets': ['target', 'host'],
James Robinson6a64b812014-12-03 13:38:42 -080015 defines += [ "CHROME_PNG_READ_PACK_SUPPORT" ] # Required by freetype.
James Robinson646469d2014-10-03 15:33:28 -070016 }
17
18 if (is_win) {
19 if (component_mode == "shared_library") {
20 defines += [
21 "PNG_USE_DLL",
22 "PNG_NO_MODULEDEF",
23 ]
24 }
25 }
26}
27
28source_set("libpng_sources") {
James Robinson6a64b812014-12-03 13:38:42 -080029 sources = [
James Robinson646469d2014-10-03 15:33:28 -070030 "png.c",
31 "png.h",
32 "pngconf.h",
33 "pngerror.c",
34 "pnggccrd.c",
35 "pngget.c",
36 "pngmem.c",
37 "pngpread.c",
38 "pngread.c",
39 "pngrio.c",
40 "pngrtran.c",
41 "pngrutil.c",
42 "pngset.c",
43 "pngtrans.c",
44 "pngusr.h",
45 "pngvcrd.c",
46 "pngwio.c",
47 "pngwrite.c",
48 "pngwtran.c",
49 "pngwutil.c",
50 ]
51
52 configs -= [ "//build/config/compiler:chromium_code" ]
53 configs += [ "//build/config/compiler:no_chromium_code" ]
54
55 if (is_win) {
56 cflags = [ "/wd4267" ] # TODO(jschuh): http://crbug.com/167187
57
58 if (component_mode == "shared_library") {
59 defines = [ "PNG_BUILD_DLL" ]
60 }
61 }
62
63 public_configs = [ ":libpng_config" ]
64
James Robinson6a64b812014-12-03 13:38:42 -080065 public_deps = [
66 "//third_party/zlib",
67 ]
James Robinson646469d2014-10-03 15:33:28 -070068}
69
70if (is_win) {
71 component("libpng") {
James Robinson6a64b812014-12-03 13:38:42 -080072 public_deps = [
73 ":libpng_sources",
74 ]
James Robinson646469d2014-10-03 15:33:28 -070075 }
76} else {
77 group("libpng") {
James Robinson6a64b812014-12-03 13:38:42 -080078 public_deps = [
79 ":libpng_sources",
80 ]
James Robinson646469d2014-10-03 15:33:28 -070081 }
82}