1# Copyright 2018 Google Inc. 2# 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6import("../third_party.gni") 7 8third_party("wuffs") { 9 public_include_dirs = [ "../externals/wuffs/release/c" ] 10 11 defines = [ 12 # Copy/pasting from "../externals/wuffs/release/c/wuffs-*.c": 13 # 14 # ---- 15 # 16 # Wuffs ships as a "single file C library" or "header file library" as per 17 # https://github.com/nothings/stb/blob/master/docs/stb_howto.txt 18 # 19 # To use that single file as a "foo.c"-like implementation, instead of a 20 # "foo.h"-like header, #define WUFFS_IMPLEMENTATION before #include'ing or 21 # compiling it. 22 # 23 # ---- 24 "WUFFS_IMPLEMENTATION", 25 26 # Continuing to copy/paste: 27 # 28 # ---- 29 # 30 # Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users 31 # of Wuffs' .c file whitelist which parts of Wuffs to build. That file 32 # contains the entire Wuffs standard library, implementing a variety of 33 # codecs and file formats. Without this macro definition, an optimizing 34 # compiler or linker may very well discard Wuffs code for unused codecs, 35 # but listing the Wuffs modules we use makes that process explicit. 36 # Preprocessing means that such code simply isn't compiled. 37 # 38 # ---- 39 # 40 # For Skia, we're only interested in particular image codes (e.g. GIF) and 41 # their dependencies (e.g. BASE, LZW). 42 "WUFFS_CONFIG__MODULES", 43 "WUFFS_CONFIG__MODULE__BASE", 44 "WUFFS_CONFIG__MODULE__GIF", 45 "WUFFS_CONFIG__MODULE__LZW", 46 ] 47 48 sources = [ 49 "../externals/wuffs/release/c/wuffs-v0.2.c", 50 ] 51} 52