f920c0ba3cb8e88d79c7055104941836332eac75
[platform/framework/web/crosswalk.git] / src / third_party / libpng / BUILD.gn
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 static_library("libpng") {
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
63   forward_dependent_configs_from = [ "//third_party/zlib" ]
64
65   direct_dependent_configs = [ ":libpng_config" ]
66
67   deps =  [
68     "//third_party/zlib",
69   ]
70 }