gflags.gyp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 gflags.gyp.
  10. {
  11. 'variables': {
  12. 'gflags_root': '<(DEPTH)/third_party/gflags',
  13. 'conditions': [
  14. ['OS=="win"', {
  15. 'gflags_gen_arch_root': '<(gflags_root)/gen/win',
  16. }, {
  17. 'gflags_gen_arch_root': '<(gflags_root)/gen/posix',
  18. }],
  19. ],
  20. },
  21. 'targets': [
  22. {
  23. 'target_name': 'gflags',
  24. 'type': 'static_library',
  25. 'include_dirs': [
  26. '<(gflags_gen_arch_root)/include/gflags', # For configured files.
  27. '<(gflags_gen_arch_root)/include/private', # For config.h
  28. '<(gflags_root)/src/src', # For everything else.
  29. ],
  30. 'defines': [
  31. # These macros exist so flags and symbols are properly
  32. # exported when building DLLs. Since we don't build DLLs, we
  33. # need to disable them.
  34. 'GFLAGS_DLL_DECL=',
  35. 'GFLAGS_DLL_DECLARE_FLAG=',
  36. 'GFLAGS_DLL_DEFINE_FLAG=',
  37. ],
  38. 'direct_dependent_settings': {
  39. 'include_dirs': [
  40. '<(gflags_gen_arch_root)/include', # For configured files.
  41. '<(gflags_root)/src/src', # For everything else.
  42. ],
  43. 'defines': [
  44. 'GFLAGS_DLL_DECL=',
  45. 'GFLAGS_DLL_DECLARE_FLAG=',
  46. 'GFLAGS_DLL_DEFINE_FLAG=',
  47. ],
  48. },
  49. 'sources': [
  50. 'src/src/gflags.cc',
  51. 'src/src/gflags_completions.cc',
  52. 'src/src/gflags_reporting.cc',
  53. ],
  54. 'conditions': [
  55. ['OS=="win"', {
  56. 'sources': [
  57. 'src/src/windows_port.cc',
  58. ],
  59. 'msvs_disabled_warnings': [
  60. 4005, # WIN32_LEAN_AND_MEAN redefinition.
  61. 4267, # Conversion from size_t to "type".
  62. ],
  63. 'configurations': {
  64. 'Common_Base': {
  65. 'msvs_configuration_attributes': {
  66. 'CharacterSet': '2', # Use Multi-byte Character Set.
  67. },
  68. },
  69. },
  70. }],
  71. # TODO(andrew): Look into fixing this warning upstream:
  72. # http://code.google.com/p/webrtc/issues/detail?id=760
  73. ['OS=="win" and clang==1', {
  74. 'msvs_settings': {
  75. 'VCCLCompilerTool': {
  76. 'AdditionalOptions': [
  77. '-Wno-microsoft-include',
  78. ],
  79. },
  80. },
  81. }],
  82. ['clang==1', {
  83. 'cflags': [
  84. '-Wno-microsoft-include',
  85. ],
  86. }],
  87. ],
  88. },
  89. ],
  90. }