mt-libuv 4.1.0 → 4.1.03

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2094) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/ext/Rakefile +1 -1
  4. data/ext/gyp/.gitignore +1 -0
  5. data/ext/gyp/AUTHORS +17 -0
  6. data/ext/gyp/DEPS +23 -0
  7. data/ext/gyp/LICENSE +27 -0
  8. data/ext/gyp/OWNERS +1 -0
  9. data/ext/gyp/PRESUBMIT.py +125 -0
  10. data/ext/gyp/README.md +5 -0
  11. data/ext/gyp/buildbot/buildbot_run.py +138 -0
  12. data/ext/gyp/buildbot/commit_queue/OWNERS +6 -0
  13. data/ext/gyp/buildbot/commit_queue/README +3 -0
  14. data/ext/gyp/buildbot/commit_queue/cq_config.json +15 -0
  15. data/ext/gyp/buildbot/travis-checkout.sh +27 -0
  16. data/ext/gyp/buildbot/travis-test.sh +12 -0
  17. data/ext/gyp/codereview.settings +6 -0
  18. data/ext/gyp/data/win/large-pdb-shim.cc +12 -0
  19. data/ext/gyp/gyp +8 -0
  20. data/ext/gyp/gyp.bat +5 -0
  21. data/ext/gyp/gyp_main.py +16 -0
  22. data/ext/gyp/gyptest.py +243 -0
  23. data/ext/gyp/pylib/gyp/MSVSNew.py +353 -0
  24. data/ext/gyp/pylib/gyp/MSVSProject.py +208 -0
  25. data/ext/gyp/pylib/gyp/MSVSSettings.py +1106 -0
  26. data/ext/gyp/pylib/gyp/MSVSSettings_test.py +1486 -0
  27. data/ext/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  28. data/ext/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  29. data/ext/gyp/pylib/gyp/MSVSUtil.py +271 -0
  30. data/ext/gyp/pylib/gyp/MSVSVersion.py +504 -0
  31. data/ext/gyp/pylib/gyp/__init__.py +555 -0
  32. data/ext/gyp/pylib/gyp/common.py +619 -0
  33. data/ext/gyp/pylib/gyp/common_test.py +73 -0
  34. data/ext/gyp/pylib/gyp/easy_xml.py +170 -0
  35. data/ext/gyp/pylib/gyp/easy_xml_test.py +106 -0
  36. data/ext/gyp/pylib/gyp/flock_tool.py +54 -0
  37. data/ext/gyp/pylib/gyp/generator/__init__.py +0 -0
  38. data/ext/gyp/pylib/gyp/generator/analyzer.py +744 -0
  39. data/ext/gyp/pylib/gyp/generator/cmake.py +1256 -0
  40. data/ext/gyp/pylib/gyp/generator/dump_dependency_json.py +101 -0
  41. data/ext/gyp/pylib/gyp/generator/eclipse.py +425 -0
  42. data/ext/gyp/pylib/gyp/generator/gypd.py +94 -0
  43. data/ext/gyp/pylib/gyp/generator/gypsh.py +56 -0
  44. data/ext/gyp/pylib/gyp/generator/make.py +2260 -0
  45. data/ext/gyp/pylib/gyp/generator/msvs.py +3537 -0
  46. data/ext/gyp/pylib/gyp/generator/msvs_test.py +40 -0
  47. data/ext/gyp/pylib/gyp/generator/ninja.py +2500 -0
  48. data/ext/gyp/pylib/gyp/generator/ninja_test.py +46 -0
  49. data/ext/gyp/pylib/gyp/generator/xcode.py +1302 -0
  50. data/ext/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  51. data/ext/gyp/pylib/gyp/input.py +2908 -0
  52. data/ext/gyp/pylib/gyp/input_test.py +90 -0
  53. data/ext/gyp/pylib/gyp/mac_tool.py +721 -0
  54. data/ext/gyp/pylib/gyp/msvs_emulation.py +1112 -0
  55. data/ext/gyp/pylib/gyp/ninja_syntax.py +168 -0
  56. data/ext/gyp/pylib/gyp/simple_copy.py +57 -0
  57. data/ext/gyp/pylib/gyp/win_tool.py +326 -0
  58. data/ext/gyp/pylib/gyp/xcode_emulation.py +1800 -0
  59. data/ext/gyp/pylib/gyp/xcode_ninja.py +289 -0
  60. data/ext/gyp/pylib/gyp/xcodeproj_file.py +2995 -0
  61. data/ext/gyp/pylib/gyp/xml_fix.py +68 -0
  62. data/ext/gyp/samples/samples +83 -0
  63. data/ext/gyp/samples/samples.bat +5 -0
  64. data/ext/gyp/setup.py +19 -0
  65. data/ext/gyp/test/actions/generated-header/action.py +11 -0
  66. data/ext/gyp/test/actions/generated-header/main.cc +7 -0
  67. data/ext/gyp/test/actions/generated-header/test.gyp +34 -0
  68. data/ext/gyp/test/actions/gyptest-all.py +101 -0
  69. data/ext/gyp/test/actions/gyptest-default.py +68 -0
  70. data/ext/gyp/test/actions/gyptest-errors.py +24 -0
  71. data/ext/gyp/test/actions/gyptest-generated-header.py +38 -0
  72. data/ext/gyp/test/actions/src/action_missing_name.gyp +24 -0
  73. data/ext/gyp/test/actions/src/actions.gyp +114 -0
  74. data/ext/gyp/test/actions/src/confirm-dep-files.py +21 -0
  75. data/ext/gyp/test/actions/src/subdir1/counter.py +44 -0
  76. data/ext/gyp/test/actions/src/subdir1/executable.gyp +74 -0
  77. data/ext/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
  78. data/ext/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
  79. data/ext/gyp/test/actions/src/subdir1/program.c +12 -0
  80. data/ext/gyp/test/actions/src/subdir2/make-file.py +11 -0
  81. data/ext/gyp/test/actions/src/subdir2/none.gyp +33 -0
  82. data/ext/gyp/test/actions/src/subdir3/generate_main.py +21 -0
  83. data/ext/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
  84. data/ext/gyp/test/actions-bare/gyptest-bare.py +24 -0
  85. data/ext/gyp/test/actions-bare/src/bare.gyp +25 -0
  86. data/ext/gyp/test/actions-bare/src/bare.py +11 -0
  87. data/ext/gyp/test/actions-depfile/depfile.gyp +42 -0
  88. data/ext/gyp/test/actions-depfile/gyptest-all.py +30 -0
  89. data/ext/gyp/test/actions-depfile/input.txt +1 -0
  90. data/ext/gyp/test/actions-depfile/touch.py +18 -0
  91. data/ext/gyp/test/actions-multiple/gyptest-all.py +72 -0
  92. data/ext/gyp/test/actions-multiple/src/actions.gyp +226 -0
  93. data/ext/gyp/test/actions-multiple/src/copyfile.py +9 -0
  94. data/ext/gyp/test/actions-multiple/src/filter.py +12 -0
  95. data/ext/gyp/test/actions-multiple/src/foo.c +11 -0
  96. data/ext/gyp/test/actions-multiple/src/input.txt +1 -0
  97. data/ext/gyp/test/actions-multiple/src/main.c +22 -0
  98. data/ext/gyp/test/actions-multiple-outputs/gyptest-multiple-outputs.py +45 -0
  99. data/ext/gyp/test/actions-multiple-outputs/src/multiple-outputs.gyp +23 -0
  100. data/ext/gyp/test/actions-multiple-outputs/src/touch.py +16 -0
  101. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/gyptest-action.py +45 -0
  102. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/action.gyp +28 -0
  103. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/rcopy.py +20 -0
  104. data/ext/gyp/test/actions-none/gyptest-none.py +24 -0
  105. data/ext/gyp/test/actions-none/src/fake_cross.py +12 -0
  106. data/ext/gyp/test/actions-none/src/foo.cc +1 -0
  107. data/ext/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
  108. data/ext/gyp/test/actions-subdir/gyptest-action.py +26 -0
  109. data/ext/gyp/test/actions-subdir/src/make-file.py +11 -0
  110. data/ext/gyp/test/actions-subdir/src/none.gyp +31 -0
  111. data/ext/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
  112. data/ext/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
  113. data/ext/gyp/test/additional-targets/gyptest-additional.py +63 -0
  114. data/ext/gyp/test/additional-targets/src/all.gyp +13 -0
  115. data/ext/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
  116. data/ext/gyp/test/additional-targets/src/dir1/emit.py +11 -0
  117. data/ext/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
  118. data/ext/gyp/test/analyzer/common.gypi +6 -0
  119. data/ext/gyp/test/analyzer/gyptest-analyzer.py +427 -0
  120. data/ext/gyp/test/analyzer/static_library_test.gyp +34 -0
  121. data/ext/gyp/test/analyzer/subdir/subdir.gyp +36 -0
  122. data/ext/gyp/test/analyzer/subdir/subdir2/subdir2.gyp +15 -0
  123. data/ext/gyp/test/analyzer/subdir2/subdir.gyp +18 -0
  124. data/ext/gyp/test/analyzer/subdir2/subdir.includes.gypi +9 -0
  125. data/ext/gyp/test/analyzer/test.gyp +114 -0
  126. data/ext/gyp/test/analyzer/test2.gyp +25 -0
  127. data/ext/gyp/test/analyzer/test2.includes.gypi +13 -0
  128. data/ext/gyp/test/analyzer/test2.includes.includes.gypi +9 -0
  129. data/ext/gyp/test/analyzer/test2.toplevel_includes.gypi +15 -0
  130. data/ext/gyp/test/analyzer/test3.gyp +77 -0
  131. data/ext/gyp/test/analyzer/test4.gyp +80 -0
  132. data/ext/gyp/test/analyzer/test5.gyp +25 -0
  133. data/ext/gyp/test/arflags/gyptest-arflags.py +26 -0
  134. data/ext/gyp/test/arflags/lib.cc +0 -0
  135. data/ext/gyp/test/arflags/test.gyp +10 -0
  136. data/ext/gyp/test/assembly/gyptest-assembly.py +31 -0
  137. data/ext/gyp/test/assembly/gyptest-override.py +24 -0
  138. data/ext/gyp/test/assembly/src/as.bat +4 -0
  139. data/ext/gyp/test/assembly/src/assembly.gyp +62 -0
  140. data/ext/gyp/test/assembly/src/lib1.S +15 -0
  141. data/ext/gyp/test/assembly/src/lib1.c +3 -0
  142. data/ext/gyp/test/assembly/src/override.gyp +34 -0
  143. data/ext/gyp/test/assembly/src/override_asm.asm +8 -0
  144. data/ext/gyp/test/assembly/src/program.c +12 -0
  145. data/ext/gyp/test/build-option/gyptest-build.py +27 -0
  146. data/ext/gyp/test/build-option/hello.c +13 -0
  147. data/ext/gyp/test/build-option/hello.gyp +15 -0
  148. data/ext/gyp/test/builddir/gyptest-all.py +85 -0
  149. data/ext/gyp/test/builddir/gyptest-default.py +85 -0
  150. data/ext/gyp/test/builddir/src/builddir.gypi +18 -0
  151. data/ext/gyp/test/builddir/src/func1.c +6 -0
  152. data/ext/gyp/test/builddir/src/func2.c +6 -0
  153. data/ext/gyp/test/builddir/src/func3.c +6 -0
  154. data/ext/gyp/test/builddir/src/func4.c +6 -0
  155. data/ext/gyp/test/builddir/src/func5.c +6 -0
  156. data/ext/gyp/test/builddir/src/prog1.c +10 -0
  157. data/ext/gyp/test/builddir/src/prog1.gyp +30 -0
  158. data/ext/gyp/test/builddir/src/subdir2/prog2.c +10 -0
  159. data/ext/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
  160. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
  161. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
  162. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
  163. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
  164. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
  165. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
  166. data/ext/gyp/test/cflags/cflags.c +15 -0
  167. data/ext/gyp/test/cflags/cflags.gyp +23 -0
  168. data/ext/gyp/test/cflags/gyptest-cflags.py +75 -0
  169. data/ext/gyp/test/compilable/gyptest-headers.py +29 -0
  170. data/ext/gyp/test/compilable/src/headers.gyp +26 -0
  171. data/ext/gyp/test/compilable/src/lib1.cpp +7 -0
  172. data/ext/gyp/test/compilable/src/lib1.hpp +6 -0
  173. data/ext/gyp/test/compilable/src/program.cpp +9 -0
  174. data/ext/gyp/test/compiler-override/compiler-exe.gyp +16 -0
  175. data/ext/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
  176. data/ext/gyp/test/compiler-override/compiler-host.gyp +17 -0
  177. data/ext/gyp/test/compiler-override/compiler-shared-lib.gyp +16 -0
  178. data/ext/gyp/test/compiler-override/cxxtest.cc +7 -0
  179. data/ext/gyp/test/compiler-override/gyptest-compiler-env-toolchain.py +78 -0
  180. data/ext/gyp/test/compiler-override/gyptest-compiler-env.py +110 -0
  181. data/ext/gyp/test/compiler-override/gyptest-compiler-global-settings.py +82 -0
  182. data/ext/gyp/test/compiler-override/my_cc.py +7 -0
  183. data/ext/gyp/test/compiler-override/my_cxx.py +7 -0
  184. data/ext/gyp/test/compiler-override/my_ld.py +7 -0
  185. data/ext/gyp/test/compiler-override/my_nm.py +9 -0
  186. data/ext/gyp/test/compiler-override/my_readelf.py +9 -0
  187. data/ext/gyp/test/compiler-override/test.c +7 -0
  188. data/ext/gyp/test/conditions/elseif/elseif.gyp +43 -0
  189. data/ext/gyp/test/conditions/elseif/elseif_bad1.gyp +20 -0
  190. data/ext/gyp/test/conditions/elseif/elseif_bad2.gyp +22 -0
  191. data/ext/gyp/test/conditions/elseif/elseif_bad3.gyp +23 -0
  192. data/ext/gyp/test/conditions/elseif/elseif_conditions.gypi +15 -0
  193. data/ext/gyp/test/conditions/elseif/gyptest_elseif.py +33 -0
  194. data/ext/gyp/test/conditions/elseif/program.cc +10 -0
  195. data/ext/gyp/test/configurations/basics/configurations.c +15 -0
  196. data/ext/gyp/test/configurations/basics/configurations.gyp +32 -0
  197. data/ext/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
  198. data/ext/gyp/test/configurations/inheritance/configurations.c +21 -0
  199. data/ext/gyp/test/configurations/inheritance/configurations.gyp +40 -0
  200. data/ext/gyp/test/configurations/inheritance/duplicates.gyp +27 -0
  201. data/ext/gyp/test/configurations/inheritance/duplicates.gypd.golden +12 -0
  202. data/ext/gyp/test/configurations/inheritance/gyptest-duplicates.py +36 -0
  203. data/ext/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
  204. data/ext/gyp/test/configurations/invalid/actions.gyp +18 -0
  205. data/ext/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
  206. data/ext/gyp/test/configurations/invalid/configurations.gyp +18 -0
  207. data/ext/gyp/test/configurations/invalid/dependencies.gyp +18 -0
  208. data/ext/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
  209. data/ext/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
  210. data/ext/gyp/test/configurations/invalid/libraries.gyp +18 -0
  211. data/ext/gyp/test/configurations/invalid/link_settings.gyp +18 -0
  212. data/ext/gyp/test/configurations/invalid/sources.gyp +18 -0
  213. data/ext/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
  214. data/ext/gyp/test/configurations/invalid/target_name.gyp +18 -0
  215. data/ext/gyp/test/configurations/invalid/type.gyp +18 -0
  216. data/ext/gyp/test/configurations/target_platform/configurations.gyp +58 -0
  217. data/ext/gyp/test/configurations/target_platform/front.c +8 -0
  218. data/ext/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
  219. data/ext/gyp/test/configurations/target_platform/left.c +3 -0
  220. data/ext/gyp/test/configurations/target_platform/right.c +3 -0
  221. data/ext/gyp/test/configurations/x64/configurations.c +12 -0
  222. data/ext/gyp/test/configurations/x64/configurations.gyp +38 -0
  223. data/ext/gyp/test/configurations/x64/gyptest-x86.py +31 -0
  224. data/ext/gyp/test/copies/gyptest-all.py +42 -0
  225. data/ext/gyp/test/copies/gyptest-attribs.py +41 -0
  226. data/ext/gyp/test/copies/gyptest-default.py +42 -0
  227. data/ext/gyp/test/copies/gyptest-samedir.py +28 -0
  228. data/ext/gyp/test/copies/gyptest-slash.py +39 -0
  229. data/ext/gyp/test/copies/gyptest-sourceless-shared-lib.py +20 -0
  230. data/ext/gyp/test/copies/gyptest-updir.py +32 -0
  231. data/ext/gyp/test/copies/src/copies-attribs.gyp +20 -0
  232. data/ext/gyp/test/copies/src/copies-samedir.gyp +37 -0
  233. data/ext/gyp/test/copies/src/copies-slash.gyp +36 -0
  234. data/ext/gyp/test/copies/src/copies-sourceless-shared-lib.gyp +27 -0
  235. data/ext/gyp/test/copies/src/copies-updir.gyp +21 -0
  236. data/ext/gyp/test/copies/src/copies.gyp +70 -0
  237. data/ext/gyp/test/copies/src/directory/file3 +1 -0
  238. data/ext/gyp/test/copies/src/directory/file4 +1 -0
  239. data/ext/gyp/test/copies/src/directory/subdir/file5 +1 -0
  240. data/ext/gyp/test/copies/src/executable-file.sh +3 -0
  241. data/ext/gyp/test/copies/src/file1 +1 -0
  242. data/ext/gyp/test/copies/src/file2 +1 -0
  243. data/ext/gyp/test/copies/src/foo.c +13 -0
  244. data/ext/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
  245. data/ext/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
  246. data/ext/gyp/test/custom-generator/mygenerator.py +14 -0
  247. data/ext/gyp/test/custom-generator/test.gyp +15 -0
  248. data/ext/gyp/test/cxxflags/cxxflags.cc +15 -0
  249. data/ext/gyp/test/cxxflags/cxxflags.gyp +15 -0
  250. data/ext/gyp/test/cxxflags/gyptest-cxxflags.py +45 -0
  251. data/ext/gyp/test/defines/defines-env.gyp +22 -0
  252. data/ext/gyp/test/defines/defines.c +23 -0
  253. data/ext/gyp/test/defines/defines.gyp +38 -0
  254. data/ext/gyp/test/defines/gyptest-define-override.py +43 -0
  255. data/ext/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
  256. data/ext/gyp/test/defines/gyptest-defines-env.py +85 -0
  257. data/ext/gyp/test/defines/gyptest-defines.py +39 -0
  258. data/ext/gyp/test/defines-escaping/defines-escaping.c +11 -0
  259. data/ext/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
  260. data/ext/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
  261. data/ext/gyp/test/dependencies/a.c +9 -0
  262. data/ext/gyp/test/dependencies/adso/all_dependent_settings_order.gyp +45 -0
  263. data/ext/gyp/test/dependencies/adso/write_args.py +11 -0
  264. data/ext/gyp/test/dependencies/b/b.c +3 -0
  265. data/ext/gyp/test/dependencies/b/b.gyp +22 -0
  266. data/ext/gyp/test/dependencies/b/b3.c +9 -0
  267. data/ext/gyp/test/dependencies/c/c.c +4 -0
  268. data/ext/gyp/test/dependencies/c/c.gyp +22 -0
  269. data/ext/gyp/test/dependencies/c/d.c +3 -0
  270. data/ext/gyp/test/dependencies/double_dependency.gyp +23 -0
  271. data/ext/gyp/test/dependencies/double_dependent.gyp +12 -0
  272. data/ext/gyp/test/dependencies/extra_targets.gyp +18 -0
  273. data/ext/gyp/test/dependencies/gyptest-all-dependent-settings-order.py +19 -0
  274. data/ext/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
  275. data/ext/gyp/test/dependencies/gyptest-extra-targets.py +22 -0
  276. data/ext/gyp/test/dependencies/gyptest-indirect-module-dependency.py +22 -0
  277. data/ext/gyp/test/dependencies/gyptest-lib-only.py +39 -0
  278. data/ext/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
  279. data/ext/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
  280. data/ext/gyp/test/dependencies/lib_only.gyp +16 -0
  281. data/ext/gyp/test/dependencies/main.c +14 -0
  282. data/ext/gyp/test/dependencies/module-dep/a.cc +7 -0
  283. data/ext/gyp/test/dependencies/module-dep/dll.cc +9 -0
  284. data/ext/gyp/test/dependencies/module-dep/exe.cc +7 -0
  285. data/ext/gyp/test/dependencies/module-dep/indirect-module-dependency.gyp +37 -0
  286. data/ext/gyp/test/dependencies/none_traversal.gyp +46 -0
  287. data/ext/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
  288. data/ext/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
  289. data/ext/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
  290. data/ext/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
  291. data/ext/gyp/test/dependency-copy/gyptest-copy.py +26 -0
  292. data/ext/gyp/test/dependency-copy/src/copies.gyp +25 -0
  293. data/ext/gyp/test/dependency-copy/src/file1.c +7 -0
  294. data/ext/gyp/test/dependency-copy/src/file2.c +7 -0
  295. data/ext/gyp/test/dependent-settings/nested-dependent-settings/all-dependent-settings.gyp +19 -0
  296. data/ext/gyp/test/dependent-settings/nested-dependent-settings/direct-dependent-settings.gyp +19 -0
  297. data/ext/gyp/test/dependent-settings/nested-dependent-settings/gyptest-nested-dependent-settings.py +18 -0
  298. data/ext/gyp/test/determinism/determinism.gyp +59 -0
  299. data/ext/gyp/test/determinism/empty-targets.gyp +32 -0
  300. data/ext/gyp/test/determinism/gyptest-determinism.py +30 -0
  301. data/ext/gyp/test/determinism/gyptest-empty-target-names.py +30 -0
  302. data/ext/gyp/test/determinism/gyptest-needed-variables.py +30 -0
  303. data/ext/gyp/test/determinism/gyptest-solibs.py +37 -0
  304. data/ext/gyp/test/determinism/main.cc +5 -0
  305. data/ext/gyp/test/determinism/needed-variables.gyp +33 -0
  306. data/ext/gyp/test/determinism/rule.py +8 -0
  307. data/ext/gyp/test/determinism/solib.cc +8 -0
  308. data/ext/gyp/test/determinism/solibs.gyp +32 -0
  309. data/ext/gyp/test/empty-target/empty-target.gyp +12 -0
  310. data/ext/gyp/test/empty-target/gyptest-empty-target.py +18 -0
  311. data/ext/gyp/test/errors/dependency_cycle.gyp +23 -0
  312. data/ext/gyp/test/errors/duplicate_basenames.gyp +13 -0
  313. data/ext/gyp/test/errors/duplicate_node.gyp +12 -0
  314. data/ext/gyp/test/errors/duplicate_rule.gyp +22 -0
  315. data/ext/gyp/test/errors/duplicate_targets.gyp +14 -0
  316. data/ext/gyp/test/errors/error_command.gyp +12 -0
  317. data/ext/gyp/test/errors/file_cycle0.gyp +17 -0
  318. data/ext/gyp/test/errors/file_cycle1.gyp +13 -0
  319. data/ext/gyp/test/errors/gyptest-errors.py +80 -0
  320. data/ext/gyp/test/errors/missing_command.gyp +12 -0
  321. data/ext/gyp/test/errors/missing_dep.gyp +15 -0
  322. data/ext/gyp/test/errors/missing_targets.gyp +8 -0
  323. data/ext/gyp/test/escaping/colon/test.gyp +21 -0
  324. data/ext/gyp/test/escaping/gyptest-colon.py +51 -0
  325. data/ext/gyp/test/exclusion/exclusion.gyp +23 -0
  326. data/ext/gyp/test/exclusion/gyptest-exclusion.py +22 -0
  327. data/ext/gyp/test/exclusion/hello.c +15 -0
  328. data/ext/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
  329. data/ext/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
  330. data/ext/gyp/test/external-cross-compile/src/bogus2.c +1 -0
  331. data/ext/gyp/test/external-cross-compile/src/cross.gyp +83 -0
  332. data/ext/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
  333. data/ext/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
  334. data/ext/gyp/test/external-cross-compile/src/program.cc +16 -0
  335. data/ext/gyp/test/external-cross-compile/src/test1.cc +1 -0
  336. data/ext/gyp/test/external-cross-compile/src/test2.c +1 -0
  337. data/ext/gyp/test/external-cross-compile/src/test3.cc +1 -0
  338. data/ext/gyp/test/external-cross-compile/src/test4.c +1 -0
  339. data/ext/gyp/test/external-cross-compile/src/tochar.py +13 -0
  340. data/ext/gyp/test/generator-output/actions/actions.gyp +16 -0
  341. data/ext/gyp/test/generator-output/actions/build/README.txt +4 -0
  342. data/ext/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
  343. data/ext/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
  344. data/ext/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
  345. data/ext/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
  346. data/ext/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
  347. data/ext/gyp/test/generator-output/actions/subdir1/program.c +12 -0
  348. data/ext/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
  349. data/ext/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
  350. data/ext/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
  351. data/ext/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
  352. data/ext/gyp/test/generator-output/copies/build/README.txt +4 -0
  353. data/ext/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
  354. data/ext/gyp/test/generator-output/copies/copies.gyp +50 -0
  355. data/ext/gyp/test/generator-output/copies/file1 +1 -0
  356. data/ext/gyp/test/generator-output/copies/file2 +1 -0
  357. data/ext/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
  358. data/ext/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
  359. data/ext/gyp/test/generator-output/copies/subdir/file3 +1 -0
  360. data/ext/gyp/test/generator-output/copies/subdir/file4 +1 -0
  361. data/ext/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
  362. data/ext/gyp/test/generator-output/gyptest-actions.py +57 -0
  363. data/ext/gyp/test/generator-output/gyptest-copies.py +59 -0
  364. data/ext/gyp/test/generator-output/gyptest-depth.py +58 -0
  365. data/ext/gyp/test/generator-output/gyptest-mac-bundle.py +33 -0
  366. data/ext/gyp/test/generator-output/gyptest-relocate.py +59 -0
  367. data/ext/gyp/test/generator-output/gyptest-rules.py +58 -0
  368. data/ext/gyp/test/generator-output/gyptest-subdir2-deep.py +36 -0
  369. data/ext/gyp/test/generator-output/gyptest-symlink.py +44 -0
  370. data/ext/gyp/test/generator-output/gyptest-top-all.py +53 -0
  371. data/ext/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
  372. data/ext/gyp/test/generator-output/mac-bundle/app.order +1 -0
  373. data/ext/gyp/test/generator-output/mac-bundle/header.h +1 -0
  374. data/ext/gyp/test/generator-output/mac-bundle/main.c +1 -0
  375. data/ext/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
  376. data/ext/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
  377. data/ext/gyp/test/generator-output/rules/build/README.txt +4 -0
  378. data/ext/gyp/test/generator-output/rules/copy-file.py +12 -0
  379. data/ext/gyp/test/generator-output/rules/rules.gyp +16 -0
  380. data/ext/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
  381. data/ext/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
  382. data/ext/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
  383. data/ext/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
  384. data/ext/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
  385. data/ext/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
  386. data/ext/gyp/test/generator-output/rules/subdir1/program.c +18 -0
  387. data/ext/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
  388. data/ext/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
  389. data/ext/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
  390. data/ext/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
  391. data/ext/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
  392. data/ext/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
  393. data/ext/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
  394. data/ext/gyp/test/generator-output/src/build/README.txt +4 -0
  395. data/ext/gyp/test/generator-output/src/inc.h +1 -0
  396. data/ext/gyp/test/generator-output/src/inc1/include1.h +1 -0
  397. data/ext/gyp/test/generator-output/src/prog1.c +18 -0
  398. data/ext/gyp/test/generator-output/src/prog1.gyp +28 -0
  399. data/ext/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
  400. data/ext/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
  401. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
  402. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
  403. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
  404. data/ext/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
  405. data/ext/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
  406. data/ext/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
  407. data/ext/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
  408. data/ext/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
  409. data/ext/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
  410. data/ext/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
  411. data/ext/gyp/test/generator-output/src/symroot.gypi +16 -0
  412. data/ext/gyp/test/gyp-defines/defines.gyp +26 -0
  413. data/ext/gyp/test/gyp-defines/echo.py +11 -0
  414. data/ext/gyp/test/gyp-defines/gyptest-multiple-values.py +36 -0
  415. data/ext/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
  416. data/ext/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
  417. data/ext/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
  418. data/ext/gyp/test/hard_dependency/src/a.c +9 -0
  419. data/ext/gyp/test/hard_dependency/src/a.h +12 -0
  420. data/ext/gyp/test/hard_dependency/src/b.c +9 -0
  421. data/ext/gyp/test/hard_dependency/src/b.h +12 -0
  422. data/ext/gyp/test/hard_dependency/src/c.c +10 -0
  423. data/ext/gyp/test/hard_dependency/src/c.h +10 -0
  424. data/ext/gyp/test/hard_dependency/src/d.c +9 -0
  425. data/ext/gyp/test/hard_dependency/src/emit.py +11 -0
  426. data/ext/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
  427. data/ext/gyp/test/hello/gyptest-all.py +24 -0
  428. data/ext/gyp/test/hello/gyptest-default.py +24 -0
  429. data/ext/gyp/test/hello/gyptest-disable-regyp.py +32 -0
  430. data/ext/gyp/test/hello/gyptest-regyp-output.py +36 -0
  431. data/ext/gyp/test/hello/gyptest-regyp.py +32 -0
  432. data/ext/gyp/test/hello/gyptest-target.py +24 -0
  433. data/ext/gyp/test/hello/hello.c +11 -0
  434. data/ext/gyp/test/hello/hello.gyp +15 -0
  435. data/ext/gyp/test/hello/hello2.c +11 -0
  436. data/ext/gyp/test/hello/hello2.gyp +15 -0
  437. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
  438. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
  439. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
  440. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
  441. data/ext/gyp/test/home_dot_gyp/home/.gyp/include.gypi +5 -0
  442. data/ext/gyp/test/home_dot_gyp/home2/.gyp/include.gypi +5 -0
  443. data/ext/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi +5 -0
  444. data/ext/gyp/test/home_dot_gyp/src/all.gyp +22 -0
  445. data/ext/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
  446. data/ext/gyp/test/include_dirs/gyptest-all.py +43 -0
  447. data/ext/gyp/test/include_dirs/gyptest-default.py +43 -0
  448. data/ext/gyp/test/include_dirs/src/inc.h +1 -0
  449. data/ext/gyp/test/include_dirs/src/inc1/include1.h +1 -0
  450. data/ext/gyp/test/include_dirs/src/includes.c +19 -0
  451. data/ext/gyp/test/include_dirs/src/includes.gyp +27 -0
  452. data/ext/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
  453. data/ext/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
  454. data/ext/gyp/test/include_dirs/src/subdir/inc.h +1 -0
  455. data/ext/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
  456. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
  457. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
  458. data/ext/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +44 -0
  459. data/ext/gyp/test/intermediate_dir/src/script.py +22 -0
  460. data/ext/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
  461. data/ext/gyp/test/intermediate_dir/src/test.gyp +42 -0
  462. data/ext/gyp/test/intermediate_dir/src/test2.gyp +42 -0
  463. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  464. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  465. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/LanguageMap.plist +8 -0
  466. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +17 -0
  467. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
  468. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  469. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  470. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  471. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  472. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  473. data/ext/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +28 -0
  474. data/ext/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
  475. data/ext/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
  476. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
  477. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
  478. data/ext/gyp/test/ios/app-bundle/test-archs.gyp +109 -0
  479. data/ext/gyp/test/ios/app-bundle/test-assets-catalog.gyp +45 -0
  480. data/ext/gyp/test/ios/app-bundle/test-crosscompile.gyp +47 -0
  481. data/ext/gyp/test/ios/app-bundle/test-device.gyp +109 -0
  482. data/ext/gyp/test/ios/app-bundle/test.gyp +75 -0
  483. data/ext/gyp/test/ios/app-bundle/tool_main.cc +7 -0
  484. data/ext/gyp/test/ios/copies-with-xcode-envvars/Info.plist +24 -0
  485. data/ext/gyp/test/ios/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +97 -0
  486. data/ext/gyp/test/ios/copies-with-xcode-envvars/empty.c +1 -0
  487. data/ext/gyp/test/ios/copies-with-xcode-envvars/file0 +1 -0
  488. data/ext/gyp/test/ios/copies-with-xcode-envvars/file1 +1 -0
  489. data/ext/gyp/test/ios/copies-with-xcode-envvars/file10 +1 -0
  490. data/ext/gyp/test/ios/copies-with-xcode-envvars/file11 +1 -0
  491. data/ext/gyp/test/ios/copies-with-xcode-envvars/file2 +1 -0
  492. data/ext/gyp/test/ios/copies-with-xcode-envvars/file3 +1 -0
  493. data/ext/gyp/test/ios/copies-with-xcode-envvars/file4 +1 -0
  494. data/ext/gyp/test/ios/copies-with-xcode-envvars/file5 +1 -0
  495. data/ext/gyp/test/ios/copies-with-xcode-envvars/file6 +1 -0
  496. data/ext/gyp/test/ios/copies-with-xcode-envvars/file7 +1 -0
  497. data/ext/gyp/test/ios/copies-with-xcode-envvars/file8 +1 -0
  498. data/ext/gyp/test/ios/copies-with-xcode-envvars/file9 +1 -0
  499. data/ext/gyp/test/ios/deployment-target/check-version-min.c +33 -0
  500. data/ext/gyp/test/ios/deployment-target/deployment-target.gyp +34 -0
  501. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.h +9 -0
  502. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.m +31 -0
  503. data/ext/gyp/test/ios/extension/ActionExtension/Info.plist +42 -0
  504. data/ext/gyp/test/ios/extension/ActionExtension/MainInterface.storyboard +63 -0
  505. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.h +12 -0
  506. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.m +19 -0
  507. data/ext/gyp/test/ios/extension/ExtensionContainer/Base.lproj/Main.storyboard +25 -0
  508. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  509. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  510. data/ext/gyp/test/ios/extension/ExtensionContainer/Info.plist +32 -0
  511. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.h +11 -0
  512. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.m +24 -0
  513. data/ext/gyp/test/ios/extension/ExtensionContainer/main.m +13 -0
  514. data/ext/gyp/test/ios/extension/extension.gyp +91 -0
  515. data/ext/gyp/test/ios/framework/framework.gyp +43 -0
  516. data/ext/gyp/test/ios/framework/iOSFramework/Info.plist +26 -0
  517. data/ext/gyp/test/ios/framework/iOSFramework/Thing.h +10 -0
  518. data/ext/gyp/test/ios/framework/iOSFramework/Thing.m +22 -0
  519. data/ext/gyp/test/ios/framework/iOSFramework/iOSFramework.h +9 -0
  520. data/ext/gyp/test/ios/gyptest-app-ios-assets-catalog.py +57 -0
  521. data/ext/gyp/test/ios/gyptest-app-ios.py +76 -0
  522. data/ext/gyp/test/ios/gyptest-archs.py +62 -0
  523. data/ext/gyp/test/ios/gyptest-copies-with-xcode-envvars.py +65 -0
  524. data/ext/gyp/test/ios/gyptest-crosscompile.py +34 -0
  525. data/ext/gyp/test/ios/gyptest-deployment-target.py +23 -0
  526. data/ext/gyp/test/ios/gyptest-extension.py +51 -0
  527. data/ext/gyp/test/ios/gyptest-framework.py +37 -0
  528. data/ext/gyp/test/ios/gyptest-per-config-settings.py +190 -0
  529. data/ext/gyp/test/ios/gyptest-watch.py +44 -0
  530. data/ext/gyp/test/ios/gyptest-xcode-ninja.py +25 -0
  531. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  532. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/LaunchImage.launchimage/Contents.json +24 -0
  533. data/ext/gyp/test/ios/watch/WatchApp/Info.plist +35 -0
  534. data/ext/gyp/test/ios/watch/WatchApp/Interface.storyboard +15 -0
  535. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.h +12 -0
  536. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.m +19 -0
  537. data/ext/gyp/test/ios/watch/WatchContainer/Base.lproj/Main.storyboard +25 -0
  538. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  539. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  540. data/ext/gyp/test/ios/watch/WatchContainer/Info.plist +32 -0
  541. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.h +11 -0
  542. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.m +24 -0
  543. data/ext/gyp/test/ios/watch/WatchContainer/main.m +13 -0
  544. data/ext/gyp/test/ios/watch/WatchKitExtension/Images.xcassets/MyImage.imageset/Contents.json +20 -0
  545. data/ext/gyp/test/ios/watch/WatchKitExtension/Info.plist +38 -0
  546. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.h +10 -0
  547. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.m +25 -0
  548. data/ext/gyp/test/ios/watch/WatchKitExtension/MainInterface.storyboard +63 -0
  549. data/ext/gyp/test/ios/watch/watch.gyp +105 -0
  550. data/ext/gyp/test/ios/xctests/App/AppDelegate.h +11 -0
  551. data/ext/gyp/test/ios/xctests/App/AppDelegate.m +18 -0
  552. data/ext/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib +41 -0
  553. data/ext/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard +25 -0
  554. data/ext/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json +68 -0
  555. data/ext/gyp/test/ios/xctests/App/Info.plist +47 -0
  556. data/ext/gyp/test/ios/xctests/App/ViewController.h +9 -0
  557. data/ext/gyp/test/ios/xctests/App/ViewController.m +21 -0
  558. data/ext/gyp/test/ios/xctests/App/main.m +13 -0
  559. data/ext/gyp/test/ios/xctests/AppTests/AppTests.m +31 -0
  560. data/ext/gyp/test/ios/xctests/AppTests/Info.plist +24 -0
  561. data/ext/gyp/test/ios/xctests/gyptest-xctests.py +49 -0
  562. data/ext/gyp/test/ios/xctests/xctests.gyp +74 -0
  563. data/ext/gyp/test/lib/README.txt +17 -0
  564. data/ext/gyp/test/lib/TestCmd.py +1597 -0
  565. data/ext/gyp/test/lib/TestCommon.py +591 -0
  566. data/ext/gyp/test/lib/TestGyp.py +1259 -0
  567. data/ext/gyp/test/lib/TestMac.py +76 -0
  568. data/ext/gyp/test/lib/TestWin.py +101 -0
  569. data/ext/gyp/test/library/gyptest-shared-obj-install-path.py +39 -0
  570. data/ext/gyp/test/library/gyptest-shared.py +84 -0
  571. data/ext/gyp/test/library/gyptest-static.py +84 -0
  572. data/ext/gyp/test/library/src/lib1.c +10 -0
  573. data/ext/gyp/test/library/src/lib1_moveable.c +10 -0
  574. data/ext/gyp/test/library/src/lib2.c +10 -0
  575. data/ext/gyp/test/library/src/lib2_moveable.c +10 -0
  576. data/ext/gyp/test/library/src/library.gyp +58 -0
  577. data/ext/gyp/test/library/src/program.c +15 -0
  578. data/ext/gyp/test/library/src/shared_dependency.gyp +33 -0
  579. data/ext/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
  580. data/ext/gyp/test/library_dirs/subdir/README.txt +1 -0
  581. data/ext/gyp/test/library_dirs/subdir/hello.cc +11 -0
  582. data/ext/gyp/test/library_dirs/subdir/mylib.cc +9 -0
  583. data/ext/gyp/test/library_dirs/subdir/mylib.h +12 -0
  584. data/ext/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
  585. data/ext/gyp/test/library_dirs/subdir/test.gyp +68 -0
  586. data/ext/gyp/test/link-dependency/gyptest-link-dependency.py +23 -0
  587. data/ext/gyp/test/link-dependency/main.c +7 -0
  588. data/ext/gyp/test/link-dependency/mymalloc.c +12 -0
  589. data/ext/gyp/test/link-dependency/test.gyp +37 -0
  590. data/ext/gyp/test/link-objects/base.c +6 -0
  591. data/ext/gyp/test/link-objects/extra.c +5 -0
  592. data/ext/gyp/test/link-objects/gyptest-all.py +28 -0
  593. data/ext/gyp/test/link-objects/link-objects.gyp +24 -0
  594. data/ext/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
  595. data/ext/gyp/test/linux/gyptest-ldflags-duplicates.py +22 -0
  596. data/ext/gyp/test/linux/gyptest-ldflags-from-environment.py +45 -0
  597. data/ext/gyp/test/linux/gyptest-target-rpath.py +43 -0
  598. data/ext/gyp/test/linux/implicit-rpath/file.c +1 -0
  599. data/ext/gyp/test/linux/implicit-rpath/main.c +1 -0
  600. data/ext/gyp/test/linux/implicit-rpath/test.gyp +47 -0
  601. data/ext/gyp/test/linux/ldflags-duplicates/check-ldflags.py +28 -0
  602. data/ext/gyp/test/linux/ldflags-duplicates/lib1.c +6 -0
  603. data/ext/gyp/test/linux/ldflags-duplicates/lib2.c +6 -0
  604. data/ext/gyp/test/linux/ldflags-duplicates/main.c +7 -0
  605. data/ext/gyp/test/linux/ldflags-duplicates/test.gyp +45 -0
  606. data/ext/gyp/test/linux/ldflags-from-environment/main.c +7 -0
  607. data/ext/gyp/test/linux/ldflags-from-environment/test.gyp +23 -0
  608. data/ext/gyp/test/linux/target-rpath/file.c +1 -0
  609. data/ext/gyp/test/linux/target-rpath/main.c +1 -0
  610. data/ext/gyp/test/linux/target-rpath/test.gyp +47 -0
  611. data/ext/gyp/test/mac/action-envvars/action/action.gyp +34 -0
  612. data/ext/gyp/test/mac/action-envvars/action/action.sh +8 -0
  613. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  614. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  615. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  616. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
  617. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
  618. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  619. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  620. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  621. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  622. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  623. data/ext/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
  624. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
  625. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
  626. data/ext/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
  627. data/ext/gyp/test/mac/app-bundle/empty.c +0 -0
  628. data/ext/gyp/test/mac/app-bundle/test-assets-catalog.gyp +43 -0
  629. data/ext/gyp/test/mac/app-bundle/test-error.gyp +31 -0
  630. data/ext/gyp/test/mac/app-bundle/test.gyp +41 -0
  631. data/ext/gyp/test/mac/archs/empty_main.cc +1 -0
  632. data/ext/gyp/test/mac/archs/file.mm +1 -0
  633. data/ext/gyp/test/mac/archs/file_a.cc +8 -0
  634. data/ext/gyp/test/mac/archs/file_a.h +10 -0
  635. data/ext/gyp/test/mac/archs/file_b.cc +8 -0
  636. data/ext/gyp/test/mac/archs/file_b.h +10 -0
  637. data/ext/gyp/test/mac/archs/file_c.cc +11 -0
  638. data/ext/gyp/test/mac/archs/file_d.cc +11 -0
  639. data/ext/gyp/test/mac/archs/header.h +1 -0
  640. data/ext/gyp/test/mac/archs/my_file.cc +4 -0
  641. data/ext/gyp/test/mac/archs/my_main_file.cc +9 -0
  642. data/ext/gyp/test/mac/archs/test-archs-multiarch.gyp +92 -0
  643. data/ext/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
  644. data/ext/gyp/test/mac/archs/test-dependencies.gyp +92 -0
  645. data/ext/gyp/test/mac/archs/test-no-archs.gyp +21 -0
  646. data/ext/gyp/test/mac/archs/test-valid-archs.gyp +28 -0
  647. data/ext/gyp/test/mac/bundle-resources/change.sh +3 -0
  648. data/ext/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
  649. data/ext/gyp/test/mac/bundle-resources/secret.txt +1 -0
  650. data/ext/gyp/test/mac/bundle-resources/test.gyp +59 -0
  651. data/ext/gyp/test/mac/cflags/ccfile.cc +7 -0
  652. data/ext/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
  653. data/ext/gyp/test/mac/cflags/cfile.c +7 -0
  654. data/ext/gyp/test/mac/cflags/cppfile.cpp +7 -0
  655. data/ext/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
  656. data/ext/gyp/test/mac/cflags/cxxfile.cxx +7 -0
  657. data/ext/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
  658. data/ext/gyp/test/mac/cflags/mfile.m +7 -0
  659. data/ext/gyp/test/mac/cflags/mmfile.mm +7 -0
  660. data/ext/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
  661. data/ext/gyp/test/mac/cflags/test.gyp +132 -0
  662. data/ext/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
  663. data/ext/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
  664. data/ext/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
  665. data/ext/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
  666. data/ext/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
  667. data/ext/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
  668. data/ext/gyp/test/mac/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +87 -0
  669. data/ext/gyp/test/mac/copies-with-xcode-envvars/empty.c +1 -0
  670. data/ext/gyp/test/mac/copies-with-xcode-envvars/file0 +1 -0
  671. data/ext/gyp/test/mac/copies-with-xcode-envvars/file1 +1 -0
  672. data/ext/gyp/test/mac/copies-with-xcode-envvars/file10 +1 -0
  673. data/ext/gyp/test/mac/copies-with-xcode-envvars/file11 +1 -0
  674. data/ext/gyp/test/mac/copies-with-xcode-envvars/file2 +1 -0
  675. data/ext/gyp/test/mac/copies-with-xcode-envvars/file3 +1 -0
  676. data/ext/gyp/test/mac/copies-with-xcode-envvars/file4 +1 -0
  677. data/ext/gyp/test/mac/copies-with-xcode-envvars/file5 +1 -0
  678. data/ext/gyp/test/mac/copies-with-xcode-envvars/file6 +1 -0
  679. data/ext/gyp/test/mac/copies-with-xcode-envvars/file7 +1 -0
  680. data/ext/gyp/test/mac/copies-with-xcode-envvars/file8 +1 -0
  681. data/ext/gyp/test/mac/copies-with-xcode-envvars/file9 +1 -0
  682. data/ext/gyp/test/mac/copy-dylib/empty.c +1 -0
  683. data/ext/gyp/test/mac/copy-dylib/test.gyp +31 -0
  684. data/ext/gyp/test/mac/debuginfo/file.c +6 -0
  685. data/ext/gyp/test/mac/debuginfo/test.gyp +82 -0
  686. data/ext/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
  687. data/ext/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
  688. data/ext/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
  689. data/ext/gyp/test/mac/depend-on-bundle/executable.c +4 -0
  690. data/ext/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
  691. data/ext/gyp/test/mac/deployment-target/check-version-min.c +33 -0
  692. data/ext/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
  693. data/ext/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
  694. data/ext/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
  695. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
  696. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
  697. data/ext/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
  698. data/ext/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
  699. data/ext/gyp/test/mac/framework/empty.c +0 -0
  700. data/ext/gyp/test/mac/framework/framework.gyp +108 -0
  701. data/ext/gyp/test/mac/framework-dirs/calculate.c +15 -0
  702. data/ext/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
  703. data/ext/gyp/test/mac/framework-headers/myframework.h +8 -0
  704. data/ext/gyp/test/mac/framework-headers/myframework.m +8 -0
  705. data/ext/gyp/test/mac/framework-headers/test.gyp +44 -0
  706. data/ext/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
  707. data/ext/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
  708. data/ext/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
  709. data/ext/gyp/test/mac/gyptest-action-envvars.py +36 -0
  710. data/ext/gyp/test/mac/gyptest-app-assets-catalog.py +125 -0
  711. data/ext/gyp/test/mac/gyptest-app-error.py +49 -0
  712. data/ext/gyp/test/mac/gyptest-app.py +122 -0
  713. data/ext/gyp/test/mac/gyptest-archs.py +96 -0
  714. data/ext/gyp/test/mac/gyptest-bundle-resources.py +64 -0
  715. data/ext/gyp/test/mac/gyptest-cflags.py +21 -0
  716. data/ext/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
  717. data/ext/gyp/test/mac/gyptest-clang-cxx-library.py +32 -0
  718. data/ext/gyp/test/mac/gyptest-copies-with-xcode-envvars.py +65 -0
  719. data/ext/gyp/test/mac/gyptest-copies.py +62 -0
  720. data/ext/gyp/test/mac/gyptest-copy-dylib.py +25 -0
  721. data/ext/gyp/test/mac/gyptest-debuginfo.py +36 -0
  722. data/ext/gyp/test/mac/gyptest-depend-on-bundle.py +45 -0
  723. data/ext/gyp/test/mac/gyptest-deployment-target.py +27 -0
  724. data/ext/gyp/test/mac/gyptest-framework-dirs.py +23 -0
  725. data/ext/gyp/test/mac/gyptest-framework-headers.py +38 -0
  726. data/ext/gyp/test/mac/gyptest-framework.py +80 -0
  727. data/ext/gyp/test/mac/gyptest-global-settings.py +33 -0
  728. data/ext/gyp/test/mac/gyptest-identical-name.py +45 -0
  729. data/ext/gyp/test/mac/gyptest-infoplist-process.py +56 -0
  730. data/ext/gyp/test/mac/gyptest-installname.py +85 -0
  731. data/ext/gyp/test/mac/gyptest-kext.py +27 -0
  732. data/ext/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +37 -0
  733. data/ext/gyp/test/mac/gyptest-ldflags.py +74 -0
  734. data/ext/gyp/test/mac/gyptest-libraries.py +30 -0
  735. data/ext/gyp/test/mac/gyptest-libtool-zero.py +26 -0
  736. data/ext/gyp/test/mac/gyptest-loadable-module-bundle-product-extension.py +31 -0
  737. data/ext/gyp/test/mac/gyptest-loadable-module.py +54 -0
  738. data/ext/gyp/test/mac/gyptest-lto.py +66 -0
  739. data/ext/gyp/test/mac/gyptest-missing-cfbundlesignature.py +34 -0
  740. data/ext/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +38 -0
  741. data/ext/gyp/test/mac/gyptest-objc-arc.py +27 -0
  742. data/ext/gyp/test/mac/gyptest-objc-gc.py +51 -0
  743. data/ext/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
  744. data/ext/gyp/test/mac/gyptest-postbuild-defaults.py +34 -0
  745. data/ext/gyp/test/mac/gyptest-postbuild-fail.py +71 -0
  746. data/ext/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
  747. data/ext/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
  748. data/ext/gyp/test/mac/gyptest-postbuild.py +53 -0
  749. data/ext/gyp/test/mac/gyptest-prefixheader.py +20 -0
  750. data/ext/gyp/test/mac/gyptest-rebuild.py +46 -0
  751. data/ext/gyp/test/mac/gyptest-rpath.py +50 -0
  752. data/ext/gyp/test/mac/gyptest-sdkroot.py +56 -0
  753. data/ext/gyp/test/mac/gyptest-sourceless-module.py +77 -0
  754. data/ext/gyp/test/mac/gyptest-strip-default.py +97 -0
  755. data/ext/gyp/test/mac/gyptest-strip.py +66 -0
  756. data/ext/gyp/test/mac/gyptest-swift-library.py +67 -0
  757. data/ext/gyp/test/mac/gyptest-type-envvars.py +26 -0
  758. data/ext/gyp/test/mac/gyptest-unicode-settings.py +20 -0
  759. data/ext/gyp/test/mac/gyptest-xcode-env-order.py +95 -0
  760. data/ext/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
  761. data/ext/gyp/test/mac/gyptest-xcode-gcc.py +60 -0
  762. data/ext/gyp/test/mac/gyptest-xcode-support-actions.py +25 -0
  763. data/ext/gyp/test/mac/gyptest-xctest.py +41 -0
  764. data/ext/gyp/test/mac/gyptest-xcuitest.py +39 -0
  765. data/ext/gyp/test/mac/identical-name/proxy/proxy.cc +2 -0
  766. data/ext/gyp/test/mac/identical-name/proxy/proxy.gyp +9 -0
  767. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.cc +2 -0
  768. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.gyp +8 -0
  769. data/ext/gyp/test/mac/identical-name/test-should-fail.gyp +10 -0
  770. data/ext/gyp/test/mac/identical-name/test.gyp +11 -0
  771. data/ext/gyp/test/mac/identical-name/test.gypi +7 -0
  772. data/ext/gyp/test/mac/identical-name/testlib/main.cc +3 -0
  773. data/ext/gyp/test/mac/identical-name/testlib/testlib.gyp +14 -0
  774. data/ext/gyp/test/mac/identical-name/testlib/void.cc +2 -0
  775. data/ext/gyp/test/mac/infoplist-process/Info.plist +36 -0
  776. data/ext/gyp/test/mac/infoplist-process/main.c +7 -0
  777. data/ext/gyp/test/mac/infoplist-process/test1.gyp +25 -0
  778. data/ext/gyp/test/mac/infoplist-process/test2.gyp +25 -0
  779. data/ext/gyp/test/mac/infoplist-process/test3.gyp +25 -0
  780. data/ext/gyp/test/mac/installname/Info.plist +28 -0
  781. data/ext/gyp/test/mac/installname/file.c +1 -0
  782. data/ext/gyp/test/mac/installname/main.c +1 -0
  783. data/ext/gyp/test/mac/installname/test.gyp +93 -0
  784. data/ext/gyp/test/mac/kext/GypKext/GypKext-Info.plist +35 -0
  785. data/ext/gyp/test/mac/kext/GypKext/GypKext.c +16 -0
  786. data/ext/gyp/test/mac/kext/kext.gyp +18 -0
  787. data/ext/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
  788. data/ext/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
  789. data/ext/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
  790. data/ext/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
  791. data/ext/gyp/test/mac/ldflags-libtool/file.c +1 -0
  792. data/ext/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
  793. data/ext/gyp/test/mac/libraries/subdir/README.txt +1 -0
  794. data/ext/gyp/test/mac/libraries/subdir/hello.cc +10 -0
  795. data/ext/gyp/test/mac/libraries/subdir/mylib.c +7 -0
  796. data/ext/gyp/test/mac/libraries/subdir/test.gyp +65 -0
  797. data/ext/gyp/test/mac/libtool-zero/mylib.c +7 -0
  798. data/ext/gyp/test/mac/libtool-zero/test.gyp +18 -0
  799. data/ext/gyp/test/mac/loadable-module/Info.plist +26 -0
  800. data/ext/gyp/test/mac/loadable-module/module.c +11 -0
  801. data/ext/gyp/test/mac/loadable-module/test.gyp +18 -0
  802. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/src.cc +7 -0
  803. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/test.gyp +24 -0
  804. data/ext/gyp/test/mac/lto/asmfile.S +2 -0
  805. data/ext/gyp/test/mac/lto/ccfile.cc +1 -0
  806. data/ext/gyp/test/mac/lto/cfile.c +1 -0
  807. data/ext/gyp/test/mac/lto/mfile.m +1 -0
  808. data/ext/gyp/test/mac/lto/mmfile.mm +1 -0
  809. data/ext/gyp/test/mac/lto/test.gyp +35 -0
  810. data/ext/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
  811. data/ext/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
  812. data/ext/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
  813. data/ext/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
  814. data/ext/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
  815. data/ext/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
  816. data/ext/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
  817. data/ext/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
  818. data/ext/gyp/test/mac/objc-arc/c-file.c +5 -0
  819. data/ext/gyp/test/mac/objc-arc/cc-file.cc +5 -0
  820. data/ext/gyp/test/mac/objc-arc/m-file-arc-weak.m +9 -0
  821. data/ext/gyp/test/mac/objc-arc/m-file-no-arc.m +9 -0
  822. data/ext/gyp/test/mac/objc-arc/m-file.m +9 -0
  823. data/ext/gyp/test/mac/objc-arc/mm-file-arc-weak.mm +9 -0
  824. data/ext/gyp/test/mac/objc-arc/mm-file-no-arc.mm +9 -0
  825. data/ext/gyp/test/mac/objc-arc/mm-file.mm +9 -0
  826. data/ext/gyp/test/mac/objc-arc/test.gyp +53 -0
  827. data/ext/gyp/test/mac/objc-gc/c-file.c +1 -0
  828. data/ext/gyp/test/mac/objc-gc/cc-file.cc +1 -0
  829. data/ext/gyp/test/mac/objc-gc/main.m +6 -0
  830. data/ext/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
  831. data/ext/gyp/test/mac/objc-gc/needs-gc.m +1 -0
  832. data/ext/gyp/test/mac/objc-gc/test.gyp +102 -0
  833. data/ext/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
  834. data/ext/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
  835. data/ext/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
  836. data/ext/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
  837. data/ext/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
  838. data/ext/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
  839. data/ext/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
  840. data/ext/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
  841. data/ext/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
  842. data/ext/gyp/test/mac/postbuild-defaults/main.c +7 -0
  843. data/ext/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
  844. data/ext/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
  845. data/ext/gyp/test/mac/postbuild-fail/file.c +6 -0
  846. data/ext/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
  847. data/ext/gyp/test/mac/postbuild-fail/test.gyp +38 -0
  848. data/ext/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
  849. data/ext/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
  850. data/ext/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
  851. data/ext/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
  852. data/ext/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
  853. data/ext/gyp/test/mac/postbuild-static-library/empty.c +4 -0
  854. data/ext/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
  855. data/ext/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
  856. data/ext/gyp/test/mac/postbuilds/copy.sh +3 -0
  857. data/ext/gyp/test/mac/postbuilds/file.c +4 -0
  858. data/ext/gyp/test/mac/postbuilds/file_g.c +4 -0
  859. data/ext/gyp/test/mac/postbuilds/file_h.c +4 -0
  860. data/ext/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
  861. data/ext/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
  862. data/ext/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
  863. data/ext/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
  864. data/ext/gyp/test/mac/postbuilds/test.gyp +93 -0
  865. data/ext/gyp/test/mac/prefixheader/file.c +1 -0
  866. data/ext/gyp/test/mac/prefixheader/file.cc +1 -0
  867. data/ext/gyp/test/mac/prefixheader/file.m +1 -0
  868. data/ext/gyp/test/mac/prefixheader/file.mm +1 -0
  869. data/ext/gyp/test/mac/prefixheader/header.h +1 -0
  870. data/ext/gyp/test/mac/prefixheader/test.gyp +82 -0
  871. data/ext/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
  872. data/ext/gyp/test/mac/rebuild/delay-touch.sh +6 -0
  873. data/ext/gyp/test/mac/rebuild/empty.c +0 -0
  874. data/ext/gyp/test/mac/rebuild/main.c +1 -0
  875. data/ext/gyp/test/mac/rebuild/test.gyp +56 -0
  876. data/ext/gyp/test/mac/rpath/file.c +1 -0
  877. data/ext/gyp/test/mac/rpath/main.c +1 -0
  878. data/ext/gyp/test/mac/rpath/test.gyp +48 -0
  879. data/ext/gyp/test/mac/sdkroot/file.cc +5 -0
  880. data/ext/gyp/test/mac/sdkroot/test.gyp +35 -0
  881. data/ext/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
  882. data/ext/gyp/test/mac/sourceless-module/empty.c +1 -0
  883. data/ext/gyp/test/mac/sourceless-module/empty.txt +2 -0
  884. data/ext/gyp/test/mac/sourceless-module/fun.c +1 -0
  885. data/ext/gyp/test/mac/sourceless-module/test.gyp +96 -0
  886. data/ext/gyp/test/mac/strip/file.c +22 -0
  887. data/ext/gyp/test/mac/strip/main.c +25 -0
  888. data/ext/gyp/test/mac/strip/strip.saves +5 -0
  889. data/ext/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
  890. data/ext/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
  891. data/ext/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
  892. data/ext/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
  893. data/ext/gyp/test/mac/strip/test-defaults.gyp +51 -0
  894. data/ext/gyp/test/mac/strip/test.gyp +119 -0
  895. data/ext/gyp/test/mac/swift-library/Info.plist +28 -0
  896. data/ext/gyp/test/mac/swift-library/file.swift +9 -0
  897. data/ext/gyp/test/mac/swift-library/test.gyp +21 -0
  898. data/ext/gyp/test/mac/type_envvars/file.c +6 -0
  899. data/ext/gyp/test/mac/type_envvars/test.gyp +100 -0
  900. data/ext/gyp/test/mac/type_envvars/test_bundle_executable.sh +30 -0
  901. data/ext/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +35 -0
  902. data/ext/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +38 -0
  903. data/ext/gyp/test/mac/type_envvars/test_check_sdkroot.sh +47 -0
  904. data/ext/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +33 -0
  905. data/ext/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +31 -0
  906. data/ext/gyp/test/mac/type_envvars/test_nonbundle_none.sh +32 -0
  907. data/ext/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +31 -0
  908. data/ext/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +31 -0
  909. data/ext/gyp/test/mac/unicode-settings/file.cc +2 -0
  910. data/ext/gyp/test/mac/unicode-settings/test.gyp +23 -0
  911. data/ext/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
  912. data/ext/gyp/test/mac/xcode-env-order/Info.plist +56 -0
  913. data/ext/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
  914. data/ext/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
  915. data/ext/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
  916. data/ext/gyp/test/mac/xcode-env-order/main.c +7 -0
  917. data/ext/gyp/test/mac/xcode-env-order/test.gyp +121 -0
  918. data/ext/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
  919. data/ext/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
  920. data/ext/gyp/test/mac/xcode-gcc/test.gyp +60 -0
  921. data/ext/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
  922. data/ext/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
  923. data/ext/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
  924. data/ext/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
  925. data/ext/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
  926. data/ext/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
  927. data/ext/gyp/test/mac/xcode-support-actions/source.c +0 -0
  928. data/ext/gyp/test/mac/xcode-support-actions/test.gyp +26 -0
  929. data/ext/gyp/test/mac/xctest/MyClass.h +8 -0
  930. data/ext/gyp/test/mac/xctest/MyClass.m +8 -0
  931. data/ext/gyp/test/mac/xctest/TestCase.m +16 -0
  932. data/ext/gyp/test/mac/xctest/resource.txt +1 -0
  933. data/ext/gyp/test/mac/xctest/test.gyp +47 -0
  934. data/ext/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
  935. data/ext/gyp/test/mac/xcuitest/Info.plist +28 -0
  936. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.h +8 -0
  937. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.m +19 -0
  938. data/ext/gyp/test/mac/xcuitest/TestCase.m +15 -0
  939. data/ext/gyp/test/mac/xcuitest/main.m +15 -0
  940. data/ext/gyp/test/mac/xcuitest/resource.txt +1 -0
  941. data/ext/gyp/test/mac/xcuitest/test.gyp +69 -0
  942. data/ext/gyp/test/make/dependencies.gyp +15 -0
  943. data/ext/gyp/test/make/gyptest-dependencies.py +26 -0
  944. data/ext/gyp/test/make/gyptest-noload.py +57 -0
  945. data/ext/gyp/test/make/main.cc +12 -0
  946. data/ext/gyp/test/make/main.h +0 -0
  947. data/ext/gyp/test/make/noload/all.gyp +18 -0
  948. data/ext/gyp/test/make/noload/lib/shared.c +3 -0
  949. data/ext/gyp/test/make/noload/lib/shared.gyp +16 -0
  950. data/ext/gyp/test/make/noload/lib/shared.h +1 -0
  951. data/ext/gyp/test/make/noload/main.c +9 -0
  952. data/ext/gyp/test/make_global_settings/ar/gyptest-make_global_settings_ar.py +126 -0
  953. data/ext/gyp/test/make_global_settings/ar/make_global_settings_ar.gyp +29 -0
  954. data/ext/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +51 -0
  955. data/ext/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
  956. data/ext/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +51 -0
  957. data/ext/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
  958. data/ext/gyp/test/make_global_settings/full-toolchain/bar.cc +1 -0
  959. data/ext/gyp/test/make_global_settings/full-toolchain/foo.c +1 -0
  960. data/ext/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py +53 -0
  961. data/ext/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp +22 -0
  962. data/ext/gyp/test/make_global_settings/full-toolchain/my_nm.py +9 -0
  963. data/ext/gyp/test/make_global_settings/full-toolchain/my_readelf.py +9 -0
  964. data/ext/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +130 -0
  965. data/ext/gyp/test/make_global_settings/ld/make_global_settings_ld.gyp +29 -0
  966. data/ext/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +52 -0
  967. data/ext/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
  968. data/ext/gyp/test/many-actions/file0 +0 -0
  969. data/ext/gyp/test/many-actions/file1 +0 -0
  970. data/ext/gyp/test/many-actions/file2 +0 -0
  971. data/ext/gyp/test/many-actions/file3 +0 -0
  972. data/ext/gyp/test/many-actions/file4 +0 -0
  973. data/ext/gyp/test/many-actions/gyptest-many-actions-unsorted.py +43 -0
  974. data/ext/gyp/test/many-actions/gyptest-many-actions.py +29 -0
  975. data/ext/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
  976. data/ext/gyp/test/many-actions/many-actions.gyp +1817 -0
  977. data/ext/gyp/test/module/gyptest-default.py +28 -0
  978. data/ext/gyp/test/module/src/lib1.c +10 -0
  979. data/ext/gyp/test/module/src/lib2.c +10 -0
  980. data/ext/gyp/test/module/src/module.gyp +53 -0
  981. data/ext/gyp/test/module/src/program.c +111 -0
  982. data/ext/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
  983. data/ext/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
  984. data/ext/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
  985. data/ext/gyp/test/msvs/buildevents/main.cc +5 -0
  986. data/ext/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +41 -0
  987. data/ext/gyp/test/msvs/config_attrs/hello.c +11 -0
  988. data/ext/gyp/test/msvs/config_attrs/hello.gyp +21 -0
  989. data/ext/gyp/test/msvs/express/base/base.gyp +22 -0
  990. data/ext/gyp/test/msvs/express/express.gyp +19 -0
  991. data/ext/gyp/test/msvs/express/gyptest-express.py +29 -0
  992. data/ext/gyp/test/msvs/external_builder/external.gyp +68 -0
  993. data/ext/gyp/test/msvs/external_builder/external_builder.py +9 -0
  994. data/ext/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
  995. data/ext/gyp/test/msvs/external_builder/hello.cpp +10 -0
  996. data/ext/gyp/test/msvs/external_builder/hello.z +6 -0
  997. data/ext/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
  998. data/ext/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
  999. data/ext/gyp/test/msvs/filters/filters.gyp +47 -0
  1000. data/ext/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
  1001. data/ext/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
  1002. data/ext/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
  1003. data/ext/gyp/test/msvs/list_excluded/hello.cpp +10 -0
  1004. data/ext/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
  1005. data/ext/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
  1006. data/ext/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
  1007. data/ext/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
  1008. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_fail.py +7 -0
  1009. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_succeed.py +7 -0
  1010. data/ext/gyp/test/msvs/multiple_actions_error_handling/actions.gyp +40 -0
  1011. data/ext/gyp/test/msvs/multiple_actions_error_handling/gyptest.py +26 -0
  1012. data/ext/gyp/test/msvs/props/AppName.props +14 -0
  1013. data/ext/gyp/test/msvs/props/AppName.vsprops +11 -0
  1014. data/ext/gyp/test/msvs/props/gyptest-props.py +22 -0
  1015. data/ext/gyp/test/msvs/props/hello.c +11 -0
  1016. data/ext/gyp/test/msvs/props/hello.gyp +22 -0
  1017. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.bar +5 -0
  1018. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.foo +5 -0
  1019. data/ext/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py +29 -0
  1020. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py +8 -0
  1021. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py +7 -0
  1022. data/ext/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp +52 -0
  1023. data/ext/gyp/test/msvs/shared_output/common.gypi +17 -0
  1024. data/ext/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
  1025. data/ext/gyp/test/msvs/shared_output/hello.c +12 -0
  1026. data/ext/gyp/test/msvs/shared_output/hello.gyp +21 -0
  1027. data/ext/gyp/test/msvs/shared_output/there/there.c +12 -0
  1028. data/ext/gyp/test/msvs/shared_output/there/there.gyp +16 -0
  1029. data/ext/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
  1030. data/ext/gyp/test/msvs/uldi2010/hello.c +13 -0
  1031. data/ext/gyp/test/msvs/uldi2010/hello.gyp +26 -0
  1032. data/ext/gyp/test/msvs/uldi2010/hello2.c +10 -0
  1033. data/ext/gyp/test/multiple-targets/gyptest-all.py +30 -0
  1034. data/ext/gyp/test/multiple-targets/gyptest-default.py +30 -0
  1035. data/ext/gyp/test/multiple-targets/src/common.c +7 -0
  1036. data/ext/gyp/test/multiple-targets/src/multiple.gyp +24 -0
  1037. data/ext/gyp/test/multiple-targets/src/prog1.c +10 -0
  1038. data/ext/gyp/test/multiple-targets/src/prog2.c +10 -0
  1039. data/ext/gyp/test/ninja/action-rule-hash/gyptest-action-rule-hash.py +32 -0
  1040. data/ext/gyp/test/ninja/action-rule-hash/subdir/action-rule-hash.gyp +29 -0
  1041. data/ext/gyp/test/ninja/action-rule-hash/subdir/emit.py +13 -0
  1042. data/ext/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +64 -0
  1043. data/ext/gyp/test/ninja/action_dependencies/src/a.c +10 -0
  1044. data/ext/gyp/test/ninja/action_dependencies/src/a.h +13 -0
  1045. data/ext/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
  1046. data/ext/gyp/test/ninja/action_dependencies/src/b.c +18 -0
  1047. data/ext/gyp/test/ninja/action_dependencies/src/b.h +13 -0
  1048. data/ext/gyp/test/ninja/action_dependencies/src/c.c +10 -0
  1049. data/ext/gyp/test/ninja/action_dependencies/src/c.h +13 -0
  1050. data/ext/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
  1051. data/ext/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
  1052. data/ext/gyp/test/ninja/chained-dependency/chained.c +5 -0
  1053. data/ext/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +30 -0
  1054. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py +23 -0
  1055. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/subdir/included.gyp +19 -0
  1056. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/test.gyp +19 -0
  1057. data/ext/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +46 -0
  1058. data/ext/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
  1059. data/ext/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +68 -0
  1060. data/ext/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
  1061. data/ext/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
  1062. data/ext/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
  1063. data/ext/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +48 -0
  1064. data/ext/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
  1065. data/ext/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
  1066. data/ext/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
  1067. data/ext/gyp/test/ninja/use-console/foo.bar +5 -0
  1068. data/ext/gyp/test/ninja/use-console/gyptest-use-console.py +29 -0
  1069. data/ext/gyp/test/ninja/use-console/use-console.gyp +60 -0
  1070. data/ext/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
  1071. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
  1072. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
  1073. data/ext/gyp/test/no-cpp/gyptest-no-cpp.py +53 -0
  1074. data/ext/gyp/test/no-cpp/src/call-f-main.c +2 -0
  1075. data/ext/gyp/test/no-cpp/src/empty-main.c +1 -0
  1076. data/ext/gyp/test/no-cpp/src/f.cc +3 -0
  1077. data/ext/gyp/test/no-cpp/src/test.gyp +25 -0
  1078. data/ext/gyp/test/no-output/gyptest-no-output.py +21 -0
  1079. data/ext/gyp/test/no-output/src/nooutput.gyp +17 -0
  1080. data/ext/gyp/test/product/gyptest-product.py +43 -0
  1081. data/ext/gyp/test/product/hello.c +15 -0
  1082. data/ext/gyp/test/product/product.gyp +128 -0
  1083. data/ext/gyp/test/prune_targets/gyptest-prune-targets.py +66 -0
  1084. data/ext/gyp/test/prune_targets/lib1.cc +6 -0
  1085. data/ext/gyp/test/prune_targets/lib2.cc +6 -0
  1086. data/ext/gyp/test/prune_targets/lib3.cc +6 -0
  1087. data/ext/gyp/test/prune_targets/lib_indirect.cc +6 -0
  1088. data/ext/gyp/test/prune_targets/program.cc +7 -0
  1089. data/ext/gyp/test/prune_targets/test1.gyp +26 -0
  1090. data/ext/gyp/test/prune_targets/test2.gyp +30 -0
  1091. data/ext/gyp/test/relative/foo/a/a.cc +9 -0
  1092. data/ext/gyp/test/relative/foo/a/a.gyp +13 -0
  1093. data/ext/gyp/test/relative/foo/a/c/c.cc +9 -0
  1094. data/ext/gyp/test/relative/foo/a/c/c.gyp +12 -0
  1095. data/ext/gyp/test/relative/foo/b/b.cc +9 -0
  1096. data/ext/gyp/test/relative/foo/b/b.gyp +9 -0
  1097. data/ext/gyp/test/relative/gyptest-default.py +25 -0
  1098. data/ext/gyp/test/rename/filecase/file.c +1 -0
  1099. data/ext/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
  1100. data/ext/gyp/test/rename/filecase/test.gyp +14 -0
  1101. data/ext/gyp/test/rename/gyptest-filecase.py +35 -0
  1102. data/ext/gyp/test/restat/gyptest-restat.py +31 -0
  1103. data/ext/gyp/test/restat/src/create_intermediate.py +17 -0
  1104. data/ext/gyp/test/restat/src/restat.gyp +50 -0
  1105. data/ext/gyp/test/restat/src/touch.py +16 -0
  1106. data/ext/gyp/test/rules/gyptest-all.py +84 -0
  1107. data/ext/gyp/test/rules/gyptest-default.py +70 -0
  1108. data/ext/gyp/test/rules/gyptest-input-root.py +26 -0
  1109. data/ext/gyp/test/rules/gyptest-special-variables.py +18 -0
  1110. data/ext/gyp/test/rules/src/actions.gyp +23 -0
  1111. data/ext/gyp/test/rules/src/an_asm.S +6 -0
  1112. data/ext/gyp/test/rules/src/as.bat +7 -0
  1113. data/ext/gyp/test/rules/src/copy-file.py +11 -0
  1114. data/ext/gyp/test/rules/src/external/external.gyp +66 -0
  1115. data/ext/gyp/test/rules/src/external/file1.in +1 -0
  1116. data/ext/gyp/test/rules/src/external/file2.in +1 -0
  1117. data/ext/gyp/test/rules/src/input-root.gyp +24 -0
  1118. data/ext/gyp/test/rules/src/noaction/file1.in +1 -0
  1119. data/ext/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
  1120. data/ext/gyp/test/rules/src/rule.py +17 -0
  1121. data/ext/gyp/test/rules/src/somefile.ext +0 -0
  1122. data/ext/gyp/test/rules/src/special-variables.gyp +34 -0
  1123. data/ext/gyp/test/rules/src/subdir1/executable.gyp +37 -0
  1124. data/ext/gyp/test/rules/src/subdir1/function1.in +6 -0
  1125. data/ext/gyp/test/rules/src/subdir1/function2.in +6 -0
  1126. data/ext/gyp/test/rules/src/subdir1/program.c +12 -0
  1127. data/ext/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp +50 -0
  1128. data/ext/gyp/test/rules/src/subdir2/file1.in +1 -0
  1129. data/ext/gyp/test/rules/src/subdir2/file2.in +1 -0
  1130. data/ext/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
  1131. data/ext/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
  1132. data/ext/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
  1133. data/ext/gyp/test/rules/src/subdir2/none.gyp +33 -0
  1134. data/ext/gyp/test/rules/src/subdir2/program.c +12 -0
  1135. data/ext/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
  1136. data/ext/gyp/test/rules/src/subdir3/function3.in +6 -0
  1137. data/ext/gyp/test/rules/src/subdir3/program.c +10 -0
  1138. data/ext/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
  1139. data/ext/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
  1140. data/ext/gyp/test/rules/src/subdir4/program.c +19 -0
  1141. data/ext/gyp/test/rules-dirname/gyptest-dirname.py +57 -0
  1142. data/ext/gyp/test/rules-dirname/src/actions.gyp +15 -0
  1143. data/ext/gyp/test/rules-dirname/src/copy-file.py +11 -0
  1144. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +8 -0
  1145. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
  1146. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +8 -0
  1147. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
  1148. data/ext/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +140 -0
  1149. data/ext/gyp/test/rules-dirname/src/subdir/main.cc +14 -0
  1150. data/ext/gyp/test/rules-dirname/src/subdir/nodir.gencc +8 -0
  1151. data/ext/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
  1152. data/ext/gyp/test/rules-rebuild/gyptest-all.py +70 -0
  1153. data/ext/gyp/test/rules-rebuild/gyptest-default.py +91 -0
  1154. data/ext/gyp/test/rules-rebuild/src/main.c +12 -0
  1155. data/ext/gyp/test/rules-rebuild/src/make-sources.py +19 -0
  1156. data/ext/gyp/test/rules-rebuild/src/prog1.in +7 -0
  1157. data/ext/gyp/test/rules-rebuild/src/prog2.in +7 -0
  1158. data/ext/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
  1159. data/ext/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +23 -0
  1160. data/ext/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
  1161. data/ext/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
  1162. data/ext/gyp/test/rules-variables/gyptest-rules-variables.py +35 -0
  1163. data/ext/gyp/test/rules-variables/src/input_ext.c +9 -0
  1164. data/ext/gyp/test/rules-variables/src/input_name/test.c +9 -0
  1165. data/ext/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
  1166. data/ext/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
  1167. data/ext/gyp/test/rules-variables/src/subdir/test.c +18 -0
  1168. data/ext/gyp/test/rules-variables/src/test.input_root.c +9 -0
  1169. data/ext/gyp/test/rules-variables/src/variables.gyp +40 -0
  1170. data/ext/gyp/test/same-gyp-name/gyptest-all.py +38 -0
  1171. data/ext/gyp/test/same-gyp-name/gyptest-default.py +38 -0
  1172. data/ext/gyp/test/same-gyp-name/gyptest-library.py +20 -0
  1173. data/ext/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
  1174. data/ext/gyp/test/same-gyp-name/library/test.gyp +15 -0
  1175. data/ext/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
  1176. data/ext/gyp/test/same-gyp-name/src/all.gyp +16 -0
  1177. data/ext/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
  1178. data/ext/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
  1179. data/ext/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
  1180. data/ext/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
  1181. data/ext/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
  1182. data/ext/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
  1183. data/ext/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
  1184. data/ext/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
  1185. data/ext/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
  1186. data/ext/gyp/test/same-source-file-name/gyptest-all.py +34 -0
  1187. data/ext/gyp/test/same-source-file-name/gyptest-default.py +34 -0
  1188. data/ext/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
  1189. data/ext/gyp/test/same-source-file-name/gyptest-pass-shared.py +18 -0
  1190. data/ext/gyp/test/same-source-file-name/gyptest-static.py +34 -0
  1191. data/ext/gyp/test/same-source-file-name/src/all.gyp +30 -0
  1192. data/ext/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
  1193. data/ext/gyp/test/same-source-file-name/src/double-shared.gyp +27 -0
  1194. data/ext/gyp/test/same-source-file-name/src/double-static.gyp +22 -0
  1195. data/ext/gyp/test/same-source-file-name/src/func.c +6 -0
  1196. data/ext/gyp/test/same-source-file-name/src/prog1.c +16 -0
  1197. data/ext/gyp/test/same-source-file-name/src/prog2.c +16 -0
  1198. data/ext/gyp/test/same-source-file-name/src/prog3.c +18 -0
  1199. data/ext/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
  1200. data/ext/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
  1201. data/ext/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
  1202. data/ext/gyp/test/same-target-name/src/all.gyp +16 -0
  1203. data/ext/gyp/test/same-target-name/src/executable1.gyp +15 -0
  1204. data/ext/gyp/test/same-target-name/src/executable2.gyp +15 -0
  1205. data/ext/gyp/test/same-target-name-different-directory/gyptest-all.py +41 -0
  1206. data/ext/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
  1207. data/ext/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
  1208. data/ext/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
  1209. data/ext/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
  1210. data/ext/gyp/test/sanitize-rule-names/blah.S +0 -0
  1211. data/ext/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
  1212. data/ext/gyp/test/sanitize-rule-names/hello.cc +7 -0
  1213. data/ext/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
  1214. data/ext/gyp/test/sanitize-rule-names/script.py +10 -0
  1215. data/ext/gyp/test/self-dependency/common.gypi +13 -0
  1216. data/ext/gyp/test/self-dependency/dep.gyp +23 -0
  1217. data/ext/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
  1218. data/ext/gyp/test/self-dependency/self_dependency.gyp +15 -0
  1219. data/ext/gyp/test/sibling/gyptest-all.py +42 -0
  1220. data/ext/gyp/test/sibling/gyptest-relocate.py +44 -0
  1221. data/ext/gyp/test/sibling/src/build/all.gyp +16 -0
  1222. data/ext/gyp/test/sibling/src/prog1/prog1.c +7 -0
  1223. data/ext/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
  1224. data/ext/gyp/test/sibling/src/prog2/prog2.c +7 -0
  1225. data/ext/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
  1226. data/ext/gyp/test/small/gyptest-small.py +56 -0
  1227. data/ext/gyp/test/standalone/gyptest-standalone.py +35 -0
  1228. data/ext/gyp/test/standalone/standalone.gyp +12 -0
  1229. data/ext/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +50 -0
  1230. data/ext/gyp/test/standalone-static-library/invalid.gyp +16 -0
  1231. data/ext/gyp/test/standalone-static-library/mylib.c +7 -0
  1232. data/ext/gyp/test/standalone-static-library/mylib.gyp +26 -0
  1233. data/ext/gyp/test/standalone-static-library/prog.c +7 -0
  1234. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
  1235. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
  1236. data/ext/gyp/test/subdirectory/gyptest-subdir-all.py +34 -0
  1237. data/ext/gyp/test/subdirectory/gyptest-subdir-default.py +34 -0
  1238. data/ext/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
  1239. data/ext/gyp/test/subdirectory/gyptest-top-all.py +43 -0
  1240. data/ext/gyp/test/subdirectory/gyptest-top-default.py +43 -0
  1241. data/ext/gyp/test/subdirectory/src/prog1.c +7 -0
  1242. data/ext/gyp/test/subdirectory/src/prog1.gyp +21 -0
  1243. data/ext/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
  1244. data/ext/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
  1245. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
  1246. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
  1247. data/ext/gyp/test/subdirectory/src/symroot.gypi +16 -0
  1248. data/ext/gyp/test/symlinks/gyptest-symlinks.py +66 -0
  1249. data/ext/gyp/test/symlinks/hello.c +12 -0
  1250. data/ext/gyp/test/symlinks/hello.gyp +15 -0
  1251. data/ext/gyp/test/target/gyptest-target.py +37 -0
  1252. data/ext/gyp/test/target/hello.c +7 -0
  1253. data/ext/gyp/test/target/target.gyp +24 -0
  1254. data/ext/gyp/test/toolsets/gyptest-toolsets.py +31 -0
  1255. data/ext/gyp/test/toolsets/main.cc +13 -0
  1256. data/ext/gyp/test/toolsets/toolsets.cc +11 -0
  1257. data/ext/gyp/test/toolsets/toolsets.gyp +62 -0
  1258. data/ext/gyp/test/toolsets/toolsets_shared.cc +11 -0
  1259. data/ext/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
  1260. data/ext/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
  1261. data/ext/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
  1262. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
  1263. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
  1264. data/ext/gyp/test/variables/commands/commands-repeated.gyp +128 -0
  1265. data/ext/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
  1266. data/ext/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
  1267. data/ext/gyp/test/variables/commands/commands.gyp +91 -0
  1268. data/ext/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
  1269. data/ext/gyp/test/variables/commands/commands.gyp.stdout +96 -0
  1270. data/ext/gyp/test/variables/commands/commands.gypd.golden +66 -0
  1271. data/ext/gyp/test/variables/commands/commands.gypi +23 -0
  1272. data/ext/gyp/test/variables/commands/gyptest-commands-ignore-env.py +47 -0
  1273. data/ext/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py +23 -0
  1274. data/ext/gyp/test/variables/commands/gyptest-commands-repeated.py +40 -0
  1275. data/ext/gyp/test/variables/commands/gyptest-commands.py +40 -0
  1276. data/ext/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp +13 -0
  1277. data/ext/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp +13 -0
  1278. data/ext/gyp/test/variables/commands/repeated_multidir/main.gyp +16 -0
  1279. data/ext/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py +11 -0
  1280. data/ext/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi +25 -0
  1281. data/ext/gyp/test/variables/commands/test.py +7 -0
  1282. data/ext/gyp/test/variables/commands/update_golden +11 -0
  1283. data/ext/gyp/test/variables/empty/empty.gyp +13 -0
  1284. data/ext/gyp/test/variables/empty/empty.gypi +9 -0
  1285. data/ext/gyp/test/variables/empty/gyptest-empty.py +19 -0
  1286. data/ext/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
  1287. data/ext/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
  1288. data/ext/gyp/test/variables/filelist/gyptest-filelist-golden.py +53 -0
  1289. data/ext/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
  1290. data/ext/gyp/test/variables/filelist/src/dummy.py +5 -0
  1291. data/ext/gyp/test/variables/filelist/src/filelist.gyp +93 -0
  1292. data/ext/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
  1293. data/ext/gyp/test/variables/filelist/update_golden +8 -0
  1294. data/ext/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
  1295. data/ext/gyp/test/variables/latelate/src/latelate.gyp +34 -0
  1296. data/ext/gyp/test/variables/latelate/src/program.cc +13 -0
  1297. data/ext/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
  1298. data/ext/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
  1299. data/ext/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
  1300. data/ext/gyp/test/win/asm-files/asm-files.gyp +17 -0
  1301. data/ext/gyp/test/win/asm-files/b.s +0 -0
  1302. data/ext/gyp/test/win/asm-files/c.S +0 -0
  1303. data/ext/gyp/test/win/asm-files/hello.cc +7 -0
  1304. data/ext/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
  1305. data/ext/gyp/test/win/batch-file-action/infile +1 -0
  1306. data/ext/gyp/test/win/batch-file-action/somecmd.bat +5 -0
  1307. data/ext/gyp/test/win/command-quote/a.S +0 -0
  1308. data/ext/gyp/test/win/command-quote/bat with spaces.bat +7 -0
  1309. data/ext/gyp/test/win/command-quote/command-quote.gyp +79 -0
  1310. data/ext/gyp/test/win/command-quote/go.bat +7 -0
  1311. data/ext/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +27 -0
  1312. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
  1313. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
  1314. data/ext/gyp/test/win/compiler-flags/additional-options.cc +10 -0
  1315. data/ext/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
  1316. data/ext/gyp/test/win/compiler-flags/analysis.gyp +40 -0
  1317. data/ext/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
  1318. data/ext/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
  1319. data/ext/gyp/test/win/compiler-flags/calling-convention-cdecl.def +6 -0
  1320. data/ext/gyp/test/win/compiler-flags/calling-convention-fastcall.def +6 -0
  1321. data/ext/gyp/test/win/compiler-flags/calling-convention-stdcall.def +6 -0
  1322. data/ext/gyp/test/win/compiler-flags/calling-convention-vectorcall.def +6 -0
  1323. data/ext/gyp/test/win/compiler-flags/calling-convention.cc +6 -0
  1324. data/ext/gyp/test/win/compiler-flags/calling-convention.gyp +66 -0
  1325. data/ext/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
  1326. data/ext/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
  1327. data/ext/gyp/test/win/compiler-flags/character-set.gyp +35 -0
  1328. data/ext/gyp/test/win/compiler-flags/compile-as-managed.cc +9 -0
  1329. data/ext/gyp/test/win/compiler-flags/compile-as-managed.gyp +29 -0
  1330. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.cc +12 -0
  1331. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.gyp +20 -0
  1332. data/ext/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
  1333. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
  1334. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
  1335. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
  1336. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
  1337. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc +28 -0
  1338. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp +68 -0
  1339. data/ext/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
  1340. data/ext/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
  1341. data/ext/gyp/test/win/compiler-flags/floating-point-model-fast.cc +19 -0
  1342. data/ext/gyp/test/win/compiler-flags/floating-point-model-precise.cc +19 -0
  1343. data/ext/gyp/test/win/compiler-flags/floating-point-model-strict.cc +19 -0
  1344. data/ext/gyp/test/win/compiler-flags/floating-point-model.gyp +43 -0
  1345. data/ext/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
  1346. data/ext/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
  1347. data/ext/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
  1348. data/ext/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
  1349. data/ext/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
  1350. data/ext/gyp/test/win/compiler-flags/hello.cc +7 -0
  1351. data/ext/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
  1352. data/ext/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
  1353. data/ext/gyp/test/win/compiler-flags/pdbname.cc +7 -0
  1354. data/ext/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
  1355. data/ext/gyp/test/win/compiler-flags/precomp.cc +6 -0
  1356. data/ext/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
  1357. data/ext/gyp/test/win/compiler-flags/rtti.gyp +37 -0
  1358. data/ext/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
  1359. data/ext/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
  1360. data/ext/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
  1361. data/ext/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
  1362. data/ext/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
  1363. data/ext/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
  1364. data/ext/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
  1365. data/ext/gyp/test/win/compiler-flags/subdir/header.h +0 -0
  1366. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
  1367. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
  1368. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
  1369. data/ext/gyp/test/win/compiler-flags/uninit.cc +13 -0
  1370. data/ext/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
  1371. data/ext/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
  1372. data/ext/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
  1373. data/ext/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
  1374. data/ext/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
  1375. data/ext/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
  1376. data/ext/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
  1377. data/ext/gyp/test/win/enable-winrt/dllmain.cc +30 -0
  1378. data/ext/gyp/test/win/enable-winrt/enable-winrt.gyp +39 -0
  1379. data/ext/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
  1380. data/ext/gyp/test/win/generator-output-different-drive/prog.c +10 -0
  1381. data/ext/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
  1382. data/ext/gyp/test/win/gyptest-asm-files.py +26 -0
  1383. data/ext/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
  1384. data/ext/gyp/test/win/gyptest-cl-additional-options.py +28 -0
  1385. data/ext/gyp/test/win/gyptest-cl-analysis.py +30 -0
  1386. data/ext/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
  1387. data/ext/gyp/test/win/gyptest-cl-calling-convention.py +22 -0
  1388. data/ext/gyp/test/win/gyptest-cl-character-set.py +22 -0
  1389. data/ext/gyp/test/win/gyptest-cl-compile-as-managed.py +24 -0
  1390. data/ext/gyp/test/win/gyptest-cl-compile-as-winrt.py +20 -0
  1391. data/ext/gyp/test/win/gyptest-cl-debug-format.py +43 -0
  1392. data/ext/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
  1393. data/ext/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
  1394. data/ext/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py +49 -0
  1395. data/ext/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
  1396. data/ext/gyp/test/win/gyptest-cl-floating-point-model.py +22 -0
  1397. data/ext/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
  1398. data/ext/gyp/test/win/gyptest-cl-function-level-linking.py +54 -0
  1399. data/ext/gyp/test/win/gyptest-cl-optimizations.py +105 -0
  1400. data/ext/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
  1401. data/ext/gyp/test/win/gyptest-cl-pdbname.py +30 -0
  1402. data/ext/gyp/test/win/gyptest-cl-rtti.py +30 -0
  1403. data/ext/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
  1404. data/ext/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
  1405. data/ext/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
  1406. data/ext/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
  1407. data/ext/gyp/test/win/gyptest-cl-warning-level.py +41 -0
  1408. data/ext/gyp/test/win/gyptest-command-quote.py +42 -0
  1409. data/ext/gyp/test/win/gyptest-crosscompile-ar.py +29 -0
  1410. data/ext/gyp/test/win/gyptest-lib-ltcg.py +22 -0
  1411. data/ext/gyp/test/win/gyptest-link-additional-deps.py +22 -0
  1412. data/ext/gyp/test/win/gyptest-link-additional-options.py +22 -0
  1413. data/ext/gyp/test/win/gyptest-link-aslr.py +35 -0
  1414. data/ext/gyp/test/win/gyptest-link-base-address.py +62 -0
  1415. data/ext/gyp/test/win/gyptest-link-debug-info.py +26 -0
  1416. data/ext/gyp/test/win/gyptest-link-default-libs.py +22 -0
  1417. data/ext/gyp/test/win/gyptest-link-deffile.py +43 -0
  1418. data/ext/gyp/test/win/gyptest-link-defrelink.py +56 -0
  1419. data/ext/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
  1420. data/ext/gyp/test/win/gyptest-link-embed-manifest.py +100 -0
  1421. data/ext/gyp/test/win/gyptest-link-enable-uac.py +104 -0
  1422. data/ext/gyp/test/win/gyptest-link-enable-winrt-app-revision.py +43 -0
  1423. data/ext/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py +47 -0
  1424. data/ext/gyp/test/win/gyptest-link-enable-winrt.py +37 -0
  1425. data/ext/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
  1426. data/ext/gyp/test/win/gyptest-link-fixed-base.py +40 -0
  1427. data/ext/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
  1428. data/ext/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
  1429. data/ext/gyp/test/win/gyptest-link-incremental.py +37 -0
  1430. data/ext/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
  1431. data/ext/gyp/test/win/gyptest-link-large-pdb.py +76 -0
  1432. data/ext/gyp/test/win/gyptest-link-library-adjust.py +21 -0
  1433. data/ext/gyp/test/win/gyptest-link-library-directories.py +35 -0
  1434. data/ext/gyp/test/win/gyptest-link-ltcg.py +44 -0
  1435. data/ext/gyp/test/win/gyptest-link-mapfile.py +44 -0
  1436. data/ext/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
  1437. data/ext/gyp/test/win/gyptest-link-noimportlib.py +30 -0
  1438. data/ext/gyp/test/win/gyptest-link-nxcompat.py +37 -0
  1439. data/ext/gyp/test/win/gyptest-link-opt-icf.py +41 -0
  1440. data/ext/gyp/test/win/gyptest-link-opt-ref.py +40 -0
  1441. data/ext/gyp/test/win/gyptest-link-ordering.py +103 -0
  1442. data/ext/gyp/test/win/gyptest-link-outputfile.py +28 -0
  1443. data/ext/gyp/test/win/gyptest-link-pdb-no-output.py +25 -0
  1444. data/ext/gyp/test/win/gyptest-link-pdb-output.py +33 -0
  1445. data/ext/gyp/test/win/gyptest-link-pdb.py +35 -0
  1446. data/ext/gyp/test/win/gyptest-link-pgo.py +75 -0
  1447. data/ext/gyp/test/win/gyptest-link-profile.py +37 -0
  1448. data/ext/gyp/test/win/gyptest-link-restat-importlib.py +47 -0
  1449. data/ext/gyp/test/win/gyptest-link-safeseh.py +46 -0
  1450. data/ext/gyp/test/win/gyptest-link-shard.py +30 -0
  1451. data/ext/gyp/test/win/gyptest-link-stacksize.py +62 -0
  1452. data/ext/gyp/test/win/gyptest-link-subsystem.py +38 -0
  1453. data/ext/gyp/test/win/gyptest-link-target-machine.py +28 -0
  1454. data/ext/gyp/test/win/gyptest-link-tsaware.py +33 -0
  1455. data/ext/gyp/test/win/gyptest-link-uldi-depending-on-module.py +24 -0
  1456. data/ext/gyp/test/win/gyptest-link-uldi.py +28 -0
  1457. data/ext/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
  1458. data/ext/gyp/test/win/gyptest-link-update-manifest.py +104 -0
  1459. data/ext/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
  1460. data/ext/gyp/test/win/gyptest-long-command-line.py +23 -0
  1461. data/ext/gyp/test/win/gyptest-macro-projectname.py +24 -0
  1462. data/ext/gyp/test/win/gyptest-macro-targetext.py +26 -0
  1463. data/ext/gyp/test/win/gyptest-macro-targetfilename.py +37 -0
  1464. data/ext/gyp/test/win/gyptest-macro-targetname.py +29 -0
  1465. data/ext/gyp/test/win/gyptest-macro-targetpath.py +30 -0
  1466. data/ext/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
  1467. data/ext/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
  1468. data/ext/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
  1469. data/ext/gyp/test/win/gyptest-midl-excluded.py +22 -0
  1470. data/ext/gyp/test/win/gyptest-midl-includedirs.py +21 -0
  1471. data/ext/gyp/test/win/gyptest-midl-rules.py +28 -0
  1472. data/ext/gyp/test/win/gyptest-ml-safeseh.py +22 -0
  1473. data/ext/gyp/test/win/gyptest-quoting-commands.py +25 -0
  1474. data/ext/gyp/test/win/gyptest-rc-build.py +29 -0
  1475. data/ext/gyp/test/win/gyptest-sys.py +27 -0
  1476. data/ext/gyp/test/win/gyptest-system-include.py +21 -0
  1477. data/ext/gyp/test/win/idl-excluded/bad.idl +6 -0
  1478. data/ext/gyp/test/win/idl-excluded/copy-file.py +11 -0
  1479. data/ext/gyp/test/win/idl-excluded/idl-excluded.gyp +58 -0
  1480. data/ext/gyp/test/win/idl-excluded/program.cc +7 -0
  1481. data/ext/gyp/test/win/idl-includedirs/hello.cc +7 -0
  1482. data/ext/gyp/test/win/idl-includedirs/idl-includedirs.gyp +26 -0
  1483. data/ext/gyp/test/win/idl-includedirs/subdir/bar.idl +13 -0
  1484. data/ext/gyp/test/win/idl-includedirs/subdir/foo.idl +14 -0
  1485. data/ext/gyp/test/win/idl-rules/Window.idl +9 -0
  1486. data/ext/gyp/test/win/idl-rules/basic-idl.gyp +67 -0
  1487. data/ext/gyp/test/win/idl-rules/history_indexer.idl +17 -0
  1488. data/ext/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
  1489. data/ext/gyp/test/win/idl-rules/idl_compiler.py +17 -0
  1490. data/ext/gyp/test/win/importlib/dll_no_exports.cc +9 -0
  1491. data/ext/gyp/test/win/importlib/has-exports.cc +10 -0
  1492. data/ext/gyp/test/win/importlib/hello.cc +9 -0
  1493. data/ext/gyp/test/win/importlib/importlib.gyp +30 -0
  1494. data/ext/gyp/test/win/importlib/noimplib.gyp +16 -0
  1495. data/ext/gyp/test/win/large-pdb/dllmain.cc +9 -0
  1496. data/ext/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
  1497. data/ext/gyp/test/win/large-pdb/main.cc +7 -0
  1498. data/ext/gyp/test/win/lib-crosscompile/answer.cc +9 -0
  1499. data/ext/gyp/test/win/lib-crosscompile/answer.h +5 -0
  1500. data/ext/gyp/test/win/lib-crosscompile/use_host_ar.gyp +17 -0
  1501. data/ext/gyp/test/win/lib-flags/answer.cc +9 -0
  1502. data/ext/gyp/test/win/lib-flags/answer.h +5 -0
  1503. data/ext/gyp/test/win/lib-flags/ltcg.gyp +21 -0
  1504. data/ext/gyp/test/win/linker-flags/a/x.cc +7 -0
  1505. data/ext/gyp/test/win/linker-flags/a/z.cc +7 -0
  1506. data/ext/gyp/test/win/linker-flags/additional-deps.cc +10 -0
  1507. data/ext/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
  1508. data/ext/gyp/test/win/linker-flags/additional-options.gyp +29 -0
  1509. data/ext/gyp/test/win/linker-flags/aslr.gyp +35 -0
  1510. data/ext/gyp/test/win/linker-flags/b/y.cc +7 -0
  1511. data/ext/gyp/test/win/linker-flags/base-address.gyp +38 -0
  1512. data/ext/gyp/test/win/linker-flags/debug-info.gyp +28 -0
  1513. data/ext/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
  1514. data/ext/gyp/test/win/linker-flags/deffile.cc +13 -0
  1515. data/ext/gyp/test/win/linker-flags/deffile.def +8 -0
  1516. data/ext/gyp/test/win/linker-flags/deffile.gyp +38 -0
  1517. data/ext/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
  1518. data/ext/gyp/test/win/linker-flags/delay-load.cc +10 -0
  1519. data/ext/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
  1520. data/ext/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
  1521. data/ext/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
  1522. data/ext/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
  1523. data/ext/gyp/test/win/linker-flags/extra.manifest +11 -0
  1524. data/ext/gyp/test/win/linker-flags/extra2.manifest +11 -0
  1525. data/ext/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
  1526. data/ext/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
  1527. data/ext/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
  1528. data/ext/gyp/test/win/linker-flags/hello.cc +7 -0
  1529. data/ext/gyp/test/win/linker-flags/incremental.gyp +65 -0
  1530. data/ext/gyp/test/win/linker-flags/inline_test.cc +12 -0
  1531. data/ext/gyp/test/win/linker-flags/inline_test.h +5 -0
  1532. data/ext/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
  1533. data/ext/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
  1534. data/ext/gyp/test/win/linker-flags/library-adjust.cc +10 -0
  1535. data/ext/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
  1536. data/ext/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
  1537. data/ext/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
  1538. data/ext/gyp/test/win/linker-flags/library-directories.gyp +42 -0
  1539. data/ext/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
  1540. data/ext/gyp/test/win/linker-flags/link-warning.cc +10 -0
  1541. data/ext/gyp/test/win/linker-flags/ltcg.gyp +42 -0
  1542. data/ext/gyp/test/win/linker-flags/main-crt.c +8 -0
  1543. data/ext/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
  1544. data/ext/gyp/test/win/linker-flags/mapfile.cc +12 -0
  1545. data/ext/gyp/test/win/linker-flags/mapfile.gyp +45 -0
  1546. data/ext/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
  1547. data/ext/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
  1548. data/ext/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
  1549. data/ext/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
  1550. data/ext/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
  1551. data/ext/gyp/test/win/linker-flags/opt-icf.cc +29 -0
  1552. data/ext/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
  1553. data/ext/gyp/test/win/linker-flags/opt-ref.cc +11 -0
  1554. data/ext/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
  1555. data/ext/gyp/test/win/linker-flags/outputfile.gyp +58 -0
  1556. data/ext/gyp/test/win/linker-flags/pdb-output.gyp +49 -0
  1557. data/ext/gyp/test/win/linker-flags/pgo.gyp +143 -0
  1558. data/ext/gyp/test/win/linker-flags/profile.gyp +50 -0
  1559. data/ext/gyp/test/win/linker-flags/program-database.gyp +40 -0
  1560. data/ext/gyp/test/win/linker-flags/safeseh.gyp +79 -0
  1561. data/ext/gyp/test/win/linker-flags/safeseh_hello.cc +11 -0
  1562. data/ext/gyp/test/win/linker-flags/safeseh_zero.asm +10 -0
  1563. data/ext/gyp/test/win/linker-flags/safeseh_zero64.asm +9 -0
  1564. data/ext/gyp/test/win/linker-flags/stacksize.gyp +44 -0
  1565. data/ext/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
  1566. data/ext/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
  1567. data/ext/gyp/test/win/linker-flags/subsystem.gyp +70 -0
  1568. data/ext/gyp/test/win/linker-flags/target-machine.gyp +48 -0
  1569. data/ext/gyp/test/win/linker-flags/tsaware.gyp +28 -0
  1570. data/ext/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
  1571. data/ext/gyp/test/win/linker-flags/update_pgd.py +35 -0
  1572. data/ext/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
  1573. data/ext/gyp/test/win/linker-flags/x.cc +7 -0
  1574. data/ext/gyp/test/win/linker-flags/y.cc +7 -0
  1575. data/ext/gyp/test/win/linker-flags/z.cc +7 -0
  1576. data/ext/gyp/test/win/long-command-line/function.cc +7 -0
  1577. data/ext/gyp/test/win/long-command-line/hello.cc +7 -0
  1578. data/ext/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
  1579. data/ext/gyp/test/win/ml-safeseh/a.asm +10 -0
  1580. data/ext/gyp/test/win/ml-safeseh/hello.cc +11 -0
  1581. data/ext/gyp/test/win/ml-safeseh/ml-safeseh.gyp +24 -0
  1582. data/ext/gyp/test/win/precompiled/gyptest-all.py +21 -0
  1583. data/ext/gyp/test/win/precompiled/hello.c +14 -0
  1584. data/ext/gyp/test/win/precompiled/hello.gyp +28 -0
  1585. data/ext/gyp/test/win/precompiled/hello2.c +13 -0
  1586. data/ext/gyp/test/win/precompiled/precomp.c +8 -0
  1587. data/ext/gyp/test/win/rc-build/Resource.h +26 -0
  1588. data/ext/gyp/test/win/rc-build/hello.cpp +30 -0
  1589. data/ext/gyp/test/win/rc-build/hello.gyp +92 -0
  1590. data/ext/gyp/test/win/rc-build/hello.h +3 -0
  1591. data/ext/gyp/test/win/rc-build/hello.ico +0 -0
  1592. data/ext/gyp/test/win/rc-build/hello.rc +86 -0
  1593. data/ext/gyp/test/win/rc-build/hello3.rc +87 -0
  1594. data/ext/gyp/test/win/rc-build/small.ico +0 -0
  1595. data/ext/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
  1596. data/ext/gyp/test/win/rc-build/subdir/include.h +1 -0
  1597. data/ext/gyp/test/win/rc-build/targetver.h +24 -0
  1598. data/ext/gyp/test/win/shard/hello.cc +7 -0
  1599. data/ext/gyp/test/win/shard/hello1.cc +7 -0
  1600. data/ext/gyp/test/win/shard/hello2.cc +7 -0
  1601. data/ext/gyp/test/win/shard/hello3.cc +7 -0
  1602. data/ext/gyp/test/win/shard/hello4.cc +7 -0
  1603. data/ext/gyp/test/win/shard/shard.gyp +31 -0
  1604. data/ext/gyp/test/win/shard/shard_ref.gyp +41 -0
  1605. data/ext/gyp/test/win/system-include/bar/header.h +0 -0
  1606. data/ext/gyp/test/win/system-include/common/commonheader.h +0 -0
  1607. data/ext/gyp/test/win/system-include/foo/header.h +0 -0
  1608. data/ext/gyp/test/win/system-include/main.cc +4 -0
  1609. data/ext/gyp/test/win/system-include/test.gyp +26 -0
  1610. data/ext/gyp/test/win/uldi/a.cc +7 -0
  1611. data/ext/gyp/test/win/uldi/b.cc +7 -0
  1612. data/ext/gyp/test/win/uldi/dll.cc +6 -0
  1613. data/ext/gyp/test/win/uldi/exe.cc +7 -0
  1614. data/ext/gyp/test/win/uldi/main.cc +10 -0
  1615. data/ext/gyp/test/win/uldi/uldi-depending-on-module.gyp +42 -0
  1616. data/ext/gyp/test/win/uldi/uldi.gyp +45 -0
  1617. data/ext/gyp/test/win/vs-macros/as.py +20 -0
  1618. data/ext/gyp/test/win/vs-macros/containing-gyp.gyp +39 -0
  1619. data/ext/gyp/test/win/vs-macros/do_stuff.py +8 -0
  1620. data/ext/gyp/test/win/vs-macros/hello.cc +7 -0
  1621. data/ext/gyp/test/win/vs-macros/input-output-macros.gyp +32 -0
  1622. data/ext/gyp/test/win/vs-macros/input.S +0 -0
  1623. data/ext/gyp/test/win/vs-macros/projectname.gyp +29 -0
  1624. data/ext/gyp/test/win/vs-macros/stuff.blah +1 -0
  1625. data/ext/gyp/test/win/vs-macros/targetext.gyp +59 -0
  1626. data/ext/gyp/test/win/vs-macros/targetfilename.gyp +59 -0
  1627. data/ext/gyp/test/win/vs-macros/targetname.gyp +52 -0
  1628. data/ext/gyp/test/win/vs-macros/targetpath.gyp +59 -0
  1629. data/ext/gyp/test/win/vs-macros/test_exists.py +10 -0
  1630. data/ext/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
  1631. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.c +10 -0
  1632. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp +32 -0
  1633. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.h +13 -0
  1634. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.rc +14 -0
  1635. data/ext/gyp/test/win/win-tool/copies_readonly_files.gyp +29 -0
  1636. data/ext/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py +55 -0
  1637. data/ext/gyp/test/win/winrt-app-type-revision/dllmain.cc +30 -0
  1638. data/ext/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp +43 -0
  1639. data/ext/gyp/test/win/winrt-target-platform-version/dllmain.cc +30 -0
  1640. data/ext/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp +49 -0
  1641. data/ext/gyp/test/xcode-ninja/list_excluded/gyptest-all.py +49 -0
  1642. data/ext/gyp/test/xcode-ninja/list_excluded/hello.cpp +7 -0
  1643. data/ext/gyp/test/xcode-ninja/list_excluded/hello_exclude.gyp +19 -0
  1644. data/ext/gyp/test/xcode-ninja/list_excluded/hello_excluded.cpp +7 -0
  1645. data/ext/gyp/tools/README +15 -0
  1646. data/ext/gyp/tools/Xcode/README +5 -0
  1647. data/ext/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  1648. data/ext/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  1649. data/ext/gyp/tools/emacs/README +12 -0
  1650. data/ext/gyp/tools/emacs/gyp-tests.el +63 -0
  1651. data/ext/gyp/tools/emacs/gyp.el +275 -0
  1652. data/ext/gyp/tools/emacs/run-unit-tests.sh +7 -0
  1653. data/ext/gyp/tools/emacs/testdata/media.gyp +1105 -0
  1654. data/ext/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  1655. data/ext/gyp/tools/graphviz.py +102 -0
  1656. data/ext/gyp/tools/pretty_gyp.py +156 -0
  1657. data/ext/gyp/tools/pretty_sln.py +171 -0
  1658. data/ext/gyp/tools/pretty_vcproj.py +337 -0
  1659. data/ext/libuv/.gitattributes +1 -0
  1660. data/ext/libuv/.github/ISSUE_TEMPLATE.md +13 -0
  1661. data/ext/libuv/.github/stale.yml +22 -0
  1662. data/ext/libuv/.gitignore +80 -0
  1663. data/ext/libuv/.mailmap +50 -0
  1664. data/ext/libuv/AUTHORS +415 -0
  1665. data/ext/libuv/CMakeLists.txt +430 -0
  1666. data/ext/libuv/CONTRIBUTING.md +172 -0
  1667. data/ext/libuv/ChangeLog +4548 -0
  1668. data/ext/libuv/LICENSE +70 -0
  1669. data/ext/libuv/LICENSE-docs +396 -0
  1670. data/ext/libuv/MAINTAINERS.md +48 -0
  1671. data/ext/libuv/Makefile.am +548 -0
  1672. data/ext/libuv/README.md +431 -0
  1673. data/ext/libuv/SUPPORTED_PLATFORMS.md +68 -0
  1674. data/ext/libuv/android-configure-arm +23 -0
  1675. data/ext/libuv/android-configure-arm64 +23 -0
  1676. data/ext/libuv/android-configure-x86 +23 -0
  1677. data/ext/libuv/android-configure-x86_64 +25 -0
  1678. data/ext/libuv/appveyor.yml +32 -0
  1679. data/ext/libuv/autogen.sh +46 -0
  1680. data/ext/libuv/common.gypi +213 -0
  1681. data/ext/libuv/configure.ac +82 -0
  1682. data/ext/libuv/docs/Makefile +183 -0
  1683. data/ext/libuv/docs/code/cgi/main.c +81 -0
  1684. data/ext/libuv/docs/code/cgi/tick.c +13 -0
  1685. data/ext/libuv/docs/code/detach/main.c +31 -0
  1686. data/ext/libuv/docs/code/dns/main.c +80 -0
  1687. data/ext/libuv/docs/code/helloworld/main.c +15 -0
  1688. data/ext/libuv/docs/code/idle-basic/main.c +24 -0
  1689. data/ext/libuv/docs/code/idle-compute/main.c +43 -0
  1690. data/ext/libuv/docs/code/interfaces/main.c +33 -0
  1691. data/ext/libuv/docs/code/locks/main.c +57 -0
  1692. data/ext/libuv/docs/code/multi-echo-server/hammer.js +20 -0
  1693. data/ext/libuv/docs/code/multi-echo-server/main.c +114 -0
  1694. data/ext/libuv/docs/code/multi-echo-server/worker.c +88 -0
  1695. data/ext/libuv/docs/code/onchange/main.c +44 -0
  1696. data/ext/libuv/docs/code/pipe-echo-server/main.c +94 -0
  1697. data/ext/libuv/docs/code/plugin/hello.c +5 -0
  1698. data/ext/libuv/docs/code/plugin/main.c +39 -0
  1699. data/ext/libuv/docs/code/plugin/plugin.h +7 -0
  1700. data/ext/libuv/docs/code/proc-streams/main.c +49 -0
  1701. data/ext/libuv/docs/code/proc-streams/test.c +8 -0
  1702. data/ext/libuv/docs/code/progress/main.c +47 -0
  1703. data/ext/libuv/docs/code/queue-cancel/main.c +59 -0
  1704. data/ext/libuv/docs/code/queue-work/main.c +44 -0
  1705. data/ext/libuv/docs/code/ref-timer/main.c +29 -0
  1706. data/ext/libuv/docs/code/signal/main.c +66 -0
  1707. data/ext/libuv/docs/code/spawn/main.c +36 -0
  1708. data/ext/libuv/docs/code/tcp-echo-server/main.c +87 -0
  1709. data/ext/libuv/docs/code/thread-create/main.c +36 -0
  1710. data/ext/libuv/docs/code/tty/main.c +29 -0
  1711. data/ext/libuv/docs/code/tty-gravity/main.c +48 -0
  1712. data/ext/libuv/docs/code/udp-dhcp/main.c +127 -0
  1713. data/ext/libuv/docs/code/uvcat/main.c +63 -0
  1714. data/ext/libuv/docs/code/uvstop/main.c +33 -0
  1715. data/ext/libuv/docs/code/uvtee/main.c +80 -0
  1716. data/ext/libuv/docs/code/uvwget/main.c +166 -0
  1717. data/ext/libuv/docs/make.bat +243 -0
  1718. data/ext/libuv/docs/src/api.rst +35 -0
  1719. data/ext/libuv/docs/src/async.rst +65 -0
  1720. data/ext/libuv/docs/src/check.rst +46 -0
  1721. data/ext/libuv/docs/src/conf.py +348 -0
  1722. data/ext/libuv/docs/src/design.rst +140 -0
  1723. data/ext/libuv/docs/src/dll.rst +44 -0
  1724. data/ext/libuv/docs/src/dns.rst +108 -0
  1725. data/ext/libuv/docs/src/errors.rst +365 -0
  1726. data/ext/libuv/docs/src/fs.rst +689 -0
  1727. data/ext/libuv/docs/src/fs_event.rst +132 -0
  1728. data/ext/libuv/docs/src/fs_poll.rst +77 -0
  1729. data/ext/libuv/docs/src/guide/about.rst +22 -0
  1730. data/ext/libuv/docs/src/guide/basics.rst +219 -0
  1731. data/ext/libuv/docs/src/guide/eventloops.rst +48 -0
  1732. data/ext/libuv/docs/src/guide/filesystem.rst +330 -0
  1733. data/ext/libuv/docs/src/guide/introduction.rst +75 -0
  1734. data/ext/libuv/docs/src/guide/networking.rst +250 -0
  1735. data/ext/libuv/docs/src/guide/processes.rst +406 -0
  1736. data/ext/libuv/docs/src/guide/threads.rst +385 -0
  1737. data/ext/libuv/docs/src/guide/utilities.rst +437 -0
  1738. data/ext/libuv/docs/src/guide.rst +22 -0
  1739. data/ext/libuv/docs/src/handle.rst +283 -0
  1740. data/ext/libuv/docs/src/idle.rst +54 -0
  1741. data/ext/libuv/docs/src/index.rst +62 -0
  1742. data/ext/libuv/docs/src/loop.rst +238 -0
  1743. data/ext/libuv/docs/src/migration_010_100.rst +244 -0
  1744. data/ext/libuv/docs/src/misc.rst +702 -0
  1745. data/ext/libuv/docs/src/pipe.rst +116 -0
  1746. data/ext/libuv/docs/src/poll.rst +121 -0
  1747. data/ext/libuv/docs/src/prepare.rst +46 -0
  1748. data/ext/libuv/docs/src/process.rst +250 -0
  1749. data/ext/libuv/docs/src/request.rst +116 -0
  1750. data/ext/libuv/docs/src/signal.rst +101 -0
  1751. data/ext/libuv/docs/src/sphinx-plugins/manpage.py +45 -0
  1752. data/ext/libuv/docs/src/static/architecture.png +0 -0
  1753. data/ext/libuv/docs/src/static/diagrams.key/Data/st0-311.jpg +0 -0
  1754. data/ext/libuv/docs/src/static/diagrams.key/Data/st1-475.jpg +0 -0
  1755. data/ext/libuv/docs/src/static/diagrams.key/Index.zip +0 -0
  1756. data/ext/libuv/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist +8 -0
  1757. data/ext/libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier +1 -0
  1758. data/ext/libuv/docs/src/static/diagrams.key/Metadata/Properties.plist +0 -0
  1759. data/ext/libuv/docs/src/static/diagrams.key/preview-micro.jpg +0 -0
  1760. data/ext/libuv/docs/src/static/diagrams.key/preview-web.jpg +0 -0
  1761. data/ext/libuv/docs/src/static/diagrams.key/preview.jpg +0 -0
  1762. data/ext/libuv/docs/src/static/favicon.ico +0 -0
  1763. data/ext/libuv/docs/src/static/logo.png +0 -0
  1764. data/ext/libuv/docs/src/static/loop_iteration.png +0 -0
  1765. data/ext/libuv/docs/src/stream.rst +237 -0
  1766. data/ext/libuv/docs/src/tcp.rst +125 -0
  1767. data/ext/libuv/docs/src/threading.rst +197 -0
  1768. data/ext/libuv/docs/src/threadpool.rst +69 -0
  1769. data/ext/libuv/docs/src/timer.rst +81 -0
  1770. data/ext/libuv/docs/src/tty.rst +139 -0
  1771. data/ext/libuv/docs/src/udp.rst +390 -0
  1772. data/ext/libuv/docs/src/upgrading.rst +11 -0
  1773. data/ext/libuv/docs/src/version.rst +60 -0
  1774. data/ext/libuv/gyp_uv.py +73 -0
  1775. data/ext/libuv/img/banner.png +0 -0
  1776. data/ext/libuv/img/logos.svg +152 -0
  1777. data/ext/libuv/include/uv/aix.h +32 -0
  1778. data/ext/libuv/include/uv/android-ifaddrs.h +54 -0
  1779. data/ext/libuv/include/uv/bsd.h +34 -0
  1780. data/ext/libuv/include/uv/darwin.h +61 -0
  1781. data/ext/libuv/include/uv/errno.h +448 -0
  1782. data/ext/libuv/include/uv/linux.h +34 -0
  1783. data/ext/libuv/include/uv/os390.h +33 -0
  1784. data/ext/libuv/include/uv/posix.h +31 -0
  1785. data/ext/libuv/include/uv/stdint-msvc2008.h +247 -0
  1786. data/ext/libuv/include/uv/sunos.h +44 -0
  1787. data/ext/libuv/include/uv/threadpool.h +37 -0
  1788. data/ext/libuv/include/uv/tree.h +768 -0
  1789. data/ext/libuv/include/uv/unix.h +505 -0
  1790. data/ext/libuv/include/uv/version.h +43 -0
  1791. data/ext/libuv/include/uv/win.h +691 -0
  1792. data/ext/libuv/include/uv.h +1782 -0
  1793. data/ext/libuv/libuv.pc.in +12 -0
  1794. data/ext/libuv/m4/.gitignore +4 -0
  1795. data/ext/libuv/m4/as_case.m4 +21 -0
  1796. data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
  1797. data/ext/libuv/src/fs-poll.c +287 -0
  1798. data/ext/libuv/src/heap-inl.h +245 -0
  1799. data/ext/libuv/src/idna.c +291 -0
  1800. data/ext/libuv/src/idna.h +31 -0
  1801. data/ext/libuv/src/inet.c +302 -0
  1802. data/ext/libuv/src/queue.h +108 -0
  1803. data/ext/libuv/src/random.c +123 -0
  1804. data/ext/libuv/src/strscpy.c +17 -0
  1805. data/ext/libuv/src/strscpy.h +18 -0
  1806. data/ext/libuv/src/threadpool.c +388 -0
  1807. data/ext/libuv/src/timer.c +181 -0
  1808. data/ext/libuv/src/unix/aix-common.c +337 -0
  1809. data/ext/libuv/src/unix/aix.c +1066 -0
  1810. data/ext/libuv/src/unix/android-ifaddrs.c +712 -0
  1811. data/ext/libuv/src/unix/async.c +298 -0
  1812. data/ext/libuv/src/unix/atomic-ops.h +59 -0
  1813. data/ext/libuv/src/unix/bsd-ifaddrs.c +161 -0
  1814. data/ext/libuv/src/unix/bsd-proctitle.c +93 -0
  1815. data/ext/libuv/src/unix/core.c +1571 -0
  1816. data/ext/libuv/src/unix/cygwin.c +53 -0
  1817. data/ext/libuv/src/unix/darwin-proctitle.c +202 -0
  1818. data/ext/libuv/src/unix/darwin.c +225 -0
  1819. data/ext/libuv/src/unix/dl.c +80 -0
  1820. data/ext/libuv/src/unix/freebsd.c +290 -0
  1821. data/ext/libuv/src/unix/fs.c +2044 -0
  1822. data/ext/libuv/src/unix/fsevents.c +924 -0
  1823. data/ext/libuv/src/unix/getaddrinfo.c +255 -0
  1824. data/ext/libuv/src/unix/getnameinfo.c +121 -0
  1825. data/ext/libuv/src/unix/haiku.c +167 -0
  1826. data/ext/libuv/src/unix/ibmi.c +249 -0
  1827. data/ext/libuv/src/unix/internal.h +331 -0
  1828. data/ext/libuv/src/unix/kqueue.c +544 -0
  1829. data/ext/libuv/src/unix/linux-core.c +1091 -0
  1830. data/ext/libuv/src/unix/linux-inotify.c +354 -0
  1831. data/ext/libuv/src/unix/linux-syscalls.c +394 -0
  1832. data/ext/libuv/src/unix/linux-syscalls.h +153 -0
  1833. data/ext/libuv/src/unix/loop-watcher.c +68 -0
  1834. data/ext/libuv/src/unix/loop.c +194 -0
  1835. data/ext/libuv/src/unix/netbsd.c +259 -0
  1836. data/ext/libuv/src/unix/no-fsevents.c +42 -0
  1837. data/ext/libuv/src/unix/no-proctitle.c +42 -0
  1838. data/ext/libuv/src/unix/openbsd.c +244 -0
  1839. data/ext/libuv/src/unix/os390-syscalls.c +519 -0
  1840. data/ext/libuv/src/unix/os390-syscalls.h +68 -0
  1841. data/ext/libuv/src/unix/os390.c +1003 -0
  1842. data/ext/libuv/src/unix/pipe.c +377 -0
  1843. data/ext/libuv/src/unix/poll.c +150 -0
  1844. data/ext/libuv/src/unix/posix-hrtime.c +35 -0
  1845. data/ext/libuv/src/unix/posix-poll.c +336 -0
  1846. data/ext/libuv/src/unix/process.c +603 -0
  1847. data/ext/libuv/src/unix/procfs-exepath.c +45 -0
  1848. data/ext/libuv/src/unix/proctitle.c +132 -0
  1849. data/ext/libuv/src/unix/pthread-fixes.c +56 -0
  1850. data/ext/libuv/src/unix/random-devurandom.c +93 -0
  1851. data/ext/libuv/src/unix/random-getentropy.c +57 -0
  1852. data/ext/libuv/src/unix/random-getrandom.c +88 -0
  1853. data/ext/libuv/src/unix/random-sysctl-linux.c +99 -0
  1854. data/ext/libuv/src/unix/signal.c +577 -0
  1855. data/ext/libuv/src/unix/spinlock.h +53 -0
  1856. data/ext/libuv/src/unix/stream.c +1697 -0
  1857. data/ext/libuv/src/unix/sunos.c +836 -0
  1858. data/ext/libuv/src/unix/sysinfo-loadavg.c +36 -0
  1859. data/ext/libuv/src/unix/sysinfo-memory.c +42 -0
  1860. data/ext/libuv/src/unix/tcp.c +450 -0
  1861. data/ext/libuv/src/unix/thread.c +852 -0
  1862. data/ext/libuv/src/unix/tty.c +381 -0
  1863. data/ext/libuv/src/unix/udp.c +1136 -0
  1864. data/ext/libuv/src/uv-common.c +812 -0
  1865. data/ext/libuv/src/uv-common.h +326 -0
  1866. data/ext/libuv/src/uv-data-getter-setters.c +98 -0
  1867. data/ext/libuv/src/version.c +45 -0
  1868. data/ext/libuv/src/win/async.c +98 -0
  1869. data/ext/libuv/src/win/atomicops-inl.h +57 -0
  1870. data/ext/libuv/src/win/core.c +657 -0
  1871. data/ext/libuv/src/win/detect-wakeup.c +35 -0
  1872. data/ext/libuv/src/win/dl.c +136 -0
  1873. data/ext/libuv/src/win/error.c +172 -0
  1874. data/ext/libuv/src/win/fs-event.c +589 -0
  1875. data/ext/libuv/src/win/fs-fd-hash-inl.h +178 -0
  1876. data/ext/libuv/src/win/fs.c +3238 -0
  1877. data/ext/libuv/src/win/getaddrinfo.c +463 -0
  1878. data/ext/libuv/src/win/getnameinfo.c +157 -0
  1879. data/ext/libuv/src/win/handle-inl.h +180 -0
  1880. data/ext/libuv/src/win/handle.c +162 -0
  1881. data/ext/libuv/src/win/internal.h +344 -0
  1882. data/ext/libuv/src/win/loop-watcher.c +122 -0
  1883. data/ext/libuv/src/win/pipe.c +2386 -0
  1884. data/ext/libuv/src/win/poll.c +643 -0
  1885. data/ext/libuv/src/win/process-stdio.c +512 -0
  1886. data/ext/libuv/src/win/process.c +1282 -0
  1887. data/ext/libuv/src/win/req-inl.h +221 -0
  1888. data/ext/libuv/src/win/signal.c +277 -0
  1889. data/ext/libuv/src/win/snprintf.c +42 -0
  1890. data/ext/libuv/src/win/stream-inl.h +54 -0
  1891. data/ext/libuv/src/win/stream.c +243 -0
  1892. data/ext/libuv/src/win/tcp.c +1520 -0
  1893. data/ext/libuv/src/win/thread.c +520 -0
  1894. data/ext/libuv/src/win/tty.c +2348 -0
  1895. data/ext/libuv/src/win/udp.c +1185 -0
  1896. data/ext/libuv/src/win/util.c +1879 -0
  1897. data/ext/libuv/src/win/winapi.c +149 -0
  1898. data/ext/libuv/src/win/winapi.h +4751 -0
  1899. data/ext/libuv/src/win/winsock.c +575 -0
  1900. data/ext/libuv/src/win/winsock.h +201 -0
  1901. data/ext/libuv/test/benchmark-async-pummel.c +119 -0
  1902. data/ext/libuv/test/benchmark-async.c +141 -0
  1903. data/ext/libuv/test/benchmark-fs-stat.c +136 -0
  1904. data/ext/libuv/test/benchmark-getaddrinfo.c +92 -0
  1905. data/ext/libuv/test/benchmark-list.h +163 -0
  1906. data/ext/libuv/test/benchmark-loop-count.c +92 -0
  1907. data/ext/libuv/test/benchmark-million-async.c +112 -0
  1908. data/ext/libuv/test/benchmark-million-timers.c +86 -0
  1909. data/ext/libuv/test/benchmark-multi-accept.c +447 -0
  1910. data/ext/libuv/test/benchmark-ping-pongs.c +221 -0
  1911. data/ext/libuv/test/benchmark-pound.c +351 -0
  1912. data/ext/libuv/test/benchmark-pump.c +476 -0
  1913. data/ext/libuv/test/benchmark-sizes.c +46 -0
  1914. data/ext/libuv/test/benchmark-spawn.c +164 -0
  1915. data/ext/libuv/test/benchmark-tcp-write-batch.c +144 -0
  1916. data/ext/libuv/test/benchmark-thread.c +64 -0
  1917. data/ext/libuv/test/benchmark-udp-pummel.c +243 -0
  1918. data/ext/libuv/test/blackhole-server.c +121 -0
  1919. data/ext/libuv/test/dns-server.c +340 -0
  1920. data/ext/libuv/test/echo-server.c +382 -0
  1921. data/ext/libuv/test/fixtures/empty_file +0 -0
  1922. data/ext/libuv/test/fixtures/load_error.node +1 -0
  1923. data/ext/libuv/test/fixtures/lorem_ipsum.txt +1 -0
  1924. data/ext/libuv/test/run-benchmarks.c +65 -0
  1925. data/ext/libuv/test/run-tests.c +239 -0
  1926. data/ext/libuv/test/runner-unix.c +450 -0
  1927. data/ext/libuv/test/runner-unix.h +36 -0
  1928. data/ext/libuv/test/runner-win.c +357 -0
  1929. data/ext/libuv/test/runner-win.h +41 -0
  1930. data/ext/libuv/test/runner.c +431 -0
  1931. data/ext/libuv/test/runner.h +176 -0
  1932. data/ext/libuv/test/task.h +238 -0
  1933. data/ext/libuv/test/test-active.c +84 -0
  1934. data/ext/libuv/test/test-async-null-cb.c +64 -0
  1935. data/ext/libuv/test/test-async.c +134 -0
  1936. data/ext/libuv/test/test-barrier.c +148 -0
  1937. data/ext/libuv/test/test-callback-order.c +77 -0
  1938. data/ext/libuv/test/test-callback-stack.c +204 -0
  1939. data/ext/libuv/test/test-close-fd.c +80 -0
  1940. data/ext/libuv/test/test-close-order.c +80 -0
  1941. data/ext/libuv/test/test-condvar.c +267 -0
  1942. data/ext/libuv/test/test-connect-unspecified.c +63 -0
  1943. data/ext/libuv/test/test-connection-fail.c +151 -0
  1944. data/ext/libuv/test/test-cwd-and-chdir.c +58 -0
  1945. data/ext/libuv/test/test-default-loop-close.c +59 -0
  1946. data/ext/libuv/test/test-delayed-accept.c +189 -0
  1947. data/ext/libuv/test/test-dlerror.c +61 -0
  1948. data/ext/libuv/test/test-eintr-handling.c +94 -0
  1949. data/ext/libuv/test/test-embed.c +139 -0
  1950. data/ext/libuv/test/test-emfile.c +121 -0
  1951. data/ext/libuv/test/test-env-vars.c +140 -0
  1952. data/ext/libuv/test/test-error.c +79 -0
  1953. data/ext/libuv/test/test-fail-always.c +29 -0
  1954. data/ext/libuv/test/test-fork.c +683 -0
  1955. data/ext/libuv/test/test-fs-copyfile.c +209 -0
  1956. data/ext/libuv/test/test-fs-event.c +1165 -0
  1957. data/ext/libuv/test/test-fs-fd-hash.c +133 -0
  1958. data/ext/libuv/test/test-fs-open-flags.c +435 -0
  1959. data/ext/libuv/test/test-fs-poll.c +300 -0
  1960. data/ext/libuv/test/test-fs-readdir.c +462 -0
  1961. data/ext/libuv/test/test-fs.c +4238 -0
  1962. data/ext/libuv/test/test-get-currentexe.c +86 -0
  1963. data/ext/libuv/test/test-get-loadavg.c +35 -0
  1964. data/ext/libuv/test/test-get-memory.c +40 -0
  1965. data/ext/libuv/test/test-get-passwd.c +86 -0
  1966. data/ext/libuv/test/test-getaddrinfo.c +191 -0
  1967. data/ext/libuv/test/test-gethostname.c +58 -0
  1968. data/ext/libuv/test/test-getnameinfo.c +101 -0
  1969. data/ext/libuv/test/test-getsockname.c +361 -0
  1970. data/ext/libuv/test/test-getters-setters.c +88 -0
  1971. data/ext/libuv/test/test-gettimeofday.c +39 -0
  1972. data/ext/libuv/test/test-handle-fileno.c +125 -0
  1973. data/ext/libuv/test/test-homedir.c +72 -0
  1974. data/ext/libuv/test/test-hrtime.c +52 -0
  1975. data/ext/libuv/test/test-idle.c +99 -0
  1976. data/ext/libuv/test/test-idna.c +195 -0
  1977. data/ext/libuv/test/test-ip4-addr.c +55 -0
  1978. data/ext/libuv/test/test-ip6-addr.c +171 -0
  1979. data/ext/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
  1980. data/ext/libuv/test/test-ipc-send-recv.c +429 -0
  1981. data/ext/libuv/test/test-ipc.c +974 -0
  1982. data/ext/libuv/test/test-list.h +1064 -0
  1983. data/ext/libuv/test/test-loop-alive.c +67 -0
  1984. data/ext/libuv/test/test-loop-close.c +75 -0
  1985. data/ext/libuv/test/test-loop-configure.c +38 -0
  1986. data/ext/libuv/test/test-loop-handles.c +337 -0
  1987. data/ext/libuv/test/test-loop-stop.c +71 -0
  1988. data/ext/libuv/test/test-loop-time.c +63 -0
  1989. data/ext/libuv/test/test-multiple-listen.c +109 -0
  1990. data/ext/libuv/test/test-mutexes.c +182 -0
  1991. data/ext/libuv/test/test-osx-select.c +140 -0
  1992. data/ext/libuv/test/test-pass-always.c +28 -0
  1993. data/ext/libuv/test/test-ping-pong.c +301 -0
  1994. data/ext/libuv/test/test-pipe-bind-error.c +139 -0
  1995. data/ext/libuv/test/test-pipe-close-stdout-read-stdin.c +112 -0
  1996. data/ext/libuv/test/test-pipe-connect-error.c +95 -0
  1997. data/ext/libuv/test/test-pipe-connect-multiple.c +107 -0
  1998. data/ext/libuv/test/test-pipe-connect-prepare.c +83 -0
  1999. data/ext/libuv/test/test-pipe-getsockname.c +266 -0
  2000. data/ext/libuv/test/test-pipe-pending-instances.c +59 -0
  2001. data/ext/libuv/test/test-pipe-sendmsg.c +172 -0
  2002. data/ext/libuv/test/test-pipe-server-close.c +94 -0
  2003. data/ext/libuv/test/test-pipe-set-fchmod.c +90 -0
  2004. data/ext/libuv/test/test-pipe-set-non-blocking.c +99 -0
  2005. data/ext/libuv/test/test-platform-output.c +170 -0
  2006. data/ext/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
  2007. data/ext/libuv/test/test-poll-close.c +73 -0
  2008. data/ext/libuv/test/test-poll-closesocket.c +92 -0
  2009. data/ext/libuv/test/test-poll-oob.c +210 -0
  2010. data/ext/libuv/test/test-poll.c +668 -0
  2011. data/ext/libuv/test/test-process-priority.c +83 -0
  2012. data/ext/libuv/test/test-process-title-threadsafe.c +89 -0
  2013. data/ext/libuv/test/test-process-title.c +76 -0
  2014. data/ext/libuv/test/test-queue-foreach-delete.c +204 -0
  2015. data/ext/libuv/test/test-random.c +94 -0
  2016. data/ext/libuv/test/test-ref.c +445 -0
  2017. data/ext/libuv/test/test-run-nowait.c +45 -0
  2018. data/ext/libuv/test/test-run-once.c +48 -0
  2019. data/ext/libuv/test/test-semaphore.c +111 -0
  2020. data/ext/libuv/test/test-shutdown-close.c +108 -0
  2021. data/ext/libuv/test/test-shutdown-eof.c +182 -0
  2022. data/ext/libuv/test/test-shutdown-twice.c +85 -0
  2023. data/ext/libuv/test/test-signal-multiple-loops.c +302 -0
  2024. data/ext/libuv/test/test-signal-pending-on-close.c +94 -0
  2025. data/ext/libuv/test/test-signal.c +325 -0
  2026. data/ext/libuv/test/test-socket-buffer-size.c +77 -0
  2027. data/ext/libuv/test/test-spawn.c +1924 -0
  2028. data/ext/libuv/test/test-stdio-over-pipes.c +256 -0
  2029. data/ext/libuv/test/test-strscpy.c +53 -0
  2030. data/ext/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
  2031. data/ext/libuv/test/test-tcp-bind-error.c +254 -0
  2032. data/ext/libuv/test/test-tcp-bind6-error.c +176 -0
  2033. data/ext/libuv/test/test-tcp-close-accept.c +198 -0
  2034. data/ext/libuv/test/test-tcp-close-reset.c +290 -0
  2035. data/ext/libuv/test/test-tcp-close-while-connecting.c +97 -0
  2036. data/ext/libuv/test/test-tcp-close.c +136 -0
  2037. data/ext/libuv/test/test-tcp-connect-error-after-write.c +98 -0
  2038. data/ext/libuv/test/test-tcp-connect-error.c +73 -0
  2039. data/ext/libuv/test/test-tcp-connect-timeout.c +91 -0
  2040. data/ext/libuv/test/test-tcp-connect6-error.c +71 -0
  2041. data/ext/libuv/test/test-tcp-create-socket-early.c +209 -0
  2042. data/ext/libuv/test/test-tcp-flags.c +52 -0
  2043. data/ext/libuv/test/test-tcp-oob.c +146 -0
  2044. data/ext/libuv/test/test-tcp-open.c +400 -0
  2045. data/ext/libuv/test/test-tcp-read-stop.c +76 -0
  2046. data/ext/libuv/test/test-tcp-shutdown-after-write.c +138 -0
  2047. data/ext/libuv/test/test-tcp-try-write-error.c +109 -0
  2048. data/ext/libuv/test/test-tcp-try-write.c +135 -0
  2049. data/ext/libuv/test/test-tcp-unexpected-read.c +117 -0
  2050. data/ext/libuv/test/test-tcp-write-after-connect.c +72 -0
  2051. data/ext/libuv/test/test-tcp-write-fail.c +115 -0
  2052. data/ext/libuv/test/test-tcp-write-queue-order.c +139 -0
  2053. data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
  2054. data/ext/libuv/test/test-tcp-writealot.c +180 -0
  2055. data/ext/libuv/test/test-thread-equal.c +45 -0
  2056. data/ext/libuv/test/test-thread.c +286 -0
  2057. data/ext/libuv/test/test-threadpool-cancel.c +349 -0
  2058. data/ext/libuv/test/test-threadpool.c +76 -0
  2059. data/ext/libuv/test/test-timer-again.c +141 -0
  2060. data/ext/libuv/test/test-timer-from-check.c +80 -0
  2061. data/ext/libuv/test/test-timer.c +343 -0
  2062. data/ext/libuv/test/test-tmpdir.c +82 -0
  2063. data/ext/libuv/test/test-tty-duplicate-key.c +321 -0
  2064. data/ext/libuv/test/test-tty.c +464 -0
  2065. data/ext/libuv/test/test-udp-alloc-cb-fail.c +196 -0
  2066. data/ext/libuv/test/test-udp-bind.c +93 -0
  2067. data/ext/libuv/test/test-udp-connect.c +182 -0
  2068. data/ext/libuv/test/test-udp-create-socket-early.c +135 -0
  2069. data/ext/libuv/test/test-udp-dgram-too-big.c +91 -0
  2070. data/ext/libuv/test/test-udp-ipv6.c +200 -0
  2071. data/ext/libuv/test/test-udp-multicast-interface.c +99 -0
  2072. data/ext/libuv/test/test-udp-multicast-interface6.c +103 -0
  2073. data/ext/libuv/test/test-udp-multicast-join.c +181 -0
  2074. data/ext/libuv/test/test-udp-multicast-join6.c +215 -0
  2075. data/ext/libuv/test/test-udp-multicast-ttl.c +94 -0
  2076. data/ext/libuv/test/test-udp-open.c +350 -0
  2077. data/ext/libuv/test/test-udp-options.c +156 -0
  2078. data/ext/libuv/test/test-udp-send-and-recv.c +212 -0
  2079. data/ext/libuv/test/test-udp-send-hang-loop.c +99 -0
  2080. data/ext/libuv/test/test-udp-send-immediate.c +148 -0
  2081. data/ext/libuv/test/test-udp-send-unreachable.c +150 -0
  2082. data/ext/libuv/test/test-udp-try-send.c +121 -0
  2083. data/ext/libuv/test/test-uname.c +69 -0
  2084. data/ext/libuv/test/test-walk-handles.c +77 -0
  2085. data/ext/libuv/test/test-watcher-cross-stop.c +111 -0
  2086. data/ext/libuv/test/test.gyp +293 -0
  2087. data/ext/libuv/tools/make_dist_html.py +124 -0
  2088. data/ext/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
  2089. data/ext/libuv/uv.gyp +368 -0
  2090. data/ext/libuv/vcbuild.bat +184 -0
  2091. data/lib/mt-libuv/tcp.rb +2 -2
  2092. data/lib/mt-libuv/version.rb +1 -1
  2093. data/mt-libuv.gemspec +26 -26
  2094. metadata +2089 -2
