BUILD.gn 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #
  2. # Copyright 2014 The LibYuv Project Authors. All rights reserved.
  3. #
  4. # Use of this source code is governed by a BSD-style license
  5. # that can be found in the LICENSE file in the root of the source
  6. # tree. An additional intellectual property rights grant can be found
  7. # in the file PATENTS. All contributing project authors may
  8. # be found in the AUTHORS file in the root of the source tree.
  9. # This is a copy of WebRTC's BUILD.gn.
  10. if (is_win) {
  11. gflags_gen_arch_root = "gen/win"
  12. } else {
  13. gflags_gen_arch_root = "gen/posix"
  14. }
  15. config("gflags_config") {
  16. include_dirs = [
  17. "$gflags_gen_arch_root/include", # For configured files.
  18. "src/src", # For everything else.
  19. ]
  20. defines = [
  21. # These macros exist so flags and symbols are properly exported when
  22. # building DLLs. Since we don't build DLLs, we need to disable them.
  23. "GFLAGS_DLL_DECL=",
  24. "GFLAGS_DLL_DECLARE_FLAG=",
  25. "GFLAGS_DLL_DEFINE_FLAG=",
  26. ]
  27. # GN orders flags on a target before flags from configs. The default config
  28. # adds -Wall, and this flag have to be after -Wall -- so they need to
  29. # come from a config and can't be on the target directly.
  30. if (is_clang) {
  31. cflags = [ "-Wno-unused-local-typedef" ]
  32. }
  33. }
  34. source_set("gflags") {
  35. cflags = []
  36. sources = [
  37. "src/src/gflags.cc",
  38. "src/src/gflags_completions.cc",
  39. "src/src/gflags_reporting.cc",
  40. ]
  41. if (is_win) {
  42. sources += [ "src/src/windows_port.cc" ]
  43. cflags += [
  44. "/wd4005", # WIN32_LEAN_AND_MEAN.
  45. "/wd4267", # Conversion from size_t to "type".
  46. ]
  47. }
  48. include_dirs = [
  49. "$gflags_gen_arch_root/include/gflags", # For configured files.
  50. "$gflags_gen_arch_root/include/private", # For config.h
  51. ]
  52. public_configs = [ ":gflags_config" ]
  53. configs -= [ "//build/config/compiler:chromium_code" ]
  54. configs += [ "//build/config/compiler:no_chromium_code" ]
  55. if (is_win) {
  56. configs -= [ "//build/config/win:unicode" ]
  57. }
  58. if (is_clang) {
  59. # TODO(andrew): Look into fixing this warning upstream:
  60. # http://code.google.com/p/webrtc/issues/detail?id=760
  61. configs -= [ "//build/config/clang:extra_warnings" ]
  62. cflags += [ "-Wno-microsoft-include" ]
  63. }
  64. }