1
0

http_parser.gyp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # This file is used with the GYP meta build system.
  2. # http://code.google.com/p/gyp/
  3. # To build try this:
  4. # svn co http://gyp.googlecode.com/svn/trunk gyp
  5. # ./gyp/gyp -f make --depth=`pwd` http_parser.gyp
  6. # ./out/Debug/test
  7. {
  8. 'target_defaults': {
  9. 'default_configuration': 'Debug',
  10. 'configurations': {
  11. # TODO: hoist these out and put them somewhere common, because
  12. # RuntimeLibrary MUST MATCH across the entire project
  13. 'Debug': {
  14. 'defines': [ 'DEBUG', '_DEBUG' ],
  15. 'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
  16. 'msvs_settings': {
  17. 'VCCLCompilerTool': {
  18. 'RuntimeLibrary': 1, # static debug
  19. },
  20. },
  21. },
  22. 'Release': {
  23. 'defines': [ 'NDEBUG' ],
  24. 'cflags': [ '-Wall', '-Wextra', '-O3' ],
  25. 'msvs_settings': {
  26. 'VCCLCompilerTool': {
  27. 'RuntimeLibrary': 0, # static release
  28. },
  29. },
  30. }
  31. },
  32. 'msvs_settings': {
  33. 'VCCLCompilerTool': {
  34. },
  35. 'VCLibrarianTool': {
  36. },
  37. 'VCLinkerTool': {
  38. 'GenerateDebugInformation': 'true',
  39. },
  40. },
  41. 'conditions': [
  42. ['OS == "win"', {
  43. 'defines': [
  44. 'WIN32'
  45. ],
  46. }]
  47. ],
  48. },
  49. 'targets': [
  50. {
  51. 'target_name': 'http_parser',
  52. 'type': 'static_library',
  53. 'include_dirs': [ '.' ],
  54. 'direct_dependent_settings': {
  55. 'defines': [ 'HTTP_PARSER_STRICT=0' ],
  56. 'include_dirs': [ '.' ],
  57. },
  58. 'defines': [ 'HTTP_PARSER_STRICT=0' ],
  59. 'sources': [ './http_parser.c', ],
  60. 'conditions': [
  61. ['OS=="win"', {
  62. 'msvs_settings': {
  63. 'VCCLCompilerTool': {
  64. # Compile as C++. http_parser.c is actually C99, but C++ is
  65. # close enough in this case.
  66. 'CompileAs': 2,
  67. },
  68. },
  69. }]
  70. ],
  71. },
  72. {
  73. 'target_name': 'http_parser_strict',
  74. 'type': 'static_library',
  75. 'include_dirs': [ '.' ],
  76. 'direct_dependent_settings': {
  77. 'defines': [ 'HTTP_PARSER_STRICT=1' ],
  78. 'include_dirs': [ '.' ],
  79. },
  80. 'defines': [ 'HTTP_PARSER_STRICT=1' ],
  81. 'sources': [ './http_parser.c', ],
  82. 'conditions': [
  83. ['OS=="win"', {
  84. 'msvs_settings': {
  85. 'VCCLCompilerTool': {
  86. # Compile as C++. http_parser.c is actually C99, but C++ is
  87. # close enough in this case.
  88. 'CompileAs': 2,
  89. },
  90. },
  91. }]
  92. ],
  93. },
  94. {
  95. 'target_name': 'test-nonstrict',
  96. 'type': 'executable',
  97. 'dependencies': [ 'http_parser' ],
  98. 'sources': [ 'test.c' ]
  99. },
  100. {
  101. 'target_name': 'test-strict',
  102. 'type': 'executable',
  103. 'dependencies': [ 'http_parser_strict' ],
  104. 'sources': [ 'test.c' ]
  105. }
  106. ]
  107. }