Index: tools/gn/secondary/third_party/libpng/BUILD.gn |
diff --git a/tools/gn/secondary/third_party/libpng/BUILD.gn b/tools/gn/secondary/third_party/libpng/BUILD.gn |
new file mode 100644 |
index 0000000000000000000000000000000000000000..293fcdb7aca40bdc7bfc5a47d49f4f99c16a8ae6 |
--- /dev/null |
+++ b/tools/gn/secondary/third_party/libpng/BUILD.gn |
@@ -0,0 +1,83 @@ |
+# Copyright 2014 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+config("libpng_config") { |
+ include_dirs = [ |
+ ".", |
+ ] |
+ |
+ defines = [ |
+ "CHROME_PNG_WRITE_SUPPORT", |
+ "PNG_USER_CONFIG", |
+ ] |
+ if (is_android) { |
+ #'toolsets': ['target', 'host'], |
+ defines = [ |
+ "CHROME_PNG_READ_PACK_SUPPORT", # Required by freetype. |
+ ] |
+ } |
+} |
+ |
+static_library("libpng") { |
+ sources = [ |
+ "png.c", |
+ "png.h", |
+ "pngconf.h", |
+ "pngerror.c", |
+ "pnggccrd.c", |
+ "pngget.c", |
+ "pngmem.c", |
+ "pngpread.c", |
+ "pngread.c", |
+ "pngrio.c", |
+ "pngrtran.c", |
+ "pngrutil.c", |
+ "pngset.c", |
+ "pngtrans.c", |
+ "pngusr.h", |
+ "pngvcrd.c", |
+ "pngwio.c", |
+ "pngwrite.c", |
+ "pngwtran.c", |
+ "pngwutil.c", |
+ ] |
+ |
+ defines = [ |
+ "CHROME_PNG_WRITE_SUPPORT", |
+ "PNG_USER_CONFIG", |
+ ] |
+ |
+ direct_dependent_configs = [ ":libpng_config" ] |
+ |
+ configs -= "//build/config/compiler:chromium_code" |
+ configs += "//build/config/compiler:no_chromium_code" |
tfarina
2014/01/06 23:20:41
can you make this optional? I found this awkward,
|
+ |
+ #'export_dependent_settings': [ |
+ # '../zlib/zlib.gyp:zlib', |
+ #], |
+ |
+ if (is_win) { |
+ # TODO(jschuh): http://crbug.com/167187 |
+ #'msvs_disabled_warnings': [ 4267 ], |
+ #'type': '<(component)', |
+ |
+ #if (component=="shared_library"') { |
+# defines = [ |
+# "PNG_BUILD_DLL", |
+# "PNG_NO_MODULEDEF", |
+# ] |
+# 'direct_dependent_settings': { |
+# defines = [ |
+# "PNG_USE_DLL", |
+# ] |
+# }, |
+ } else { |
+ #['OS!="win"', {'product_name': 'png'}], |
+ #'type': 'static_library', |
+ } |
+ |
+ deps = [ |
+ "//third_party/zlib", |
+ ] |
+} |