BUILD.gn 1.6 KB

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