@@ -0,0 +1,2500 @@
1
+ # Copyright (c) 2013 Google Inc. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ from __future__ import print_function
6
+
7
+ import collections
8
+ import copy
9
+ import hashlib
10
+ import json
11
+ import multiprocessing
12
+ import os.path
13
+ import re
14
+ import signal
15
+ import subprocess
16
+ import sys
17
+ import gyp
18
+ import gyp.common
19
+ from gyp.common import OrderedSet
20
+ import gyp.msvs_emulation
21
+ import gyp.MSVSUtil as MSVSUtil
22
+ import gyp.xcode_emulation
23
+ try:
24
+ from cStringIO import StringIO
25
+ except ImportError:
26
+ from io import StringIO
27
+
28
+ from gyp.common import GetEnvironFallback
29
+ import gyp.ninja_syntax as ninja_syntax
30
+
31
+ generator_default_variables = {
32
+ 'EXECUTABLE_PREFIX': '',
33
+ 'EXECUTABLE_SUFFIX': '',
34
+ 'STATIC_LIB_PREFIX': 'lib',
35
+ 'STATIC_LIB_SUFFIX': '.a',
36
+ 'SHARED_LIB_PREFIX': 'lib',
37
+
38
+ # Gyp expects the following variables to be expandable by the build
39
+ # system to the appropriate locations. Ninja prefers paths to be
40
+ # known at gyp time. To resolve this, introduce special
41
+ # variables starting with $! and $| (which begin with a $ so gyp knows it
42
+ # should be treated specially, but is otherwise an invalid
43
+ # ninja/shell variable) that are passed to gyp here but expanded
44
+ # before writing out into the target .ninja files; see
45
+ # ExpandSpecial.
46
+ # $! is used for variables that represent a path and that can only appear at
47
+ # the start of a string, while $| is used for variables that can appear
48
+ # anywhere in a string.
49
+ 'INTERMEDIATE_DIR': '$!INTERMEDIATE_DIR',
50
+ 'SHARED_INTERMEDIATE_DIR': '$!PRODUCT_DIR/gen',
51
+ 'PRODUCT_DIR': '$!PRODUCT_DIR',
52
+ 'CONFIGURATION_NAME': '$|CONFIGURATION_NAME',
53
+
54
+ # Special variables that may be used by gyp 'rule' targets.
55
+ # We generate definitions for these variables on the fly when processing a
56
+ # rule.
57
+ 'RULE_INPUT_ROOT': '${root}',
58
+ 'RULE_INPUT_DIRNAME': '${dirname}',
59
+ 'RULE_INPUT_PATH': '${source}',
60
+ 'RULE_INPUT_EXT': '${ext}',
61
+ 'RULE_INPUT_NAME': '${name}',
62
+ }
63
+
64
+ # Placates pylint.
65
+ generator_additional_non_configuration_keys = []
66
+ generator_additional_path_sections = []
67
+ generator_extra_sources_for_rules = []
68
+ generator_filelist_paths = None
69
+
70
+ generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()
71
+
72
+ def StripPrefix(arg, prefix):
73
+ if arg.startswith(prefix):
74
+ return arg[len(prefix):]
75
+ return arg
76
+
77
+
78
+ def QuoteShellArgument(arg, flavor):
79
+ """Quote a string such that it will be interpreted as a single argument
80
+ by the shell."""
81
+ # Rather than attempting to enumerate the bad shell characters, just
82
+ # whitelist common OK ones and quote anything else.
83
+ if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):
84
+ return arg # No quoting necessary.
85
+ if flavor == 'win':
86
+ return gyp.msvs_emulation.QuoteForRspFile(arg)
87
+ return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'"
88
+
89
+
90
+ def Define(d, flavor):
91
+ """Takes a preprocessor define and returns a -D parameter that's ninja- and
92
+ shell-escaped."""
93
+ if flavor == 'win':
94
+ # cl.exe replaces literal # characters with = in preprocesor definitions for
95
+ # some reason. Octal-encode to work around that.
96
+ d = d.replace('#', '\\%03o' % ord('#'))
97
+ return QuoteShellArgument(ninja_syntax.escape('-D' + d), flavor)
98
+
99
+
100
+ def AddArch(output, arch):
101
+ """Adds an arch string to an output path."""
102
+ output, extension = os.path.splitext(output)
103
+ return '%s.%s%s' % (output, arch, extension)
104
+
105
+
106
+ class Target(object):
107
+ """Target represents the paths used within a single gyp target.
108
+
109
+ Conceptually, building a single target A is a series of steps:
110
+
111
+ 1) actions/rules/copies generates source/resources/etc.
112
+ 2) compiles generates .o files
113
+ 3) link generates a binary (library/executable)
114
+ 4) bundle merges the above in a mac bundle
115
+
116
+ (Any of these steps can be optional.)
117
+
118
+ From a build ordering perspective, a dependent target B could just
119
+ depend on the last output of this series of steps.
120
+
121
+ But some dependent commands sometimes need to reach inside the box.
122
+ For example, when linking B it needs to get the path to the static
123
+ library generated by A.
124
+
125
+ This object stores those paths. To keep things simple, member
126
+ variables only store concrete paths to single files, while methods
127
+ compute derived values like "the last output of the target".
128
+ """
129
+ def __init__(self, type):
130
+ # Gyp type ("static_library", etc.) of this target.
131
+ self.type = type
132
+ # File representing whether any input dependencies necessary for
133
+ # dependent actions have completed.
134
+ self.preaction_stamp = None
135
+ # File representing whether any input dependencies necessary for
136
+ # dependent compiles have completed.
137
+ self.precompile_stamp = None
138
+ # File representing the completion of actions/rules/copies, if any.
139
+ self.actions_stamp = None
140
+ # Path to the output of the link step, if any.
141
+ self.binary = None
142
+ # Path to the file representing the completion of building the bundle,
143
+ # if any.
144
+ self.bundle = None
145
+ # On Windows, incremental linking requires linking against all the .objs
146
+ # that compose a .lib (rather than the .lib itself). That list is stored
147
+ # here. In this case, we also need to save the compile_deps for the target,
148
+ # so that the the target that directly depends on the .objs can also depend
149
+ # on those.
150
+ self.component_objs = None
151
+ self.compile_deps = None
152
+ # Windows only. The import .lib is the output of a build step, but
153
+ # because dependents only link against the lib (not both the lib and the
154
+ # dll) we keep track of the import library here.
155
+ self.import_lib = None
156
+ # Track if this target contains any C++ files, to decide if gcc or g++
157
+ # should be used for linking.
158
+ self.uses_cpp = False
159
+
160
+ def Linkable(self):
161
+ """Return true if this is a target that can be linked against."""
162
+ return self.type in ('static_library', 'shared_library')
163
+
164
+ def UsesToc(self, flavor):
165
+ """Return true if the target should produce a restat rule based on a TOC
166
+ file."""
167
+ # For bundles, the .TOC should be produced for the binary, not for
168
+ # FinalOutput(). But the naive approach would put the TOC file into the
169
+ # bundle, so don't do this for bundles for now.
170
+ if flavor == 'win' or self.bundle:
171
+ return False
172
+ return self.type in ('shared_library', 'loadable_module')
173
+
174
+ def PreActionInput(self, flavor):
175
+ """Return the path, if any, that should be used as a dependency of
176
+ any dependent action step."""
177
+ if self.UsesToc(flavor):
178
+ return self.FinalOutput() + '.TOC'
179
+ return self.FinalOutput() or self.preaction_stamp
180
+
181
+ def PreCompileInput(self):
182
+ """Return the path, if any, that should be used as a dependency of
183
+ any dependent compile step."""
184
+ return self.actions_stamp or self.precompile_stamp
185
+
186
+ def FinalOutput(self):
187
+ """Return the last output of the target, which depends on all prior
188
+ steps."""
189
+ return self.bundle or self.binary or self.actions_stamp
190
+
191
+
192
+ # A small discourse on paths as used within the Ninja build:
193
+ # All files we produce (both at gyp and at build time) appear in the
194
+ # build directory (e.g. out/Debug).
195
+ #
196
+ # Paths within a given .gyp file are always relative to the directory
197
+ # containing the .gyp file. Call these "gyp paths". This includes
198
+ # sources as well as the starting directory a given gyp rule/action
199
+ # expects to be run from. We call the path from the source root to
200
+ # the gyp file the "base directory" within the per-.gyp-file
201
+ # NinjaWriter code.
202
+ #
203
+ # All paths as written into the .ninja files are relative to the build
204
+ # directory. Call these paths "ninja paths".
205
+ #
206
+ # We translate between these two notions of paths with two helper
207
+ # functions:
208
+ #
209
+ # - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file)
210
+ # into the equivalent ninja path.
211
+ #
212
+ # - GypPathToUniqueOutput translates a gyp path into a ninja path to write
213
+ # an output file; the result can be namespaced such that it is unique
214
+ # to the input file name as well as the output target name.
215
+
216
+ class NinjaWriter(object):
217
+ def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir,
218
+ output_file, toplevel_build, output_file_name, flavor,
219
+ toplevel_dir=None):
220
+ """
221
+ base_dir: path from source root to directory containing this gyp file,
222
+ by gyp semantics, all input paths are relative to this
223
+ build_dir: path from source root to build output
224
+ toplevel_dir: path to the toplevel directory
225
+ """
226
+
227
+ self.hash_for_rules = hash_for_rules
228
+ self.target_outputs = target_outputs
229
+ self.base_dir = base_dir
230
+ self.build_dir = build_dir
231
+ self.ninja = ninja_syntax.Writer(output_file)
232
+ self.toplevel_build = toplevel_build
233
+ self.output_file_name = output_file_name
234
+
235
+ self.flavor = flavor
236
+ self.abs_build_dir = None
237
+ if toplevel_dir is not None:
238
+ self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir,
239
+ build_dir))
240
+ self.obj_ext = '.obj' if flavor == 'win' else '.o'
241
+ if flavor == 'win':
242
+ # See docstring of msvs_emulation.GenerateEnvironmentFiles().
243
+ self.win_env = {}
244
+ for arch in ('x86', 'x64'):
245
+ self.win_env[arch] = 'environment.' + arch
246
+
247
+ # Relative path from build output dir to base dir.
248
+ build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir)
249
+ self.build_to_base = os.path.join(build_to_top, base_dir)
250
+ # Relative path from base dir to build dir.
251
+ base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir)
252
+ self.base_to_build = os.path.join(base_to_top, build_dir)
253
+
254
+ def ExpandSpecial(self, path, product_dir=None):
255
+ """Expand specials like $!PRODUCT_DIR in |path|.
256
+
257
+ If |product_dir| is None, assumes the cwd is already the product
258
+ dir. Otherwise, |product_dir| is the relative path to the product
259
+ dir.
260
+ """
261
+
262
+ PRODUCT_DIR = '$!PRODUCT_DIR'
263
+ if PRODUCT_DIR in path:
264
+ if product_dir:
265
+ path = path.replace(PRODUCT_DIR, product_dir)
266
+ else:
267
+ path = path.replace(PRODUCT_DIR + '/', '')
268
+ path = path.replace(PRODUCT_DIR + '\\', '')
269
+ path = path.replace(PRODUCT_DIR, '.')
270
+
271
+ INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR'
272
+ if INTERMEDIATE_DIR in path:
273
+ int_dir = self.GypPathToUniqueOutput('gen')
274
+ # GypPathToUniqueOutput generates a path relative to the product dir,
275
+ # so insert product_dir in front if it is provided.
276
+ path = path.replace(INTERMEDIATE_DIR,
277
+ os.path.join(product_dir or '', int_dir))
278
+
279
+ CONFIGURATION_NAME = '$|CONFIGURATION_NAME'
280
+ path = path.replace(CONFIGURATION_NAME, self.config_name)
281
+
282
+ return path
283
+
284
+ def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
285
+ if self.flavor == 'win':
286
+ path = self.msvs_settings.ConvertVSMacros(
287
+ path, config=self.config_name)
288
+ path = path.replace(generator_default_variables['RULE_INPUT_ROOT'], root)
289
+ path = path.replace(generator_default_variables['RULE_INPUT_DIRNAME'],
290
+ dirname)
291
+ path = path.replace(generator_default_variables['RULE_INPUT_PATH'], source)
292
+ path = path.replace(generator_default_variables['RULE_INPUT_EXT'], ext)
293
+ path = path.replace(generator_default_variables['RULE_INPUT_NAME'], name)
294
+ return path
295
+
296
+ def GypPathToNinja(self, path, env=None):
297
+ """Translate a gyp path to a ninja path, optionally expanding environment
298
+ variable references in |path| with |env|.
299
+
300
+ See the above discourse on path conversions."""
301
+ if env:
302
+ if self.flavor == 'mac':
303
+ path = gyp.xcode_emulation.ExpandEnvVars(path, env)
304
+ elif self.flavor == 'win':
305
+ path = gyp.msvs_emulation.ExpandMacros(path, env)
306
+ if path.startswith('$!'):
307
+ expanded = self.ExpandSpecial(path)
308
+ if self.flavor == 'win':
309
+ expanded = os.path.normpath(expanded)
310
+ return expanded
311
+ if '$|' in path:
312
+ path = self.ExpandSpecial(path)
313
+ assert '$' not in path, path
314
+ return os.path.normpath(os.path.join(self.build_to_base, path))
315
+
316
+ def GypPathToUniqueOutput(self, path, qualified=True):
317
+ """Translate a gyp path to a ninja path for writing output.
318
+
319
+ If qualified is True, qualify the resulting filename with the name
320
+ of the target. This is necessary when e.g. compiling the same
321
+ path twice for two separate output targets.
322
+
323
+ See the above discourse on path conversions."""
324
+
325
+ path = self.ExpandSpecial(path)
326
+ assert not path.startswith('$'), path
327
+
328
+ # Translate the path following this scheme:
329
+ # Input: foo/bar.gyp, target targ, references baz/out.o
330
+ # Output: obj/foo/baz/targ.out.o (if qualified)
331
+ # obj/foo/baz/out.o (otherwise)
332
+ # (and obj.host instead of obj for cross-compiles)
333
+ #
334
+ # Why this scheme and not some other one?
335
+ # 1) for a given input, you can compute all derived outputs by matching
336
+ # its path, even if the input is brought via a gyp file with '..'.
337
+ # 2) simple files like libraries and stamps have a simple filename.
338
+
339
+ obj = 'obj'
340
+ if self.toolset != 'target':
341
+ obj += '.' + self.toolset
342
+
343
+ path_dir, path_basename = os.path.split(path)
344
+ assert not os.path.isabs(path_dir), (
345
+ "'%s' can not be absolute path (see crbug.com/462153)." % path_dir)
346
+
347
+ if qualified:
348
+ path_basename = self.name + '.' + path_basename
349
+ return os.path.normpath(os.path.join(obj, self.base_dir, path_dir,
350
+ path_basename))
351
+
352
+ def WriteCollapsedDependencies(self, name, targets, order_only=None):
353
+ """Given a list of targets, return a path for a single file
354
+ representing the result of building all the targets or None.
355
+
356
+ Uses a stamp file if necessary."""
357
+
358
+ assert targets == [t for t in targets if t], targets
359
+ if len(targets) == 0:
360
+ assert not order_only
361
+ return None
362
+ if len(targets) > 1 or order_only:
363
+ stamp = self.GypPathToUniqueOutput(name + '.stamp')
364
+ targets = self.ninja.build(stamp, 'stamp', targets, order_only=order_only)
365
+ self.ninja.newline()
366
+ return targets[0]
367
+
368
+ def _SubninjaNameForArch(self, arch):
369
+ output_file_base = os.path.splitext(self.output_file_name)[0]
370
+ return '%s.%s.ninja' % (output_file_base, arch)
371
+
372
+ def WriteSpec(self, spec, config_name, generator_flags):
373
+ """The main entry point for NinjaWriter: write the build rules for a spec.
374
+
375
+ Returns a Target object, which represents the output paths for this spec.
376
+ Returns None if there are no outputs (e.g. a settings-only 'none' type
377
+ target)."""
378
+
379
+ self.config_name = config_name
380
+ self.name = spec['target_name']
381
+ self.toolset = spec['toolset']
382
+ config = spec['configurations'][config_name]
383
+ self.target = Target(spec['type'])
384
+ self.is_standalone_static_library = bool(
385
+ spec.get('standalone_static_library', 0))
386
+
387
+ self.target_rpath = generator_flags.get('target_rpath', r'\$$ORIGIN/lib/')
388
+
389
+ self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec)
390
+ self.xcode_settings = self.msvs_settings = None
391
+ if self.flavor == 'mac':
392
+ self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec)
393
+ mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None)
394
+ if mac_toolchain_dir:
395
+ self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir
396
+
397
+ if self.flavor == 'win':
398
+ self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec,
399
+ generator_flags)
400
+ arch = self.msvs_settings.GetArch(config_name)
401
+ self.ninja.variable('arch', self.win_env[arch])
402
+ self.ninja.variable('cc', '$cl_' + arch)
403
+ self.ninja.variable('cxx', '$cl_' + arch)
404
+ self.ninja.variable('cc_host', '$cl_' + arch)
405
+ self.ninja.variable('cxx_host', '$cl_' + arch)
406
+ self.ninja.variable('asm', '$ml_' + arch)
407
+
408
+ if self.flavor == 'mac':
409
+ self.archs = self.xcode_settings.GetActiveArchs(config_name)
410
+ if len(self.archs) > 1:
411
+ self.arch_subninjas = dict(
412
+ (arch, ninja_syntax.Writer(
413
+ OpenOutput(os.path.join(self.toplevel_build,
414
+ self._SubninjaNameForArch(arch)),
415
+ 'w')))
416
+ for arch in self.archs)
417
+
418
+ # Compute predepends for all rules.
419
+ # actions_depends is the dependencies this target depends on before running
420
+ # any of its action/rule/copy steps.
421
+ # compile_depends is the dependencies this target depends on before running
422
+ # any of its compile steps.
423
+ actions_depends = []
424
+ compile_depends = []
425
+ # TODO(evan): it is rather confusing which things are lists and which
426
+ # are strings. Fix these.
427
+ if 'dependencies' in spec:
428
+ for dep in spec['dependencies']:
429
+ if dep in self.target_outputs:
430
+ target = self.target_outputs[dep]
431
+ actions_depends.append(target.PreActionInput(self.flavor))
432
+ compile_depends.append(target.PreCompileInput())
433
+ if target.uses_cpp:
434
+ self.target.uses_cpp = True
435
+ actions_depends = [d for d in actions_depends if d]
436
+ compile_depends = [d for d in compile_depends if d]
437
+ actions_depends = self.WriteCollapsedDependencies('actions_depends',
438
+ actions_depends)
439
+ compile_depends = self.WriteCollapsedDependencies('compile_depends',
440
+ compile_depends)
441
+ self.target.preaction_stamp = actions_depends
442
+ self.target.precompile_stamp = compile_depends
443
+
444
+ # Write out actions, rules, and copies. These must happen before we
445
+ # compile any sources, so compute a list of predependencies for sources
446
+ # while we do it.
447
+ extra_sources = []
448
+ mac_bundle_depends = []
449
+ self.target.actions_stamp = self.WriteActionsRulesCopies(
450
+ spec, extra_sources, actions_depends, mac_bundle_depends)
451
+
452
+ # If we have actions/rules/copies, we depend directly on those, but
453
+ # otherwise we depend on dependent target's actions/rules/copies etc.
454
+ # We never need to explicitly depend on previous target's link steps,
455
+ # because no compile ever depends on them.
456
+ compile_depends_stamp = (self.target.actions_stamp or compile_depends)
457
+
458
+ # Write out the compilation steps, if any.
459
+ link_deps = []
460
+ try:
461
+ sources = extra_sources + spec.get('sources', [])
462
+ except TypeError:
463
+ print('extra_sources: ', str(extra_sources))
464
+ print('spec.get("sources"): ', str(spec.get('sources')))
465
+ raise
466
+ if sources:
467
+ if self.flavor == 'mac' and len(self.archs) > 1:
468
+ # Write subninja file containing compile and link commands scoped to
469
+ # a single arch if a fat binary is being built.
470
+ for arch in self.archs:
471
+ self.ninja.subninja(self._SubninjaNameForArch(arch))
472
+
473
+ pch = None
474
+ if self.flavor == 'win':
475
+ gyp.msvs_emulation.VerifyMissingSources(
476
+ sources, self.abs_build_dir, generator_flags, self.GypPathToNinja)
477
+ pch = gyp.msvs_emulation.PrecompiledHeader(
478
+ self.msvs_settings, config_name, self.GypPathToNinja,
479
+ self.GypPathToUniqueOutput, self.obj_ext)
480
+ else:
481
+ pch = gyp.xcode_emulation.MacPrefixHeader(
482
+ self.xcode_settings, self.GypPathToNinja,
483
+ lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang))
484
+ link_deps = self.WriteSources(
485
+ self.ninja, config_name, config, sources, compile_depends_stamp, pch,
486
+ spec)
487
+ # Some actions/rules output 'sources' that are already object files.
488
+ obj_outputs = [f for f in sources if f.endswith(self.obj_ext)]
489
+ if obj_outputs:
490
+ if self.flavor != 'mac' or len(self.archs) == 1:
491
+ link_deps += [self.GypPathToNinja(o) for o in obj_outputs]
492
+ else:
493
+ print("Warning: Actions/rules writing object files don't work with " \
494
+ "multiarch targets, dropping. (target %s)" %
495
+ spec['target_name'])
496
+ elif self.flavor == 'mac' and len(self.archs) > 1:
497
+ link_deps = collections.defaultdict(list)
498
+
499
+ compile_deps = self.target.actions_stamp or actions_depends
500
+ if self.flavor == 'win' and self.target.type == 'static_library':
501
+ self.target.component_objs = link_deps
502
+ self.target.compile_deps = compile_deps
503
+
504
+ # Write out a link step, if needed.
505
+ output = None
506
+ is_empty_bundle = not link_deps and not mac_bundle_depends
507
+ if link_deps or self.target.actions_stamp or actions_depends:
508
+ output = self.WriteTarget(spec, config_name, config, link_deps,
509
+ compile_deps)
510
+ if self.is_mac_bundle:
511
+ mac_bundle_depends.append(output)
512
+
513
+ # Bundle all of the above together, if needed.
514
+ if self.is_mac_bundle:
515
+ output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle)
516
+
517
+ if not output:
518
+ return None
519
+
520
+ assert self.target.FinalOutput(), output
521
+ return self.target
522
+
523
+ def _WinIdlRule(self, source, prebuild, outputs):
524
+ """Handle the implicit VS .idl rule for one source file. Fills |outputs|
525
+ with files that are generated."""
526
+ outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData(
527
+ source, self.config_name)
528
+ outdir = self.GypPathToNinja(outdir)
529
+ def fix_path(path, rel=None):
530
+ path = os.path.join(outdir, path)
531
+ dirname, basename = os.path.split(source)
532
+ root, ext = os.path.splitext(basename)
533
+ path = self.ExpandRuleVariables(
534
+ path, root, dirname, source, ext, basename)
535
+ if rel:
536
+ path = os.path.relpath(path, rel)
537
+ return path
538
+ vars = [(name, fix_path(value, outdir)) for name, value in vars]
539
+ output = [fix_path(p) for p in output]
540
+ vars.append(('outdir', outdir))
541
+ vars.append(('idlflags', flags))
542
+ input = self.GypPathToNinja(source)
543
+ self.ninja.build(output, 'idl', input,
544
+ variables=vars, order_only=prebuild)
545
+ outputs.extend(output)
546
+
547
+ def WriteWinIdlFiles(self, spec, prebuild):
548
+ """Writes rules to match MSVS's implicit idl handling."""
549
+ assert self.flavor == 'win'
550
+ if self.msvs_settings.HasExplicitIdlRulesOrActions(spec):
551
+ return []
552
+ outputs = []
553
+ for source in filter(lambda x: x.endswith('.idl'), spec['sources']):
554
+ self._WinIdlRule(source, prebuild, outputs)
555
+ return outputs
556
+
557
+ def WriteActionsRulesCopies(self, spec, extra_sources, prebuild,
558
+ mac_bundle_depends):
559
+ """Write out the Actions, Rules, and Copies steps. Return a path
560
+ representing the outputs of these steps."""
561
+ outputs = []
562
+ if self.is_mac_bundle:
563
+ mac_bundle_resources = spec.get('mac_bundle_resources', [])[:]
564
+ else:
565
+ mac_bundle_resources = []
566
+ extra_mac_bundle_resources = []
567
+
568
+ if 'actions' in spec:
569
+ outputs += self.WriteActions(spec['actions'], extra_sources, prebuild,
570
+ extra_mac_bundle_resources)
571
+ if 'rules' in spec:
572
+ outputs += self.WriteRules(spec['rules'], extra_sources, prebuild,
573
+ mac_bundle_resources,
574
+ extra_mac_bundle_resources)
575
+ if 'copies' in spec:
576
+ outputs += self.WriteCopies(spec['copies'], prebuild, mac_bundle_depends)
577
+
578
+ if 'sources' in spec and self.flavor == 'win':
579
+ outputs += self.WriteWinIdlFiles(spec, prebuild)
580
+
581
+ if self.xcode_settings and self.xcode_settings.IsIosFramework():
582
+ self.WriteiOSFrameworkHeaders(spec, outputs, prebuild)
583
+
584
+ stamp = self.WriteCollapsedDependencies('actions_rules_copies', outputs)
585
+
586
+ if self.is_mac_bundle:
587
+ xcassets = self.WriteMacBundleResources(
588
+ extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends)
589
+ partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends)
590
+ self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends)
591
+
592
+ return stamp
593
+
594
+ def GenerateDescription(self, verb, message, fallback):
595
+ """Generate and return a description of a build step.
596
+
597
+ |verb| is the short summary, e.g. ACTION or RULE.
598
+ |message| is a hand-written description, or None if not available.
599
+ |fallback| is the gyp-level name of the step, usable as a fallback.
600
+ """
601
+ if self.toolset != 'target':
602
+ verb += '(%s)' % self.toolset
603
+ if message:
604
+ return '%s %s' % (verb, self.ExpandSpecial(message))
605
+ else:
606
+ return '%s %s: %s' % (verb, self.name, fallback)
607
+
608
+ def WriteActions(self, actions, extra_sources, prebuild,
609
+ extra_mac_bundle_resources):
610
+ # Actions cd into the base directory.
611
+ env = self.GetToolchainEnv()
612
+ all_outputs = []
613
+ for action in actions:
614
+ # First write out a rule for the action.
615
+ name = '%s_%s' % (action['action_name'], self.hash_for_rules)
616
+ description = self.GenerateDescription('ACTION',
617
+ action.get('message', None),
618
+ name)
619
+ is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action)
620
+ if self.flavor == 'win' else False)
621
+ args = action['action']
622
+ depfile = action.get('depfile', None)
623
+ if depfile:
624
+ depfile = self.ExpandSpecial(depfile)
625
+ pool = 'console' if int(action.get('ninja_use_console', 0)) else None
626
+ rule_name, _ = self.WriteNewNinjaRule(name, args, description,
627
+ is_cygwin, env, pool,
628
+ depfile=depfile)
629
+
630
+ inputs = [self.GypPathToNinja(i, env) for i in action['inputs']]
631
+ if int(action.get('process_outputs_as_sources', False)):
632
+ extra_sources += action['outputs']
633
+ if int(action.get('process_outputs_as_mac_bundle_resources', False)):
634
+ extra_mac_bundle_resources += action['outputs']
635
+ outputs = [self.GypPathToNinja(o, env) for o in action['outputs']]
636
+
637
+ # Then write out an edge using the rule.
638
+ self.ninja.build(outputs, rule_name, inputs,
639
+ order_only=prebuild)
640
+ all_outputs += outputs
641
+
642
+ self.ninja.newline()
643
+
644
+ return all_outputs
645
+
646
+ def WriteRules(self, rules, extra_sources, prebuild,
647
+ mac_bundle_resources, extra_mac_bundle_resources):
648
+ env = self.GetToolchainEnv()
649
+ all_outputs = []
650
+ for rule in rules:
651
+ # Skip a rule with no action and no inputs.
652
+ if 'action' not in rule and not rule.get('rule_sources', []):
653
+ continue
654
+
655
+ # First write out a rule for the rule action.
656
+ name = '%s_%s' % (rule['rule_name'], self.hash_for_rules)
657
+
658
+ args = rule['action']
659
+ description = self.GenerateDescription(
660
+ 'RULE',
661
+ rule.get('message', None),
662
+ ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name)
663
+ is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule)
664
+ if self.flavor == 'win' else False)
665
+ pool = 'console' if int(rule.get('ninja_use_console', 0)) else None
666
+ rule_name, args = self.WriteNewNinjaRule(
667
+ name, args, description, is_cygwin, env, pool)
668
+
669
+ # TODO: if the command references the outputs directly, we should
670
+ # simplify it to just use $out.
671
+
672
+ # Rules can potentially make use of some special variables which
673
+ # must vary per source file.
674
+ # Compute the list of variables we'll need to provide.
675
+ special_locals = ('source', 'root', 'dirname', 'ext', 'name')
676
+ needed_variables = set(['source'])
677
+ for argument in args:
678
+ for var in special_locals:
679
+ if '${%s}' % var in argument:
680
+ needed_variables.add(var)
681
+ needed_variables = sorted(needed_variables)
682
+
683
+ def cygwin_munge(path):
684
+ # pylint: disable=cell-var-from-loop
685
+ if is_cygwin:
686
+ return path.replace('\\', '/')
687
+ return path
688
+
689
+ inputs = [self.GypPathToNinja(i, env) for i in rule.get('inputs', [])]
690
+
691
+ # If there are n source files matching the rule, and m additional rule
692
+ # inputs, then adding 'inputs' to each build edge written below will
693
+ # write m * n inputs. Collapsing reduces this to m + n.
694
+ sources = rule.get('rule_sources', [])
695
+ num_inputs = len(inputs)
696
+ if prebuild:
697
+ num_inputs += 1
698
+ if num_inputs > 2 and len(sources) > 2:
699
+ inputs = [self.WriteCollapsedDependencies(
700
+ rule['rule_name'], inputs, order_only=prebuild)]
701
+ prebuild = []
702
+
703
+ # For each source file, write an edge that generates all the outputs.
704
+ for source in sources:
705
+ source = os.path.normpath(source)
706
+ dirname, basename = os.path.split(source)
707
+ root, ext = os.path.splitext(basename)
708
+
709
+ # Gather the list of inputs and outputs, expanding $vars if possible.
710
+ outputs = [self.ExpandRuleVariables(o, root, dirname,
711
+ source, ext, basename)
712
+ for o in rule['outputs']]
713
+
714
+ if int(rule.get('process_outputs_as_sources', False)):
715
+ extra_sources += outputs
716
+
717
+ was_mac_bundle_resource = source in mac_bundle_resources
718
+ if was_mac_bundle_resource or \
719
+ int(rule.get('process_outputs_as_mac_bundle_resources', False)):
720
+ extra_mac_bundle_resources += outputs
721
+ # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed
722
+ # items in a set and remove them all in a single pass if this becomes
723
+ # a performance issue.
724
+ if was_mac_bundle_resource:
725
+ mac_bundle_resources.remove(source)
726
+
727
+ extra_bindings = []
728
+ for var in needed_variables:
729
+ if var == 'root':
730
+ extra_bindings.append(('root', cygwin_munge(root)))
731
+ elif var == 'dirname':
732
+ # '$dirname' is a parameter to the rule action, which means
733
+ # it shouldn't be converted to a Ninja path. But we don't
734
+ # want $!PRODUCT_DIR in there either.
735
+ dirname_expanded = self.ExpandSpecial(dirname, self.base_to_build)
736
+ extra_bindings.append(('dirname', cygwin_munge(dirname_expanded)))
737
+ elif var == 'source':
738
+ # '$source' is a parameter to the rule action, which means
739
+ # it shouldn't be converted to a Ninja path. But we don't
740
+ # want $!PRODUCT_DIR in there either.
741
+ source_expanded = self.ExpandSpecial(source, self.base_to_build)
742
+ extra_bindings.append(('source', cygwin_munge(source_expanded)))
743
+ elif var == 'ext':
744
+ extra_bindings.append(('ext', ext))
745
+ elif var == 'name':
746
+ extra_bindings.append(('name', cygwin_munge(basename)))
747
+ else:
748
+ assert var == None, repr(var)
749
+
750
+ outputs = [self.GypPathToNinja(o, env) for o in outputs]
751
+ if self.flavor == 'win':
752
+ # WriteNewNinjaRule uses unique_name for creating an rsp file on win.
753
+ extra_bindings.append(('unique_name',
754
+ hashlib.md5(outputs[0]).hexdigest()))
755
+
756
+ self.ninja.build(outputs, rule_name, self.GypPathToNinja(source),
757
+ implicit=inputs,
758
+ order_only=prebuild,
759
+ variables=extra_bindings)
760
+
761
+ all_outputs.extend(outputs)
762
+
763
+ return all_outputs
764
+
765
+ def WriteCopies(self, copies, prebuild, mac_bundle_depends):
766
+ outputs = []
767
+ if self.xcode_settings:
768
+ extra_env = self.xcode_settings.GetPerTargetSettings()
769
+ env = self.GetToolchainEnv(additional_settings=extra_env)
770
+ else:
771
+ env = self.GetToolchainEnv()
772
+ for copy in copies:
773
+ for path in copy['files']:
774
+ # Normalize the path so trailing slashes don't confuse us.
775
+ path = os.path.normpath(path)
776
+ basename = os.path.split(path)[1]
777
+ src = self.GypPathToNinja(path, env)
778
+ dst = self.GypPathToNinja(os.path.join(copy['destination'], basename),
779
+ env)
780
+ outputs += self.ninja.build(dst, 'copy', src, order_only=prebuild)
781
+ if self.is_mac_bundle:
782
+ # gyp has mac_bundle_resources to copy things into a bundle's
783
+ # Resources folder, but there's no built-in way to copy files to other
784
+ # places in the bundle. Hence, some targets use copies for this. Check
785
+ # if this file is copied into the current bundle, and if so add it to
786
+ # the bundle depends so that dependent targets get rebuilt if the copy
787
+ # input changes.
788
+ if dst.startswith(self.xcode_settings.GetBundleContentsFolderPath()):
789
+ mac_bundle_depends.append(dst)
790
+
791
+ return outputs
792
+
793
+ def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild):
794
+ """Prebuild steps to generate hmap files and copy headers to destination."""
795
+ framework = self.ComputeMacBundleOutput()
796
+ all_sources = spec['sources']
797
+ copy_headers = spec['mac_framework_headers']
798
+ output = self.GypPathToUniqueOutput('headers.hmap')
799
+ self.xcode_settings.header_map_path = output
800
+ all_headers = map(self.GypPathToNinja,
801
+ filter(lambda x:x.endswith(('.h')), all_sources))
802
+ variables = [('framework', framework),
803
+ ('copy_headers', map(self.GypPathToNinja, copy_headers))]
804
+ outputs.extend(self.ninja.build(
805
+ output, 'compile_ios_framework_headers', all_headers,
806
+ variables=variables, order_only=prebuild))
807
+
808
+ def WriteMacBundleResources(self, resources, bundle_depends):
809
+ """Writes ninja edges for 'mac_bundle_resources'."""
810
+ xcassets = []
811
+
812
+ extra_env = self.xcode_settings.GetPerTargetSettings()
813
+ env = self.GetSortedXcodeEnv(additional_settings=extra_env)
814
+ env = self.ComputeExportEnvString(env)
815
+ isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name)
816
+
817
+ for output, res in gyp.xcode_emulation.GetMacBundleResources(
818
+ generator_default_variables['PRODUCT_DIR'],
819
+ self.xcode_settings, map(self.GypPathToNinja, resources)):
820
+ output = self.ExpandSpecial(output)
821
+ if os.path.splitext(output)[-1] != '.xcassets':
822
+ self.ninja.build(output, 'mac_tool', res,
823
+ variables=[('mactool_cmd', 'copy-bundle-resource'), \
824
+ ('env', env), ('binary', isBinary)])
825
+ bundle_depends.append(output)
826
+ else:
827
+ xcassets.append(res)
828
+ return xcassets
829
+
830
+ def WriteMacXCassets(self, xcassets, bundle_depends):
831
+ """Writes ninja edges for 'mac_bundle_resources' .xcassets files.
832
+
833
+ This add an invocation of 'actool' via the 'mac_tool.py' helper script.
834
+ It assumes that the assets catalogs define at least one imageset and
835
+ thus an Assets.car file will be generated in the application resources
836
+ directory. If this is not the case, then the build will probably be done
837
+ at each invocation of ninja."""
838
+ if not xcassets:
839
+ return
840
+
841
+ extra_arguments = {}
842
+ settings_to_arg = {
843
+ 'XCASSETS_APP_ICON': 'app-icon',
844
+ 'XCASSETS_LAUNCH_IMAGE': 'launch-image',
845
+ }
846
+ settings = self.xcode_settings.xcode_settings[self.config_name]
847
+ for settings_key, arg_name in settings_to_arg.items():
848
+ value = settings.get(settings_key)
849
+ if value:
850
+ extra_arguments[arg_name] = value
851
+
852
+ partial_info_plist = None
853
+ if extra_arguments:
854
+ partial_info_plist = self.GypPathToUniqueOutput(
855
+ 'assetcatalog_generated_info.plist')
856
+ extra_arguments['output-partial-info-plist'] = partial_info_plist
857
+
858
+ outputs = []
859
+ outputs.append(
860
+ os.path.join(
861
+ self.xcode_settings.GetBundleResourceFolder(),
862
+ 'Assets.car'))
863
+ if partial_info_plist:
864
+ outputs.append(partial_info_plist)
865
+
866
+ keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor)
867
+ extra_env = self.xcode_settings.GetPerTargetSettings()
868
+ env = self.GetSortedXcodeEnv(additional_settings=extra_env)
869
+ env = self.ComputeExportEnvString(env)
870
+
871
+ bundle_depends.extend(self.ninja.build(
872
+ outputs, 'compile_xcassets', xcassets,
873
+ variables=[('env', env), ('keys', keys)]))
874
+ return partial_info_plist
875
+
876
+ def WriteMacInfoPlist(self, partial_info_plist, bundle_depends):
877
+ """Write build rules for bundle Info.plist files."""
878
+ info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist(
879
+ generator_default_variables['PRODUCT_DIR'],
880
+ self.xcode_settings, self.GypPathToNinja)
881
+ if not info_plist:
882
+ return
883
+ out = self.ExpandSpecial(out)
884
+ if defines:
885
+ # Create an intermediate file to store preprocessed results.
886
+ intermediate_plist = self.GypPathToUniqueOutput(
887
+ os.path.basename(info_plist))
888
+ defines = ' '.join([Define(d, self.flavor) for d in defines])
889
+ info_plist = self.ninja.build(
890
+ intermediate_plist, 'preprocess_infoplist', info_plist,
891
+ variables=[('defines',defines)])
892
+
893
+ env = self.GetSortedXcodeEnv(additional_settings=extra_env)
894
+ env = self.ComputeExportEnvString(env)
895
+
896
+ if partial_info_plist:
897
+ intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist')
898
+ info_plist = self.ninja.build(
899
+ intermediate_plist, 'merge_infoplist',
900
+ [partial_info_plist, info_plist])
901
+
902
+ keys = self.xcode_settings.GetExtraPlistItems(self.config_name)
903
+ keys = QuoteShellArgument(json.dumps(keys), self.flavor)
904
+ isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name)
905
+ self.ninja.build(out, 'copy_infoplist', info_plist,
906
+ variables=[('env', env), ('keys', keys),
907
+ ('binary', isBinary)])
908
+ bundle_depends.append(out)
909
+
910
+ def WriteSources(self, ninja_file, config_name, config, sources, predepends,
911
+ precompiled_header, spec):
912
+ """Write build rules to compile all of |sources|."""
913
+ if self.toolset == 'host':
914
+ self.ninja.variable('ar', '$ar_host')
915
+ self.ninja.variable('cc', '$cc_host')
916
+ self.ninja.variable('cxx', '$cxx_host')
917
+ self.ninja.variable('ld', '$ld_host')
918
+ self.ninja.variable('ldxx', '$ldxx_host')
919
+ self.ninja.variable('nm', '$nm_host')
920
+ self.ninja.variable('readelf', '$readelf_host')
921
+
922
+ if self.flavor != 'mac' or len(self.archs) == 1:
923
+ return self.WriteSourcesForArch(
924
+ self.ninja, config_name, config, sources, predepends,
925
+ precompiled_header, spec)
926
+ else:
927
+ return dict((arch, self.WriteSourcesForArch(
928
+ self.arch_subninjas[arch], config_name, config, sources, predepends,
929
+ precompiled_header, spec, arch=arch))
930
+ for arch in self.archs)
931
+
932
+ def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
933
+ predepends, precompiled_header, spec, arch=None):
934
+ """Write build rules to compile all of |sources|."""
935
+
936
+ extra_defines = []
937
+ if self.flavor == 'mac':
938
+ cflags = self.xcode_settings.GetCflags(config_name, arch=arch)
939
+ cflags_c = self.xcode_settings.GetCflagsC(config_name)
940
+ cflags_cc = self.xcode_settings.GetCflagsCC(config_name)
941
+ cflags_objc = ['$cflags_c'] + \
942
+ self.xcode_settings.GetCflagsObjC(config_name)
943
+ cflags_objcc = ['$cflags_cc'] + \
944
+ self.xcode_settings.GetCflagsObjCC(config_name)
945
+ elif self.flavor == 'win':
946
+ asmflags = self.msvs_settings.GetAsmflags(config_name)
947
+ cflags = self.msvs_settings.GetCflags(config_name)
948
+ cflags_c = self.msvs_settings.GetCflagsC(config_name)
949
+ cflags_cc = self.msvs_settings.GetCflagsCC(config_name)
950
+ extra_defines = self.msvs_settings.GetComputedDefines(config_name)
951
+ # See comment at cc_command for why there's two .pdb files.
952
+ pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName(
953
+ config_name, self.ExpandSpecial)
954
+ if not pdbpath_c:
955
+ obj = 'obj'
956
+ if self.toolset != 'target':
957
+ obj += '.' + self.toolset
958
+ pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name))
959
+ pdbpath_c = pdbpath + '.c.pdb'
960
+ pdbpath_cc = pdbpath + '.cc.pdb'
961
+ self.WriteVariableList(ninja_file, 'pdbname_c', [pdbpath_c])
962
+ self.WriteVariableList(ninja_file, 'pdbname_cc', [pdbpath_cc])
963
+ self.WriteVariableList(ninja_file, 'pchprefix', [self.name])
964
+ else:
965
+ cflags = config.get('cflags', [])
966
+ cflags_c = config.get('cflags_c', [])
967
+ cflags_cc = config.get('cflags_cc', [])
968
+
969
+ # Respect environment variables related to build, but target-specific
970
+ # flags can still override them.
971
+ if self.toolset == 'target':
972
+ cflags_c = (os.environ.get('CPPFLAGS', '').split() +
973
+ os.environ.get('CFLAGS', '').split() + cflags_c)
974
+ cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
975
+ os.environ.get('CXXFLAGS', '').split() + cflags_cc)
976
+ elif self.toolset == 'host':
977
+ cflags_c = (os.environ.get('CPPFLAGS_host', '').split() +
978
+ os.environ.get('CFLAGS_host', '').split() + cflags_c)
979
+ cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() +
980
+ os.environ.get('CXXFLAGS_host', '').split() + cflags_cc)
981
+
982
+ defines = config.get('defines', []) + extra_defines
983
+ self.WriteVariableList(ninja_file, 'defines',
984
+ [Define(d, self.flavor) for d in defines])
985
+ if self.flavor == 'win':
986
+ self.WriteVariableList(ninja_file, 'asmflags',
987
+ map(self.ExpandSpecial, asmflags))
988
+ self.WriteVariableList(ninja_file, 'rcflags',
989
+ [QuoteShellArgument(self.ExpandSpecial(f), self.flavor)
990
+ for f in self.msvs_settings.GetRcflags(config_name,
991
+ self.GypPathToNinja)])
992
+
993
+ include_dirs = config.get('include_dirs', [])
994
+
995
+ env = self.GetToolchainEnv()
996
+ if self.flavor == 'win':
997
+ include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs,
998
+ config_name)
999
+ self.WriteVariableList(ninja_file, 'includes',
1000
+ [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
1001
+ for i in include_dirs])
1002
+
1003
+ if self.flavor == 'win':
1004
+ midl_include_dirs = config.get('midl_include_dirs', [])
1005
+ midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs(
1006
+ midl_include_dirs, config_name)
1007
+ self.WriteVariableList(ninja_file, 'midl_includes',
1008
+ [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
1009
+ for i in midl_include_dirs])
1010
+
1011
+ pch_commands = precompiled_header.GetPchBuildCommands(arch)
1012
+ if self.flavor == 'mac':
1013
+ # Most targets use no precompiled headers, so only write these if needed.
1014
+ for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'),
1015
+ ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]:
1016
+ include = precompiled_header.GetInclude(ext, arch)
1017
+ if include: ninja_file.variable(var, include)
1018
+
1019
+ arflags = config.get('arflags', [])
1020
+
1021
+ self.WriteVariableList(ninja_file, 'cflags',
1022
+ map(self.ExpandSpecial, cflags))
1023
+ self.WriteVariableList(ninja_file, 'cflags_c',
1024
+ map(self.ExpandSpecial, cflags_c))
1025
+ self.WriteVariableList(ninja_file, 'cflags_cc',
1026
+ map(self.ExpandSpecial, cflags_cc))
1027
+ if self.flavor == 'mac':
1028
+ self.WriteVariableList(ninja_file, 'cflags_objc',
1029
+ map(self.ExpandSpecial, cflags_objc))
1030
+ self.WriteVariableList(ninja_file, 'cflags_objcc',
1031
+ map(self.ExpandSpecial, cflags_objcc))
1032
+ self.WriteVariableList(ninja_file, 'arflags',
1033
+ map(self.ExpandSpecial, arflags))
1034
+ ninja_file.newline()
1035
+ outputs = []
1036
+ has_rc_source = False
1037
+ for source in sources:
1038
+ filename, ext = os.path.splitext(source)
1039
+ ext = ext[1:]
1040
+ obj_ext = self.obj_ext
1041
+ if ext in ('cc', 'cpp', 'cxx'):
1042
+ command = 'cxx'
1043
+ self.target.uses_cpp = True
1044
+ elif ext == 'c' or (ext == 'S' and self.flavor != 'win'):
1045
+ command = 'cc'
1046
+ elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files.
1047
+ command = 'cc_s'
1048
+ elif (self.flavor == 'win' and ext == 'asm' and
1049
+ not self.msvs_settings.HasExplicitAsmRules(spec)):
1050
+ command = 'asm'
1051
+ # Add the _asm suffix as msvs is capable of handling .cc and
1052
+ # .asm files of the same name without collision.
1053
+ obj_ext = '_asm.obj'
1054
+ elif self.flavor == 'mac' and ext == 'm':
1055
+ command = 'objc'
1056
+ elif self.flavor == 'mac' and ext == 'mm':
1057
+ command = 'objcxx'
1058
+ self.target.uses_cpp = True
1059
+ elif self.flavor == 'win' and ext == 'rc':
1060
+ command = 'rc'
1061
+ obj_ext = '.res'
1062
+ has_rc_source = True
1063
+ else:
1064
+ # Ignore unhandled extensions.
1065
+ continue
1066
+ input = self.GypPathToNinja(source)
1067
+ output = self.GypPathToUniqueOutput(filename + obj_ext)
1068
+ if arch is not None:
1069
+ output = AddArch(output, arch)
1070
+ implicit = precompiled_header.GetObjDependencies([input], [output], arch)
1071
+ variables = []
1072
+ if self.flavor == 'win':
1073
+ variables, output, implicit = precompiled_header.GetFlagsModifications(
1074
+ input, output, implicit, command, cflags_c, cflags_cc,
1075
+ self.ExpandSpecial)
1076
+ ninja_file.build(output, command, input,
1077
+ implicit=[gch for _, _, gch in implicit],
1078
+ order_only=predepends, variables=variables)
1079
+ outputs.append(output)
1080
+
1081
+ if has_rc_source:
1082
+ resource_include_dirs = config.get('resource_include_dirs', include_dirs)
1083
+ self.WriteVariableList(ninja_file, 'resource_includes',
1084
+ [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
1085
+ for i in resource_include_dirs])
1086
+
1087
+ self.WritePchTargets(ninja_file, pch_commands)
1088
+
1089
+ ninja_file.newline()
1090
+ return outputs
1091
+
1092
+ def WritePchTargets(self, ninja_file, pch_commands):
1093
+ """Writes ninja rules to compile prefix headers."""
1094
+ if not pch_commands:
1095
+ return
1096
+
1097
+ for gch, lang_flag, lang, input in pch_commands:
1098
+ var_name = {
1099
+ 'c': 'cflags_pch_c',
1100
+ 'cc': 'cflags_pch_cc',
1101
+ 'm': 'cflags_pch_objc',
1102
+ 'mm': 'cflags_pch_objcc',
1103
+ }[lang]
1104
+
1105
+ map = { 'c': 'cc', 'cc': 'cxx', 'm': 'objc', 'mm': 'objcxx', }
1106
+ cmd = map.get(lang)
1107
+ ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)])
1108
+
1109
+ def WriteLink(self, spec, config_name, config, link_deps, compile_deps):
1110
+ """Write out a link step. Fills out target.binary. """
1111
+ if self.flavor != 'mac' or len(self.archs) == 1:
1112
+ return self.WriteLinkForArch(
1113
+ self.ninja, spec, config_name, config, link_deps, compile_deps)
1114
+ else:
1115
+ output = self.ComputeOutput(spec)
1116
+ inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec,
1117
+ config_name, config, link_deps[arch],
1118
+ compile_deps, arch=arch)
1119
+ for arch in self.archs]
1120
+ extra_bindings = []
1121
+ build_output = output
1122
+ if not self.is_mac_bundle:
1123
+ self.AppendPostbuildVariable(extra_bindings, spec, output, output)
1124
+
1125
+ # TODO(yyanagisawa): more work needed to fix:
1126
+ # https://code.google.com/p/gyp/issues/detail?id=411
1127
+ if (spec['type'] in ('shared_library', 'loadable_module') and
1128
+ not self.is_mac_bundle):
1129
+ extra_bindings.append(('lib', output))
1130
+ self.ninja.build([output, output + '.TOC'], 'solipo', inputs,
1131
+ variables=extra_bindings)
1132
+ else:
1133
+ self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings)
1134
+ return output
1135
+
1136
+ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
1137
+ link_deps, compile_deps, arch=None):
1138
+ """Write out a link step. Fills out target.binary. """
1139
+ command = {
1140
+ 'executable': 'link',
1141
+ 'loadable_module': 'solink_module',
1142
+ 'shared_library': 'solink',
1143
+ }[spec['type']]
1144
+ command_suffix = ''
1145
+
1146
+ implicit_deps = set()
1147
+ solibs = set()
1148
+ order_deps = set()
1149
+
1150
+ if compile_deps:
1151
+ # Normally, the compiles of the target already depend on compile_deps,
1152
+ # but a shared_library target might have no sources and only link together
1153
+ # a few static_library deps, so the link step also needs to depend
1154
+ # on compile_deps to make sure actions in the shared_library target
1155
+ # get run before the link.
1156
+ order_deps.add(compile_deps)
1157
+
1158
+ if 'dependencies' in spec:
1159
+ # Two kinds of dependencies:
1160
+ # - Linkable dependencies (like a .a or a .so): add them to the link line.
1161
+ # - Non-linkable dependencies (like a rule that generates a file
1162
+ # and writes a stamp file): add them to implicit_deps
1163
+ extra_link_deps = set()
1164
+ for dep in spec['dependencies']:
1165
+ target = self.target_outputs.get(dep)
1166
+ if not target:
1167
+ continue
1168
+ linkable = target.Linkable()
1169
+ if linkable:
1170
+ new_deps = []
1171
+ if (self.flavor == 'win' and
1172
+ target.component_objs and
1173
+ self.msvs_settings.IsUseLibraryDependencyInputs(config_name)):
1174
+ new_deps = target.component_objs
1175
+ if target.compile_deps:
1176
+ order_deps.add(target.compile_deps)
1177
+ elif self.flavor == 'win' and target.import_lib:
1178
+ new_deps = [target.import_lib]
1179
+ elif target.UsesToc(self.flavor):
1180
+ solibs.add(target.binary)
1181
+ implicit_deps.add(target.binary + '.TOC')
1182
+ else:
1183
+ new_deps = [target.binary]
1184
+ for new_dep in new_deps:
1185
+ if new_dep not in extra_link_deps:
1186
+ extra_link_deps.add(new_dep)
1187
+ link_deps.append(new_dep)
1188
+
1189
+ final_output = target.FinalOutput()
1190
+ if not linkable or final_output != target.binary:
1191
+ implicit_deps.add(final_output)
1192
+
1193
+ extra_bindings = []
1194
+ if self.target.uses_cpp and self.flavor != 'win':
1195
+ extra_bindings.append(('ld', '$ldxx'))
1196
+
1197
+ output = self.ComputeOutput(spec, arch)
1198
+ if arch is None and not self.is_mac_bundle:
1199
+ self.AppendPostbuildVariable(extra_bindings, spec, output, output)
1200
+
1201
+ is_executable = spec['type'] == 'executable'
1202
+ # The ldflags config key is not used on mac or win. On those platforms
1203
+ # linker flags are set via xcode_settings and msvs_settings, respectively.
1204
+ if self.toolset == 'target':
1205
+ env_ldflags = os.environ.get('LDFLAGS', '').split()
1206
+ elif self.toolset == 'host':
1207
+ env_ldflags = os.environ.get('LDFLAGS_host', '').split()
1208
+ if self.flavor == 'mac':
1209
+ ldflags = self.xcode_settings.GetLdflags(config_name,
1210
+ self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']),
1211
+ self.GypPathToNinja, arch)
1212
+ ldflags = env_ldflags + ldflags
1213
+ elif self.flavor == 'win':
1214
+ manifest_base_name = self.GypPathToUniqueOutput(
1215
+ self.ComputeOutputFileName(spec))
1216
+ ldflags, intermediate_manifest, manifest_files = \
1217
+ self.msvs_settings.GetLdflags(config_name, self.GypPathToNinja,
1218
+ self.ExpandSpecial, manifest_base_name,
1219
+ output, is_executable,
1220
+ self.toplevel_build)
1221
+ ldflags = env_ldflags + ldflags
1222
+ self.WriteVariableList(ninja_file, 'manifests', manifest_files)
1223
+ implicit_deps = implicit_deps.union(manifest_files)
1224
+ if intermediate_manifest:
1225
+ self.WriteVariableList(
1226
+ ninja_file, 'intermediatemanifest', [intermediate_manifest])
1227
+ command_suffix = _GetWinLinkRuleNameSuffix(
1228
+ self.msvs_settings.IsEmbedManifest(config_name))
1229
+ def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja)
1230
+ if def_file:
1231
+ implicit_deps.add(def_file)
1232
+ else:
1233
+ # Respect environment variables related to build, but target-specific
1234
+ # flags can still override them.
1235
+ ldflags = env_ldflags + config.get('ldflags', [])
1236
+ if is_executable and len(solibs):
1237
+ rpath = 'lib/'
1238
+ if self.toolset != 'target':
1239
+ rpath += self.toolset
1240
+ ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
1241
+ else:
1242
+ ldflags.append('-Wl,-rpath=%s' % self.target_rpath)
1243
+ ldflags.append('-Wl,-rpath-link=%s' % rpath)
1244
+ self.WriteVariableList(ninja_file, 'ldflags',
1245
+ map(self.ExpandSpecial, ldflags))
1246
+
1247
+ library_dirs = config.get('library_dirs', [])
1248
+ if self.flavor == 'win':
1249
+ library_dirs = [self.msvs_settings.ConvertVSMacros(l, config_name)
1250
+ for l in library_dirs]
1251
+ library_dirs = ['/LIBPATH:' + QuoteShellArgument(self.GypPathToNinja(l),
1252
+ self.flavor)
1253
+ for l in library_dirs]
1254
+ else:
1255
+ library_dirs = [QuoteShellArgument('-L' + self.GypPathToNinja(l),
1256
+ self.flavor)
1257
+ for l in library_dirs]
1258
+
1259
+ libraries = gyp.common.uniquer(map(self.ExpandSpecial,
1260
+ spec.get('libraries', [])))
1261
+ if self.flavor == 'mac':
1262
+ libraries = self.xcode_settings.AdjustLibraries(libraries, config_name)
1263
+ elif self.flavor == 'win':
1264
+ libraries = self.msvs_settings.AdjustLibraries(libraries)
1265
+
1266
+ self.WriteVariableList(ninja_file, 'libs', library_dirs + libraries)
1267
+
1268
+ linked_binary = output
1269
+
1270
+ if command in ('solink', 'solink_module'):
1271
+ extra_bindings.append(('soname', os.path.split(output)[1]))
1272
+ extra_bindings.append(('lib',
1273
+ gyp.common.EncodePOSIXShellArgument(output)))
1274
+ if self.flavor != 'win':
1275
+ link_file_list = output
1276
+ if self.is_mac_bundle:
1277
+ # 'Dependency Framework.framework/Versions/A/Dependency Framework' ->
1278
+ # 'Dependency Framework.framework.rsp'
1279
+ link_file_list = self.xcode_settings.GetWrapperName()
1280
+ if arch:
1281
+ link_file_list += '.' + arch
1282
+ link_file_list += '.rsp'
1283
+ # If an rspfile contains spaces, ninja surrounds the filename with
1284
+ # quotes around it and then passes it to open(), creating a file with
1285
+ # quotes in its name (and when looking for the rsp file, the name
1286
+ # makes it through bash which strips the quotes) :-/
1287
+ link_file_list = link_file_list.replace(' ', '_')
1288
+ extra_bindings.append(
1289
+ ('link_file_list',
1290
+ gyp.common.EncodePOSIXShellArgument(link_file_list)))
1291
+ if self.flavor == 'win':
1292
+ extra_bindings.append(('binary', output))
1293
+ if ('/NOENTRY' not in ldflags and
1294
+ not self.msvs_settings.GetNoImportLibrary(config_name)):
1295
+ self.target.import_lib = output + '.lib'
1296
+ extra_bindings.append(('implibflag',
1297
+ '/IMPLIB:%s' % self.target.import_lib))
1298
+ pdbname = self.msvs_settings.GetPDBName(
1299
+ config_name, self.ExpandSpecial, output + '.pdb')
1300
+ output = [output, self.target.import_lib]
1301
+ if pdbname:
1302
+ output.append(pdbname)
1303
+ elif not self.is_mac_bundle:
1304
+ output = [output, output + '.TOC']
1305
+ else:
1306
+ command = command + '_notoc'
1307
+ elif self.flavor == 'win':
1308
+ extra_bindings.append(('binary', output))
1309
+ pdbname = self.msvs_settings.GetPDBName(
1310
+ config_name, self.ExpandSpecial, output + '.pdb')
1311
+ if pdbname:
1312
+ output = [output, pdbname]
1313
+
1314
+
1315
+ if len(solibs):
1316
+ extra_bindings.append(('solibs',
1317
+ gyp.common.EncodePOSIXShellList(sorted(solibs))))
1318
+
1319
+ ninja_file.build(output, command + command_suffix, link_deps,
1320
+ implicit=sorted(implicit_deps),
1321
+ order_only=list(order_deps),
1322
+ variables=extra_bindings)
1323
+ return linked_binary
1324
+
1325
+ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
1326
+ extra_link_deps = any(self.target_outputs.get(dep).Linkable()
1327
+ for dep in spec.get('dependencies', [])
1328
+ if dep in self.target_outputs)
1329
+ if spec['type'] == 'none' or (not link_deps and not extra_link_deps):
1330
+ # TODO(evan): don't call this function for 'none' target types, as
1331
+ # it doesn't do anything, and we fake out a 'binary' with a stamp file.
1332
+ self.target.binary = compile_deps
1333
+ self.target.type = 'none'
1334
+ elif spec['type'] == 'static_library':
1335
+ self.target.binary = self.ComputeOutput(spec)
1336
+ if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not
1337
+ self.is_standalone_static_library):
1338
+ self.ninja.build(self.target.binary, 'alink_thin', link_deps,
1339
+ order_only=compile_deps)
1340
+ else:
1341
+ variables = []
1342
+ if self.xcode_settings:
1343
+ libtool_flags = self.xcode_settings.GetLibtoolflags(config_name)
1344
+ if libtool_flags:
1345
+ variables.append(('libtool_flags', libtool_flags))
1346
+ if self.msvs_settings:
1347
+ libflags = self.msvs_settings.GetLibFlags(config_name,
1348
+ self.GypPathToNinja)
1349
+ variables.append(('libflags', libflags))
1350
+
1351
+ if self.flavor != 'mac' or len(self.archs) == 1:
1352
+ self.AppendPostbuildVariable(variables, spec,
1353
+ self.target.binary, self.target.binary)
1354
+ self.ninja.build(self.target.binary, 'alink', link_deps,
1355
+ order_only=compile_deps, variables=variables)
1356
+ else:
1357
+ inputs = []
1358
+ for arch in self.archs:
1359
+ output = self.ComputeOutput(spec, arch)
1360
+ self.arch_subninjas[arch].build(output, 'alink', link_deps[arch],
1361
+ order_only=compile_deps,
1362
+ variables=variables)
1363
+ inputs.append(output)
1364
+ # TODO: It's not clear if libtool_flags should be passed to the alink
1365
+ # call that combines single-arch .a files into a fat .a file.
1366
+ self.AppendPostbuildVariable(variables, spec,
1367
+ self.target.binary, self.target.binary)
1368
+ self.ninja.build(self.target.binary, 'alink', inputs,
1369
+ # FIXME: test proving order_only=compile_deps isn't
1370
+ # needed.
1371
+ variables=variables)
1372
+ else:
1373
+ self.target.binary = self.WriteLink(spec, config_name, config, link_deps,
1374
+ compile_deps)
1375
+ return self.target.binary
1376
+
1377
+ def WriteMacBundle(self, spec, mac_bundle_depends, is_empty):
1378
+ assert self.is_mac_bundle
1379
+ package_framework = spec['type'] in ('shared_library', 'loadable_module')
1380
+ output = self.ComputeMacBundleOutput()
1381
+ if is_empty:
1382
+ output += '.stamp'
1383
+ variables = []
1384
+ self.AppendPostbuildVariable(variables, spec, output, self.target.binary,
1385
+ is_command_start=not package_framework)
1386
+ if package_framework and not is_empty:
1387
+ if spec['type'] == 'shared_library' and self.xcode_settings.isIOS:
1388
+ self.ninja.build(output, 'package_ios_framework', mac_bundle_depends,
1389
+ variables=variables)
1390
+ else:
1391
+ variables.append(('version', self.xcode_settings.GetFrameworkVersion()))
1392
+ self.ninja.build(output, 'package_framework', mac_bundle_depends,
1393
+ variables=variables)
1394
+ else:
1395
+ self.ninja.build(output, 'stamp', mac_bundle_depends,
1396
+ variables=variables)
1397
+ self.target.bundle = output
1398
+ return output
1399
+
1400
+ def GetToolchainEnv(self, additional_settings=None):
1401
+ """Returns the variables toolchain would set for build steps."""
1402
+ env = self.GetSortedXcodeEnv(additional_settings=additional_settings)
1403
+ if self.flavor == 'win':
1404
+ env = self.GetMsvsToolchainEnv(
1405
+ additional_settings=additional_settings)
1406
+ return env
1407
+
1408
+ def GetMsvsToolchainEnv(self, additional_settings=None):
1409
+ """Returns the variables Visual Studio would set for build steps."""
1410
+ return self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR',
1411
+ config=self.config_name)
1412
+
1413
+ def GetSortedXcodeEnv(self, additional_settings=None):
1414
+ """Returns the variables Xcode would set for build steps."""
1415
+ assert self.abs_build_dir
1416
+ abs_build_dir = self.abs_build_dir
1417
+ return gyp.xcode_emulation.GetSortedXcodeEnv(
1418
+ self.xcode_settings, abs_build_dir,
1419
+ os.path.join(abs_build_dir, self.build_to_base), self.config_name,
1420
+ additional_settings)
1421
+
1422
+ def GetSortedXcodePostbuildEnv(self):
1423
+ """Returns the variables Xcode would set for postbuild steps."""
1424
+ postbuild_settings = {}
1425
+ # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack.
1426
+ # TODO(thakis): It would be nice to have some general mechanism instead.
1427
+ strip_save_file = self.xcode_settings.GetPerTargetSetting(
1428
+ 'CHROMIUM_STRIP_SAVE_FILE')
1429
+ if strip_save_file:
1430
+ postbuild_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file
1431
+ return self.GetSortedXcodeEnv(additional_settings=postbuild_settings)
1432
+
1433
+ def AppendPostbuildVariable(self, variables, spec, output, binary,
1434
+ is_command_start=False):
1435
+ """Adds a 'postbuild' variable if there is a postbuild for |output|."""
1436
+ postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start)
1437
+ if postbuild:
1438
+ variables.append(('postbuilds', postbuild))
1439
+
1440
+ def GetPostbuildCommand(self, spec, output, output_binary, is_command_start):
1441
+ """Returns a shell command that runs all the postbuilds, and removes
1442
+ |output| if any of them fails. If |is_command_start| is False, then the
1443
+ returned string will start with ' && '."""
1444
+ if not self.xcode_settings or spec['type'] == 'none' or not output:
1445
+ return ''
1446
+ output = QuoteShellArgument(output, self.flavor)
1447
+ postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True)
1448
+ if output_binary is not None:
1449
+ postbuilds = self.xcode_settings.AddImplicitPostbuilds(
1450
+ self.config_name,
1451
+ os.path.normpath(os.path.join(self.base_to_build, output)),
1452
+ QuoteShellArgument(
1453
+ os.path.normpath(os.path.join(self.base_to_build, output_binary)),
1454
+ self.flavor),
1455
+ postbuilds, quiet=True)
1456
+
1457
+ if not postbuilds:
1458
+ return ''
1459
+ # Postbuilds expect to be run in the gyp file's directory, so insert an
1460
+ # implicit postbuild to cd to there.
1461
+ postbuilds.insert(0, gyp.common.EncodePOSIXShellList(
1462
+ ['cd', self.build_to_base]))
1463
+ env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv())
1464
+ # G will be non-null if any postbuild fails. Run all postbuilds in a
1465
+ # subshell.
1466
+ commands = env + ' (' + \
1467
+ ' && '.join([ninja_syntax.escape(command) for command in postbuilds])
1468
+ command_string = (commands + '); G=$$?; '
1469
+ # Remove the final output if any postbuild failed.
1470
+ '((exit $$G) || rm -rf %s) ' % output + '&& exit $$G)')
1471
+ if is_command_start:
1472
+ return '(' + command_string + ' && '
1473
+ else:
1474
+ return '$ && (' + command_string
1475
+
1476
+ def ComputeExportEnvString(self, env):
1477
+ """Given an environment, returns a string looking like
1478
+ 'export FOO=foo; export BAR="${FOO} bar;'
1479
+ that exports |env| to the shell."""
1480
+ export_str = []
1481
+ for k, v in env:
1482
+ export_str.append('export %s=%s;' %
1483
+ (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v))))
1484
+ return ' '.join(export_str)
1485
+
1486
+ def ComputeMacBundleOutput(self):
1487
+ """Return the 'output' (full output path) to a bundle output directory."""
1488
+ assert self.is_mac_bundle
1489
+ path = generator_default_variables['PRODUCT_DIR']
1490
+ return self.ExpandSpecial(
1491
+ os.path.join(path, self.xcode_settings.GetWrapperName()))
1492
+
1493
+ def ComputeOutputFileName(self, spec, type=None):
1494
+ """Compute the filename of the final output for the current target."""
1495
+ if not type:
1496
+ type = spec['type']
1497
+
1498
+ default_variables = copy.copy(generator_default_variables)
1499
+ CalculateVariables(default_variables, {'flavor': self.flavor})
1500
+
1501
+ # Compute filename prefix: the product prefix, or a default for
1502
+ # the product type.
1503
+ DEFAULT_PREFIX = {
1504
+ 'loadable_module': default_variables['SHARED_LIB_PREFIX'],
1505
+ 'shared_library': default_variables['SHARED_LIB_PREFIX'],
1506
+ 'static_library': default_variables['STATIC_LIB_PREFIX'],
1507
+ 'executable': default_variables['EXECUTABLE_PREFIX'],
1508
+ }
1509
+ prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, ''))
1510
+
1511
+ # Compute filename extension: the product extension, or a default
1512
+ # for the product type.
1513
+ DEFAULT_EXTENSION = {
1514
+ 'loadable_module': default_variables['SHARED_LIB_SUFFIX'],
1515
+ 'shared_library': default_variables['SHARED_LIB_SUFFIX'],
1516
+ 'static_library': default_variables['STATIC_LIB_SUFFIX'],
1517
+ 'executable': default_variables['EXECUTABLE_SUFFIX'],
1518
+ }
1519
+ extension = spec.get('product_extension')
1520
+ if extension:
1521
+ extension = '.' + extension
1522
+ else:
1523
+ extension = DEFAULT_EXTENSION.get(type, '')
1524
+
1525
+ if 'product_name' in spec:
1526
+ # If we were given an explicit name, use that.
1527
+ target = spec['product_name']
1528
+ else:
1529
+ # Otherwise, derive a name from the target name.
1530
+ target = spec['target_name']
1531
+ if prefix == 'lib':
1532
+ # Snip out an extra 'lib' from libs if appropriate.
1533
+ target = StripPrefix(target, 'lib')
1534
+
1535
+ if type in ('static_library', 'loadable_module', 'shared_library',
1536
+ 'executable'):
1537
+ return '%s%s%s' % (prefix, target, extension)
1538
+ elif type == 'none':
1539
+ return '%s.stamp' % target
1540
+ else:
1541
+ raise Exception('Unhandled output type %s' % type)
1542
+
1543
+ def ComputeOutput(self, spec, arch=None):
1544
+ """Compute the path for the final output of the spec."""
1545
+ type = spec['type']
1546
+
1547
+ if self.flavor == 'win':
1548
+ override = self.msvs_settings.GetOutputName(self.config_name,
1549
+ self.ExpandSpecial)
1550
+ if override:
1551
+ return override
1552
+
1553
+ if arch is None and self.flavor == 'mac' and type in (
1554
+ 'static_library', 'executable', 'shared_library', 'loadable_module'):
1555
+ filename = self.xcode_settings.GetExecutablePath()
1556
+ else:
1557
+ filename = self.ComputeOutputFileName(spec, type)
1558
+
1559
+ if arch is None and 'product_dir' in spec:
1560
+ path = os.path.join(spec['product_dir'], filename)
1561
+ return self.ExpandSpecial(path)
1562
+
1563
+ # Some products go into the output root, libraries go into shared library
1564
+ # dir, and everything else goes into the normal place.
1565
+ type_in_output_root = ['executable', 'loadable_module']
1566
+ if self.flavor == 'mac' and self.toolset == 'target':
1567
+ type_in_output_root += ['shared_library', 'static_library']
1568
+ elif self.flavor == 'win' and self.toolset == 'target':
1569
+ type_in_output_root += ['shared_library']
1570
+
1571
+ if arch is not None:
1572
+ # Make sure partial executables don't end up in a bundle or the regular
1573
+ # output directory.
1574
+ archdir = 'arch'
1575
+ if self.toolset != 'target':
1576
+ archdir = os.path.join('arch', '%s' % self.toolset)
1577
+ return os.path.join(archdir, AddArch(filename, arch))
1578
+ elif type in type_in_output_root or self.is_standalone_static_library:
1579
+ return filename
1580
+ elif type == 'shared_library':
1581
+ libdir = 'lib'
1582
+ if self.toolset != 'target':
1583
+ libdir = os.path.join('lib', '%s' % self.toolset)
1584
+ return os.path.join(libdir, filename)
1585
+ else:
1586
+ return self.GypPathToUniqueOutput(filename, qualified=False)
1587
+
1588
+ def WriteVariableList(self, ninja_file, var, values):
1589
+ assert not isinstance(values, str)
1590
+ if values is None:
1591
+ values = []
1592
+ ninja_file.variable(var, ' '.join(values))
1593
+
1594
+ def WriteNewNinjaRule(self, name, args, description, is_cygwin, env, pool,
1595
+ depfile=None):
1596
+ """Write out a new ninja "rule" statement for a given command.
1597
+
1598
+ Returns the name of the new rule, and a copy of |args| with variables
1599
+ expanded."""
1600
+
1601
+ if self.flavor == 'win':
1602
+ args = [self.msvs_settings.ConvertVSMacros(
1603
+ arg, self.base_to_build, config=self.config_name)
1604
+ for arg in args]
1605
+ description = self.msvs_settings.ConvertVSMacros(
1606
+ description, config=self.config_name)
1607
+ elif self.flavor == 'mac':
1608
+ # |env| is an empty list on non-mac.
1609
+ args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args]
1610
+ description = gyp.xcode_emulation.ExpandEnvVars(description, env)
1611
+
1612
+ # TODO: we shouldn't need to qualify names; we do it because
1613
+ # currently the ninja rule namespace is global, but it really
1614
+ # should be scoped to the subninja.
1615
+ rule_name = self.name
1616
+ if self.toolset == 'target':
1617
+ rule_name += '.' + self.toolset
1618
+ rule_name += '.' + name
1619
+ rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name)
1620
+
1621
+ # Remove variable references, but not if they refer to the magic rule
1622
+ # variables. This is not quite right, as it also protects these for
1623
+ # actions, not just for rules where they are valid. Good enough.
1624
+ protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}' ]
1625
+ protect = '(?!' + '|'.join(map(re.escape, protect)) + ')'
1626
+ description = re.sub(protect + r'\$', '_', description)
1627
+
1628
+ # gyp dictates that commands are run from the base directory.
1629
+ # cd into the directory before running, and adjust paths in
1630
+ # the arguments to point to the proper locations.
1631
+ rspfile = None
1632
+ rspfile_content = None
1633
+ args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args]
1634
+ if self.flavor == 'win':
1635
+ rspfile = rule_name + '.$unique_name.rsp'
1636
+ # The cygwin case handles this inside the bash sub-shell.
1637
+ run_in = '' if is_cygwin else ' ' + self.build_to_base
1638
+ if is_cygwin:
1639
+ rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine(
1640
+ args, self.build_to_base)
1641
+ else:
1642
+ rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args)
1643
+ command = ('%s gyp-win-tool action-wrapper $arch ' % sys.executable +
1644
+ rspfile + run_in)
1645
+ else:
1646
+ env = self.ComputeExportEnvString(env)
1647
+ command = gyp.common.EncodePOSIXShellList(args)
1648
+ command = 'cd %s; ' % self.build_to_base + env + command
1649
+
1650
+ # GYP rules/actions express being no-ops by not touching their outputs.
1651
+ # Avoid executing downstream dependencies in this case by specifying
1652
+ # restat=1 to ninja.
1653
+ self.ninja.rule(rule_name, command, description, depfile=depfile,
1654
+ restat=True, pool=pool,
1655
+ rspfile=rspfile, rspfile_content=rspfile_content)
1656
+ self.ninja.newline()
1657
+
1658
+ return rule_name, args
1659
+
1660
+
1661
+ def CalculateVariables(default_variables, params):
1662
+ """Calculate additional variables for use in the build (called by gyp)."""
1663
+ global generator_additional_non_configuration_keys
1664
+ global generator_additional_path_sections
1665
+ flavor = gyp.common.GetFlavor(params)
1666
+ if flavor == 'mac':
1667
+ default_variables.setdefault('OS', 'mac')
1668
+ default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')
1669
+ default_variables.setdefault('SHARED_LIB_DIR',
1670
+ generator_default_variables['PRODUCT_DIR'])
1671
+ default_variables.setdefault('LIB_DIR',
1672
+ generator_default_variables['PRODUCT_DIR'])
1673
+
1674
+ # Copy additional generator configuration data from Xcode, which is shared
1675
+ # by the Mac Ninja generator.
1676
+ import gyp.generator.xcode as xcode_generator
1677
+ generator_additional_non_configuration_keys = getattr(xcode_generator,
1678
+ 'generator_additional_non_configuration_keys', [])
1679
+ generator_additional_path_sections = getattr(xcode_generator,
1680
+ 'generator_additional_path_sections', [])
1681
+ global generator_extra_sources_for_rules
1682
+ generator_extra_sources_for_rules = getattr(xcode_generator,
1683
+ 'generator_extra_sources_for_rules', [])
1684
+ elif flavor == 'win':
1685
+ exts = gyp.MSVSUtil.TARGET_TYPE_EXT
1686
+ default_variables.setdefault('OS', 'win')
1687
+ default_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable']
1688
+ default_variables['STATIC_LIB_PREFIX'] = ''
1689
+ default_variables['STATIC_LIB_SUFFIX'] = '.' + exts['static_library']
1690
+ default_variables['SHARED_LIB_PREFIX'] = ''
1691
+ default_variables['SHARED_LIB_SUFFIX'] = '.' + exts['shared_library']
1692
+
1693
+ # Copy additional generator configuration data from VS, which is shared
1694
+ # by the Windows Ninja generator.
1695
+ import gyp.generator.msvs as msvs_generator
1696
+ generator_additional_non_configuration_keys = getattr(msvs_generator,
1697
+ 'generator_additional_non_configuration_keys', [])
1698
+ generator_additional_path_sections = getattr(msvs_generator,
1699
+ 'generator_additional_path_sections', [])
1700
+
1701
+ gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
1702
+ else:
1703
+ operating_system = flavor
1704
+ if flavor == 'android':
1705
+ operating_system = 'linux' # Keep this legacy behavior for now.
1706
+ default_variables.setdefault('OS', operating_system)
1707
+ default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
1708
+ default_variables.setdefault('SHARED_LIB_DIR',
1709
+ os.path.join('$!PRODUCT_DIR', 'lib'))
1710
+ default_variables.setdefault('LIB_DIR',
1711
+ os.path.join('$!PRODUCT_DIR', 'obj'))
1712
+
1713
+ def ComputeOutputDir(params):
1714
+ """Returns the path from the toplevel_dir to the build output directory."""
1715
+ # generator_dir: relative path from pwd to where make puts build files.
1716
+ # Makes migrating from make to ninja easier, ninja doesn't put anything here.
1717
+ generator_dir = os.path.relpath(params['options'].generator_output or '.')
1718
+
1719
+ # output_dir: relative path from generator_dir to the build directory.
1720
+ output_dir = params.get('generator_flags', {}).get('output_dir', 'out')
1721
+
1722
+ # Relative path from source root to our output files. e.g. "out"
1723
+ return os.path.normpath(os.path.join(generator_dir, output_dir))
1724
+
1725
+
1726
+ def CalculateGeneratorInputInfo(params):
1727
+ """Called by __init__ to initialize generator values based on params."""
1728
+ # E.g. "out/gypfiles"
1729
+ toplevel = params['options'].toplevel_dir
1730
+ qualified_out_dir = os.path.normpath(os.path.join(
1731
+ toplevel, ComputeOutputDir(params), 'gypfiles'))
1732
+
1733
+ global generator_filelist_paths
1734
+ generator_filelist_paths = {
1735
+ 'toplevel': toplevel,
1736
+ 'qualified_out_dir': qualified_out_dir,
1737
+ }
1738
+
1739
+
1740
+ def OpenOutput(path, mode='w'):
1741
+ """Open |path| for writing, creating directories if necessary."""
1742
+ gyp.common.EnsureDirExists(path)
1743
+ return open(path, mode)
1744
+
1745
+
1746
+ def CommandWithWrapper(cmd, wrappers, prog):
1747
+ wrapper = wrappers.get(cmd, '')
1748
+ if wrapper:
1749
+ return wrapper + ' ' + prog
1750
+ return prog
1751
+
1752
+
1753
+ def GetDefaultConcurrentLinks():
1754
+ """Returns a best-guess for a number of concurrent links."""
1755
+ pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))
1756
+ if pool_size:
1757
+ return pool_size
1758
+
1759
+ if sys.platform in ('win32', 'cygwin'):
1760
+ import ctypes
1761
+
1762
+ class MEMORYSTATUSEX(ctypes.Structure):
1763
+ _fields_ = [
1764
+ ("dwLength", ctypes.c_ulong),
1765
+ ("dwMemoryLoad", ctypes.c_ulong),
1766
+ ("ullTotalPhys", ctypes.c_ulonglong),
1767
+ ("ullAvailPhys", ctypes.c_ulonglong),
1768
+ ("ullTotalPageFile", ctypes.c_ulonglong),
1769
+ ("ullAvailPageFile", ctypes.c_ulonglong),
1770
+ ("ullTotalVirtual", ctypes.c_ulonglong),
1771
+ ("ullAvailVirtual", ctypes.c_ulonglong),
1772
+ ("sullAvailExtendedVirtual", ctypes.c_ulonglong),
1773
+ ]
1774
+
1775
+ stat = MEMORYSTATUSEX()
1776
+ stat.dwLength = ctypes.sizeof(stat)
1777
+ ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
1778
+
1779
+ # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM
1780
+ # on a 64 GB machine.
1781
+ mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB
1782
+ hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32)))
1783
+ return min(mem_limit, hard_cap)
1784
+ elif sys.platform.startswith('linux'):
1785
+ if os.path.exists("/proc/meminfo"):
1786
+ with open("/proc/meminfo") as meminfo:
1787
+ memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB')
1788
+ for line in meminfo:
1789
+ match = memtotal_re.match(line)
1790
+ if not match:
1791
+ continue
1792
+ # Allow 8Gb per link on Linux because Gold is quite memory hungry
1793
+ return max(1, int(match.group(1)) // (8 * (2 ** 20)))
1794
+ return 1
1795
+ elif sys.platform == 'darwin':
1796
+ try:
1797
+ avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.memsize']))
1798
+ # A static library debug build of Chromium's unit_tests takes ~2.7GB, so
1799
+ # 4GB per ld process allows for some more bloat.
1800
+ return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB
1801
+ except:
1802
+ return 1
1803
+ else:
1804
+ # TODO(scottmg): Implement this for other platforms.
1805
+ return 1
1806
+
1807
+
1808
+ def _GetWinLinkRuleNameSuffix(embed_manifest):
1809
+ """Returns the suffix used to select an appropriate linking rule depending on
1810
+ whether the manifest embedding is enabled."""
1811
+ return '_embed' if embed_manifest else ''
1812
+
1813
+
1814
+ def _AddWinLinkRules(master_ninja, embed_manifest):
1815
+ """Adds link rules for Windows platform to |master_ninja|."""
1816
+ def FullLinkCommand(ldcmd, out, binary_type):
1817
+ resource_name = {
1818
+ 'exe': '1',
1819
+ 'dll': '2',
1820
+ }[binary_type]
1821
+ return '%(python)s gyp-win-tool link-with-manifests $arch %(embed)s ' \
1822
+ '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' \
1823
+ '$manifests' % {
1824
+ 'python': sys.executable,
1825
+ 'out': out,
1826
+ 'ldcmd': ldcmd,
1827
+ 'resname': resource_name,
1828
+ 'embed': embed_manifest }
1829
+ rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest)
1830
+ use_separate_mspdbsrv = (
1831
+ int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0)
1832
+ dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper()
1833
+ dllcmd = ('%s gyp-win-tool link-wrapper $arch %s '
1834
+ '$ld /nologo $implibflag /DLL /OUT:$binary '
1835
+ '@$binary.rsp' % (sys.executable, use_separate_mspdbsrv))
1836
+ dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll')
1837
+ master_ninja.rule('solink' + rule_name_suffix,
1838
+ description=dlldesc, command=dllcmd,
1839
+ rspfile='$binary.rsp',
1840
+ rspfile_content='$libs $in_newline $ldflags',
1841
+ restat=True,
1842
+ pool='link_pool')
1843
+ master_ninja.rule('solink_module' + rule_name_suffix,
1844
+ description=dlldesc, command=dllcmd,
1845
+ rspfile='$binary.rsp',
1846
+ rspfile_content='$libs $in_newline $ldflags',
1847
+ restat=True,
1848
+ pool='link_pool')
1849
+ # Note that ldflags goes at the end so that it has the option of
1850
+ # overriding default settings earlier in the command line.
1851
+ exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s '
1852
+ '$ld /nologo /OUT:$binary @$binary.rsp' %
1853
+ (sys.executable, use_separate_mspdbsrv))
1854
+ exe_cmd = FullLinkCommand(exe_cmd, '$binary', 'exe')
1855
+ master_ninja.rule('link' + rule_name_suffix,
1856
+ description='LINK%s $binary' % rule_name_suffix.upper(),
1857
+ command=exe_cmd,
1858
+ rspfile='$binary.rsp',
1859
+ rspfile_content='$in_newline $libs $ldflags',
1860
+ pool='link_pool')
1861
+
1862
+
1863
+ def GenerateOutputForConfig(target_list, target_dicts, data, params,
1864
+ config_name):
1865
+ options = params['options']
1866
+ flavor = gyp.common.GetFlavor(params)
1867
+ generator_flags = params.get('generator_flags', {})
1868
+
1869
+ # build_dir: relative path from source root to our output files.
1870
+ # e.g. "out/Debug"
1871
+ build_dir = os.path.normpath(
1872
+ os.path.join(ComputeOutputDir(params), config_name))
1873
+
1874
+ toplevel_build = os.path.join(options.toplevel_dir, build_dir)
1875
+
1876
+ master_ninja_file = OpenOutput(os.path.join(toplevel_build, 'build.ninja'))
1877
+ master_ninja = ninja_syntax.Writer(master_ninja_file, width=120)
1878
+
1879
+ # Put build-time support tools in out/{config_name}.
1880
+ gyp.common.CopyTool(flavor, toplevel_build, generator_flags)
1881
+
1882
+ # Grab make settings for CC/CXX.
1883
+ # The rules are
1884
+ # - The priority from low to high is gcc/g++, the 'make_global_settings' in
1885
+ # gyp, the environment variable.
1886
+ # - If there is no 'make_global_settings' for CC.host/CXX.host or
1887
+ # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set
1888
+ # to cc/cxx.
1889
+ if flavor == 'win':
1890
+ ar = 'lib.exe'
1891
+ # cc and cxx must be set to the correct architecture by overriding with one
1892
+ # of cl_x86 or cl_x64 below.
1893
+ cc = 'UNSET'
1894
+ cxx = 'UNSET'
1895
+ ld = 'link.exe'
1896
+ ld_host = '$ld'
1897
+ else:
1898
+ ar = 'ar'
1899
+ cc = 'cc'
1900
+ cxx = 'c++'
1901
+ ld = '$cc'
1902
+ ldxx = '$cxx'
1903
+ ld_host = '$cc_host'
1904
+ ldxx_host = '$cxx_host'
1905
+
1906
+ ar_host = ar
1907
+ cc_host = None
1908
+ cxx_host = None
1909
+ cc_host_global_setting = None
1910
+ cxx_host_global_setting = None
1911
+ clang_cl = None
1912
+ nm = 'nm'
1913
+ nm_host = 'nm'
1914
+ readelf = 'readelf'
1915
+ readelf_host = 'readelf'
1916
+
1917
+ build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
1918
+ make_global_settings = data[build_file].get('make_global_settings', [])
1919
+ build_to_root = gyp.common.InvertRelativePath(build_dir,
1920
+ options.toplevel_dir)
1921
+ wrappers = {}
1922
+ for key, value in make_global_settings:
1923
+ if key == 'AR':
1924
+ ar = os.path.join(build_to_root, value)
1925
+ if key == 'AR.host':
1926
+ ar_host = os.path.join(build_to_root, value)
1927
+ if key == 'CC':
1928
+ cc = os.path.join(build_to_root, value)
1929
+ if cc.endswith('clang-cl'):
1930
+ clang_cl = cc
1931
+ if key == 'CXX':
1932
+ cxx = os.path.join(build_to_root, value)
1933
+ if key == 'CC.host':
1934
+ cc_host = os.path.join(build_to_root, value)
1935
+ cc_host_global_setting = value
1936
+ if key == 'CXX.host':
1937
+ cxx_host = os.path.join(build_to_root, value)
1938
+ cxx_host_global_setting = value
1939
+ if key == 'LD':
1940
+ ld = os.path.join(build_to_root, value)
1941
+ if key == 'LD.host':
1942
+ ld_host = os.path.join(build_to_root, value)
1943
+ if key == 'NM':
1944
+ nm = os.path.join(build_to_root, value)
1945
+ if key == 'NM.host':
1946
+ nm_host = os.path.join(build_to_root, value)
1947
+ if key == 'READELF':
1948
+ readelf = os.path.join(build_to_root, value)
1949
+ if key == 'READELF.host':
1950
+ readelf_host = os.path.join(build_to_root, value)
1951
+ if key.endswith('_wrapper'):
1952
+ wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value)
1953
+
1954
+ # Support wrappers from environment variables too.
1955
+ for key, value in os.environ.items():
1956
+ if key.lower().endswith('_wrapper'):
1957
+ key_prefix = key[:-len('_wrapper')]
1958
+ key_prefix = re.sub(r'\.HOST$', '.host', key_prefix)
1959
+ wrappers[key_prefix] = os.path.join(build_to_root, value)
1960
+
1961
+ mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None)
1962
+ if mac_toolchain_dir:
1963
+ wrappers['LINK'] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir
1964
+
1965
+ if flavor == 'win':
1966
+ configs = [target_dicts[qualified_target]['configurations'][config_name]
1967
+ for qualified_target in target_list]
1968
+ shared_system_includes = None
1969
+ if not generator_flags.get('ninja_use_custom_environment_files', 0):
1970
+ shared_system_includes = \
1971
+ gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes(
1972
+ configs, generator_flags)
1973
+ cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles(
1974
+ toplevel_build, generator_flags, shared_system_includes, OpenOutput)
1975
+ for arch, path in sorted(cl_paths.items()):
1976
+ if clang_cl:
1977
+ # If we have selected clang-cl, use that instead.
1978
+ path = clang_cl
1979
+ command = CommandWithWrapper('CC', wrappers,
1980
+ QuoteShellArgument(path, 'win'))
1981
+ if clang_cl:
1982
+ # Use clang-cl to cross-compile for x86 or x86_64.
1983
+ command += (' -m32' if arch == 'x86' else ' -m64')
1984
+ master_ninja.variable('cl_' + arch, command)
1985
+
1986
+ cc = GetEnvironFallback(['CC_target', 'CC'], cc)
1987
+ master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc))
1988
+ cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx)
1989
+ master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx))
1990
+
1991
+ if flavor == 'win':
1992
+ master_ninja.variable('ld', ld)
1993
+ master_ninja.variable('idl', 'midl.exe')
1994
+ master_ninja.variable('ar', ar)
1995
+ master_ninja.variable('rc', 'rc.exe')
1996
+ master_ninja.variable('ml_x86', 'ml.exe')
1997
+ master_ninja.variable('ml_x64', 'ml64.exe')
1998
+ master_ninja.variable('mt', 'mt.exe')
1999
+ else:
2000
+ master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld))
2001
+ master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx))
2002
+ master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar))
2003
+ if flavor != 'mac':
2004
+ # Mac does not use readelf/nm for .TOC generation, so avoiding polluting
2005
+ # the master ninja with extra unused variables.
2006
+ master_ninja.variable(
2007
+ 'nm', GetEnvironFallback(['NM_target', 'NM'], nm))
2008
+ master_ninja.variable(
2009
+ 'readelf', GetEnvironFallback(['READELF_target', 'READELF'], readelf))
2010
+
2011
+ if generator_supports_multiple_toolsets:
2012
+ if not cc_host:
2013
+ cc_host = cc
2014
+ if not cxx_host:
2015
+ cxx_host = cxx
2016
+
2017
+ master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host))
2018
+ master_ninja.variable('nm_host', GetEnvironFallback(['NM_host'], nm_host))
2019
+ master_ninja.variable('readelf_host',
2020
+ GetEnvironFallback(['READELF_host'], readelf_host))
2021
+ cc_host = GetEnvironFallback(['CC_host'], cc_host)
2022
+ cxx_host = GetEnvironFallback(['CXX_host'], cxx_host)
2023
+
2024
+ # The environment variable could be used in 'make_global_settings', like
2025
+ # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here.
2026
+ if '$(CC)' in cc_host and cc_host_global_setting:
2027
+ cc_host = cc_host_global_setting.replace('$(CC)', cc)
2028
+ if '$(CXX)' in cxx_host and cxx_host_global_setting:
2029
+ cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx)
2030
+ master_ninja.variable('cc_host',
2031
+ CommandWithWrapper('CC.host', wrappers, cc_host))
2032
+ master_ninja.variable('cxx_host',
2033
+ CommandWithWrapper('CXX.host', wrappers, cxx_host))
2034
+ if flavor == 'win':
2035
+ master_ninja.variable('ld_host', ld_host)
2036
+ else:
2037
+ master_ninja.variable('ld_host', CommandWithWrapper(
2038
+ 'LINK', wrappers, ld_host))
2039
+ master_ninja.variable('ldxx_host', CommandWithWrapper(
2040
+ 'LINK', wrappers, ldxx_host))
2041
+
2042
+ master_ninja.newline()
2043
+
2044
+ master_ninja.pool('link_pool', depth=GetDefaultConcurrentLinks())
2045
+ master_ninja.newline()
2046
+
2047
+ deps = 'msvc' if flavor == 'win' else 'gcc'
2048
+
2049
+ if flavor != 'win':
2050
+ master_ninja.rule(
2051
+ 'cc',
2052
+ description='CC $out',
2053
+ command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c '
2054
+ '$cflags_pch_c -c $in -o $out'),
2055
+ depfile='$out.d',
2056
+ deps=deps)
2057
+ master_ninja.rule(
2058
+ 'cc_s',
2059
+ description='CC $out',
2060
+ command=('$cc $defines $includes $cflags $cflags_c '
2061
+ '$cflags_pch_c -c $in -o $out'))
2062
+ master_ninja.rule(
2063
+ 'cxx',
2064
+ description='CXX $out',
2065
+ command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc '
2066
+ '$cflags_pch_cc -c $in -o $out'),
2067
+ depfile='$out.d',
2068
+ deps=deps)
2069
+ else:
2070
+ # TODO(scottmg) Separate pdb names is a test to see if it works around
2071
+ # http://crbug.com/142362. It seems there's a race between the creation of
2072
+ # the .pdb by the precompiled header step for .cc and the compilation of
2073
+ # .c files. This should be handled by mspdbsrv, but rarely errors out with
2074
+ # c1xx : fatal error C1033: cannot open program database
2075
+ # By making the rules target separate pdb files this might be avoided.
2076
+ cc_command = ('ninja -t msvc -e $arch ' +
2077
+ '-- '
2078
+ '$cc /nologo /showIncludes /FC '
2079
+ '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ')
2080
+ cxx_command = ('ninja -t msvc -e $arch ' +
2081
+ '-- '
2082
+ '$cxx /nologo /showIncludes /FC '
2083
+ '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ')
2084
+ master_ninja.rule(
2085
+ 'cc',
2086
+ description='CC $out',
2087
+ command=cc_command,
2088
+ rspfile='$out.rsp',
2089
+ rspfile_content='$defines $includes $cflags $cflags_c',
2090
+ deps=deps)
2091
+ master_ninja.rule(
2092
+ 'cxx',
2093
+ description='CXX $out',
2094
+ command=cxx_command,
2095
+ rspfile='$out.rsp',
2096
+ rspfile_content='$defines $includes $cflags $cflags_cc',
2097
+ deps=deps)
2098
+ master_ninja.rule(
2099
+ 'idl',
2100
+ description='IDL $in',
2101
+ command=('%s gyp-win-tool midl-wrapper $arch $outdir '
2102
+ '$tlb $h $dlldata $iid $proxy $in '
2103
+ '$midl_includes $idlflags' % sys.executable))
2104
+ master_ninja.rule(
2105
+ 'rc',
2106
+ description='RC $in',
2107
+ # Note: $in must be last otherwise rc.exe complains.
2108
+ command=('%s gyp-win-tool rc-wrapper '
2109
+ '$arch $rc $defines $resource_includes $rcflags /fo$out $in' %
2110
+ sys.executable))
2111
+ master_ninja.rule(
2112
+ 'asm',
2113
+ description='ASM $out',
2114
+ command=('%s gyp-win-tool asm-wrapper '
2115
+ '$arch $asm $defines $includes $asmflags /c /Fo $out $in' %
2116
+ sys.executable))
2117
+
2118
+ if flavor != 'mac' and flavor != 'win':
2119
+ master_ninja.rule(
2120
+ 'alink',
2121
+ description='AR $out',
2122
+ command='rm -f $out && $ar rcs $arflags $out $in')
2123
+ master_ninja.rule(
2124
+ 'alink_thin',
2125
+ description='AR $out',
2126
+ command='rm -f $out && $ar rcsT $arflags $out $in')
2127
+
2128
+ # This allows targets that only need to depend on $lib's API to declare an
2129
+ # order-only dependency on $lib.TOC and avoid relinking such downstream
2130
+ # dependencies when $lib changes only in non-public ways.
2131
+ # The resulting string leaves an uninterpolated %{suffix} which
2132
+ # is used in the final substitution below.
2133
+ mtime_preserving_solink_base = (
2134
+ 'if [ ! -e $lib -o ! -e $lib.TOC ]; then '
2135
+ '%(solink)s && %(extract_toc)s > $lib.TOC; else '
2136
+ '%(solink)s && %(extract_toc)s > $lib.tmp && '
2137
+ 'if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; '
2138
+ 'fi; fi'
2139
+ % { 'solink':
2140
+ '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s',
2141
+ 'extract_toc':
2142
+ ('{ $readelf -d $lib | grep SONAME ; '
2143
+ '$nm -gD -f p $lib | cut -f1-2 -d\' \'; }')})
2144
+
2145
+ master_ninja.rule(
2146
+ 'solink',
2147
+ description='SOLINK $lib',
2148
+ restat=True,
2149
+ command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'},
2150
+ rspfile='$link_file_list',
2151
+ rspfile_content=
2152
+ '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs',
2153
+ pool='link_pool')
2154
+ master_ninja.rule(
2155
+ 'solink_module',
2156
+ description='SOLINK(module) $lib',
2157
+ restat=True,
2158
+ command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'},
2159
+ rspfile='$link_file_list',
2160
+ rspfile_content='-Wl,--start-group $in -Wl,--end-group $solibs $libs',
2161
+ pool='link_pool')
2162
+ master_ninja.rule(
2163
+ 'link',
2164
+ description='LINK $out',
2165
+ command=('$ld $ldflags -o $out '
2166
+ '-Wl,--start-group $in -Wl,--end-group $solibs $libs'),
2167
+ pool='link_pool')
2168
+ elif flavor == 'win':
2169
+ master_ninja.rule(
2170
+ 'alink',
2171
+ description='LIB $out',
2172
+ command=('%s gyp-win-tool link-wrapper $arch False '
2173
+ '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' %
2174
+ sys.executable),
2175
+ rspfile='$out.rsp',
2176
+ rspfile_content='$in_newline $libflags')
2177
+ _AddWinLinkRules(master_ninja, embed_manifest=True)
2178
+ _AddWinLinkRules(master_ninja, embed_manifest=False)
2179
+ else:
2180
+ master_ninja.rule(
2181
+ 'objc',
2182
+ description='OBJC $out',
2183
+ command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc '
2184
+ '$cflags_pch_objc -c $in -o $out'),
2185
+ depfile='$out.d',
2186
+ deps=deps)
2187
+ master_ninja.rule(
2188
+ 'objcxx',
2189
+ description='OBJCXX $out',
2190
+ command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc '
2191
+ '$cflags_pch_objcc -c $in -o $out'),
2192
+ depfile='$out.d',
2193
+ deps=deps)
2194
+ master_ninja.rule(
2195
+ 'alink',
2196
+ description='LIBTOOL-STATIC $out, POSTBUILDS',
2197
+ command='rm -f $out && '
2198
+ './gyp-mac-tool filter-libtool libtool $libtool_flags '
2199
+ '-static -o $out $in'
2200
+ '$postbuilds')
2201
+ master_ninja.rule(
2202
+ 'lipo',
2203
+ description='LIPO $out, POSTBUILDS',
2204
+ command='rm -f $out && lipo -create $in -output $out$postbuilds')
2205
+ master_ninja.rule(
2206
+ 'solipo',
2207
+ description='SOLIPO $out, POSTBUILDS',
2208
+ command=(
2209
+ 'rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&'
2210
+ '%(extract_toc)s > $lib.TOC'
2211
+ % { 'extract_toc':
2212
+ '{ otool -l $lib | grep LC_ID_DYLIB -A 5; '
2213
+ 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}))
2214
+
2215
+
2216
+ # Record the public interface of $lib in $lib.TOC. See the corresponding
2217
+ # comment in the posix section above for details.
2218
+ solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s'
2219
+ mtime_preserving_solink_base = (
2220
+ 'if [ ! -e $lib -o ! -e $lib.TOC ] || '
2221
+ # Always force dependent targets to relink if this library
2222
+ # reexports something. Handling this correctly would require
2223
+ # recursive TOC dumping but this is rare in practice, so punt.
2224
+ 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then '
2225
+ '%(solink)s && %(extract_toc)s > $lib.TOC; '
2226
+ 'else '
2227
+ '%(solink)s && %(extract_toc)s > $lib.tmp && '
2228
+ 'if ! cmp -s $lib.tmp $lib.TOC; then '
2229
+ 'mv $lib.tmp $lib.TOC ; '
2230
+ 'fi; '
2231
+ 'fi'
2232
+ % { 'solink': solink_base,
2233
+ 'extract_toc':
2234
+ '{ otool -l $lib | grep LC_ID_DYLIB -A 5; '
2235
+ 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'})
2236
+
2237
+
2238
+ solink_suffix = '@$link_file_list$postbuilds'
2239
+ master_ninja.rule(
2240
+ 'solink',
2241
+ description='SOLINK $lib, POSTBUILDS',
2242
+ restat=True,
2243
+ command=mtime_preserving_solink_base % {'suffix': solink_suffix,
2244
+ 'type': '-shared'},
2245
+ rspfile='$link_file_list',
2246
+ rspfile_content='$in $solibs $libs',
2247
+ pool='link_pool')
2248
+ master_ninja.rule(
2249
+ 'solink_notoc',
2250
+ description='SOLINK $lib, POSTBUILDS',
2251
+ restat=True,
2252
+ command=solink_base % {'suffix':solink_suffix, 'type': '-shared'},
2253
+ rspfile='$link_file_list',
2254
+ rspfile_content='$in $solibs $libs',
2255
+ pool='link_pool')
2256
+
2257
+ master_ninja.rule(
2258
+ 'solink_module',
2259
+ description='SOLINK(module) $lib, POSTBUILDS',
2260
+ restat=True,
2261
+ command=mtime_preserving_solink_base % {'suffix': solink_suffix,
2262
+ 'type': '-bundle'},
2263
+ rspfile='$link_file_list',
2264
+ rspfile_content='$in $solibs $libs',
2265
+ pool='link_pool')
2266
+ master_ninja.rule(
2267
+ 'solink_module_notoc',
2268
+ description='SOLINK(module) $lib, POSTBUILDS',
2269
+ restat=True,
2270
+ command=solink_base % {'suffix': solink_suffix, 'type': '-bundle'},
2271
+ rspfile='$link_file_list',
2272
+ rspfile_content='$in $solibs $libs',
2273
+ pool='link_pool')
2274
+
2275
+ master_ninja.rule(
2276
+ 'link',
2277
+ description='LINK $out, POSTBUILDS',
2278
+ command=('$ld $ldflags -o $out '
2279
+ '$in $solibs $libs$postbuilds'),
2280
+ pool='link_pool')
2281
+ master_ninja.rule(
2282
+ 'preprocess_infoplist',
2283
+ description='PREPROCESS INFOPLIST $out',
2284
+ command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && '
2285
+ 'plutil -convert xml1 $out $out'))
2286
+ master_ninja.rule(
2287
+ 'copy_infoplist',
2288
+ description='COPY INFOPLIST $in',
2289
+ command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys')
2290
+ master_ninja.rule(
2291
+ 'merge_infoplist',
2292
+ description='MERGE INFOPLISTS $in',
2293
+ command='$env ./gyp-mac-tool merge-info-plist $out $in')
2294
+ master_ninja.rule(
2295
+ 'compile_xcassets',
2296
+ description='COMPILE XCASSETS $in',
2297
+ command='$env ./gyp-mac-tool compile-xcassets $keys $in')
2298
+ master_ninja.rule(
2299
+ 'compile_ios_framework_headers',
2300
+ description='COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in',
2301
+ command='$env ./gyp-mac-tool compile-ios-framework-header-map $out '
2302
+ '$framework $in && $env ./gyp-mac-tool '
2303
+ 'copy-ios-framework-headers $framework $copy_headers')
2304
+ master_ninja.rule(
2305
+ 'mac_tool',
2306
+ description='MACTOOL $mactool_cmd $in',
2307
+ command='$env ./gyp-mac-tool $mactool_cmd $in $out $binary')
2308
+ master_ninja.rule(
2309
+ 'package_framework',
2310
+ description='PACKAGE FRAMEWORK $out, POSTBUILDS',
2311
+ command='./gyp-mac-tool package-framework $out $version$postbuilds '
2312
+ '&& touch $out')
2313
+ master_ninja.rule(
2314
+ 'package_ios_framework',
2315
+ description='PACKAGE IOS FRAMEWORK $out, POSTBUILDS',
2316
+ command='./gyp-mac-tool package-ios-framework $out $postbuilds '
2317
+ '&& touch $out')
2318
+ if flavor == 'win':
2319
+ master_ninja.rule(
2320
+ 'stamp',
2321
+ description='STAMP $out',
2322
+ command='%s gyp-win-tool stamp $out' % sys.executable)
2323
+ else:
2324
+ master_ninja.rule(
2325
+ 'stamp',
2326
+ description='STAMP $out',
2327
+ command='${postbuilds}touch $out')
2328
+ if flavor == 'win':
2329
+ master_ninja.rule(
2330
+ 'copy',
2331
+ description='COPY $in $out',
2332
+ command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable)
2333
+ elif flavor == 'zos':
2334
+ master_ninja.rule(
2335
+ 'copy',
2336
+ description='COPY $in $out',
2337
+ command='rm -rf $out && cp -fRP $in $out')
2338
+ else:
2339
+ master_ninja.rule(
2340
+ 'copy',
2341
+ description='COPY $in $out',
2342
+ command='ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)')
2343
+ master_ninja.newline()
2344
+
2345
+ all_targets = set()
2346
+ for build_file in params['build_files']:
2347
+ for target in gyp.common.AllTargets(target_list,
2348
+ target_dicts,
2349
+ os.path.normpath(build_file)):
2350
+ all_targets.add(target)
2351
+ all_outputs = set()
2352
+
2353
+ # target_outputs is a map from qualified target name to a Target object.
2354
+ target_outputs = {}
2355
+ # target_short_names is a map from target short name to a list of Target
2356
+ # objects.
2357
+ target_short_names = {}
2358
+
2359
+ # short name of targets that were skipped because they didn't contain anything
2360
+ # interesting.
2361
+ # NOTE: there may be overlap between this an non_empty_target_names.
2362
+ empty_target_names = set()
2363
+
2364
+ # Set of non-empty short target names.
2365
+ # NOTE: there may be overlap between this an empty_target_names.
2366
+ non_empty_target_names = set()
2367
+
2368
+ for qualified_target in target_list:
2369
+ # qualified_target is like: third_party/icu/icu.gyp:icui18n#target
2370
+ build_file, name, toolset = \
2371
+ gyp.common.ParseQualifiedTarget(qualified_target)
2372
+
2373
+ this_make_global_settings = data[build_file].get('make_global_settings', [])
2374
+ assert make_global_settings == this_make_global_settings, (
2375
+ "make_global_settings needs to be the same for all targets. %s vs. %s" %
2376
+ (this_make_global_settings, make_global_settings))
2377
+
2378
+ spec = target_dicts[qualified_target]
2379
+ if flavor == 'mac':
2380
+ gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec)
2381
+
2382
+ # If build_file is a symlink, we must not follow it because there's a chance
2383
+ # it could point to a path above toplevel_dir, and we cannot correctly deal
2384
+ # with that case at the moment.
2385
+ build_file = gyp.common.RelativePath(build_file, options.toplevel_dir,
2386
+ False)
2387
+
2388
+ qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name,
2389
+ toolset)
2390
+ qualified_target_for_hash = qualified_target_for_hash.encode('utf-8')
2391
+ hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest()
2392
+
2393
+ base_path = os.path.dirname(build_file)
2394
+ obj = 'obj'
2395
+ if toolset != 'target':
2396
+ obj += '.' + toolset
2397
+ output_file = os.path.join(obj, base_path, name + '.ninja')
2398
+
2399
+ ninja_output = StringIO()
2400
+ writer = NinjaWriter(hash_for_rules, target_outputs, base_path, build_dir,
2401
+ ninja_output,
2402
+ toplevel_build, output_file,
2403
+ flavor, toplevel_dir=options.toplevel_dir)
2404
+
2405
+ target = writer.WriteSpec(spec, config_name, generator_flags)
2406
+
2407
+ if ninja_output.tell() > 0:
2408
+ # Only create files for ninja files that actually have contents.
2409
+ with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file:
2410
+ ninja_file.write(ninja_output.getvalue())
2411
+ ninja_output.close()
2412
+ master_ninja.subninja(output_file)
2413
+
2414
+ if target:
2415
+ if name != target.FinalOutput() and spec['toolset'] == 'target':
2416
+ target_short_names.setdefault(name, []).append(target)
2417
+ target_outputs[qualified_target] = target
2418
+ if qualified_target in all_targets:
2419
+ all_outputs.add(target.FinalOutput())
2420
+ non_empty_target_names.add(name)
2421
+ else:
2422
+ empty_target_names.add(name)
2423
+
2424
+ if target_short_names:
2425
+ # Write a short name to build this target. This benefits both the
2426
+ # "build chrome" case as well as the gyp tests, which expect to be
2427
+ # able to run actions and build libraries by their short name.
2428
+ master_ninja.newline()
2429
+ master_ninja.comment('Short names for targets.')
2430
+ for short_name in sorted(target_short_names):
2431
+ master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in
2432
+ target_short_names[short_name]])
2433
+
2434
+ # Write phony targets for any empty targets that weren't written yet. As
2435
+ # short names are not necessarily unique only do this for short names that
2436
+ # haven't already been output for another target.
2437
+ empty_target_names = empty_target_names - non_empty_target_names
2438
+ if empty_target_names:
2439
+ master_ninja.newline()
2440
+ master_ninja.comment('Empty targets (output for completeness).')
2441
+ for name in sorted(empty_target_names):
2442
+ master_ninja.build(name, 'phony')
2443
+
2444
+ if all_outputs:
2445
+ master_ninja.newline()
2446
+ master_ninja.build('all', 'phony', sorted(all_outputs))
2447
+ master_ninja.default(generator_flags.get('default_target', 'all'))
2448
+
2449
+ master_ninja_file.close()
2450
+
2451
+
2452
+ def PerformBuild(data, configurations, params):
2453
+ options = params['options']
2454
+ for config in configurations:
2455
+ builddir = os.path.join(options.toplevel_dir, 'out', config)
2456
+ arguments = ['ninja', '-C', builddir]
2457
+ print('Building [%s]: %s' % (config, arguments))
2458
+ subprocess.check_call(arguments)
2459
+
2460
+
2461
+ def CallGenerateOutputForConfig(arglist):
2462
+ # Ignore the interrupt signal so that the parent process catches it and
2463
+ # kills all multiprocessing children.
2464
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
2465
+
2466
+ (target_list, target_dicts, data, params, config_name) = arglist
2467
+ GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)
2468
+
2469
+
2470
+ def GenerateOutput(target_list, target_dicts, data, params):
2471
+ # Update target_dicts for iOS device builds.
2472
+ target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator(
2473
+ target_dicts)
2474
+
2475
+ user_config = params.get('generator_flags', {}).get('config', None)
2476
+ if gyp.common.GetFlavor(params) == 'win':
2477
+ target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts)
2478
+ target_list, target_dicts = MSVSUtil.InsertLargePdbShims(
2479
+ target_list, target_dicts, generator_default_variables)
2480
+
2481
+ if user_config:
2482
+ GenerateOutputForConfig(target_list, target_dicts, data, params,
2483
+ user_config)
2484
+ else:
2485
+ config_names = target_dicts[target_list[0]]['configurations']
2486
+ if params['parallel']:
2487
+ try:
2488
+ pool = multiprocessing.Pool(len(config_names))
2489
+ arglists = []
2490
+ for config_name in config_names:
2491
+ arglists.append(
2492
+ (target_list, target_dicts, data, params, config_name))
2493
+ pool.map(CallGenerateOutputForConfig, arglists)
2494
+ except KeyboardInterrupt as e:
2495
+ pool.terminate()
2496
+ raise e
2497
+ else:
2498
+ for config_name in config_names:
2499
+ GenerateOutputForConfig(target_list, target_dicts, data, params,
2500
+ config_name)