mt-libuv 4.1.01 → 4.1.02

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2091) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gyp/.gitignore +1 -0
  3. data/ext/gyp/AUTHORS +17 -0
  4. data/ext/gyp/DEPS +23 -0
  5. data/ext/gyp/LICENSE +27 -0
  6. data/ext/gyp/OWNERS +1 -0
  7. data/ext/gyp/PRESUBMIT.py +125 -0
  8. data/ext/gyp/README.md +5 -0
  9. data/ext/gyp/buildbot/buildbot_run.py +138 -0
  10. data/ext/gyp/buildbot/commit_queue/OWNERS +6 -0
  11. data/ext/gyp/buildbot/commit_queue/README +3 -0
  12. data/ext/gyp/buildbot/commit_queue/cq_config.json +15 -0
  13. data/ext/gyp/buildbot/travis-checkout.sh +27 -0
  14. data/ext/gyp/buildbot/travis-test.sh +12 -0
  15. data/ext/gyp/codereview.settings +6 -0
  16. data/ext/gyp/data/win/large-pdb-shim.cc +12 -0
  17. data/ext/gyp/gyp +8 -0
  18. data/ext/gyp/gyp.bat +5 -0
  19. data/ext/gyp/gyp_main.py +16 -0
  20. data/ext/gyp/gyptest.py +243 -0
  21. data/ext/gyp/pylib/gyp/MSVSNew.py +353 -0
  22. data/ext/gyp/pylib/gyp/MSVSProject.py +208 -0
  23. data/ext/gyp/pylib/gyp/MSVSSettings.py +1106 -0
  24. data/ext/gyp/pylib/gyp/MSVSSettings_test.py +1486 -0
  25. data/ext/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  26. data/ext/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  27. data/ext/gyp/pylib/gyp/MSVSUtil.py +271 -0
  28. data/ext/gyp/pylib/gyp/MSVSVersion.py +504 -0
  29. data/ext/gyp/pylib/gyp/__init__.py +555 -0
  30. data/ext/gyp/pylib/gyp/common.py +619 -0
  31. data/ext/gyp/pylib/gyp/common_test.py +73 -0
  32. data/ext/gyp/pylib/gyp/easy_xml.py +170 -0
  33. data/ext/gyp/pylib/gyp/easy_xml_test.py +106 -0
  34. data/ext/gyp/pylib/gyp/flock_tool.py +54 -0
  35. data/ext/gyp/pylib/gyp/generator/__init__.py +0 -0
  36. data/ext/gyp/pylib/gyp/generator/analyzer.py +744 -0
  37. data/ext/gyp/pylib/gyp/generator/cmake.py +1256 -0
  38. data/ext/gyp/pylib/gyp/generator/dump_dependency_json.py +101 -0
  39. data/ext/gyp/pylib/gyp/generator/eclipse.py +425 -0
  40. data/ext/gyp/pylib/gyp/generator/gypd.py +94 -0
  41. data/ext/gyp/pylib/gyp/generator/gypsh.py +56 -0
  42. data/ext/gyp/pylib/gyp/generator/make.py +2260 -0
  43. data/ext/gyp/pylib/gyp/generator/msvs.py +3537 -0
  44. data/ext/gyp/pylib/gyp/generator/msvs_test.py +40 -0
  45. data/ext/gyp/pylib/gyp/generator/ninja.py +2500 -0
  46. data/ext/gyp/pylib/gyp/generator/ninja_test.py +46 -0
  47. data/ext/gyp/pylib/gyp/generator/xcode.py +1302 -0
  48. data/ext/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  49. data/ext/gyp/pylib/gyp/input.py +2908 -0
  50. data/ext/gyp/pylib/gyp/input_test.py +90 -0
  51. data/ext/gyp/pylib/gyp/mac_tool.py +721 -0
  52. data/ext/gyp/pylib/gyp/msvs_emulation.py +1112 -0
  53. data/ext/gyp/pylib/gyp/ninja_syntax.py +168 -0
  54. data/ext/gyp/pylib/gyp/simple_copy.py +57 -0
  55. data/ext/gyp/pylib/gyp/win_tool.py +326 -0
  56. data/ext/gyp/pylib/gyp/xcode_emulation.py +1800 -0
  57. data/ext/gyp/pylib/gyp/xcode_ninja.py +289 -0
  58. data/ext/gyp/pylib/gyp/xcodeproj_file.py +2995 -0
  59. data/ext/gyp/pylib/gyp/xml_fix.py +68 -0
  60. data/ext/gyp/samples/samples +83 -0
  61. data/ext/gyp/samples/samples.bat +5 -0
  62. data/ext/gyp/setup.py +19 -0
  63. data/ext/gyp/test/actions/generated-header/action.py +11 -0
  64. data/ext/gyp/test/actions/generated-header/main.cc +7 -0
  65. data/ext/gyp/test/actions/generated-header/test.gyp +34 -0
  66. data/ext/gyp/test/actions/gyptest-all.py +101 -0
  67. data/ext/gyp/test/actions/gyptest-default.py +68 -0
  68. data/ext/gyp/test/actions/gyptest-errors.py +24 -0
  69. data/ext/gyp/test/actions/gyptest-generated-header.py +38 -0
  70. data/ext/gyp/test/actions/src/action_missing_name.gyp +24 -0
  71. data/ext/gyp/test/actions/src/actions.gyp +114 -0
  72. data/ext/gyp/test/actions/src/confirm-dep-files.py +21 -0
  73. data/ext/gyp/test/actions/src/subdir1/counter.py +44 -0
  74. data/ext/gyp/test/actions/src/subdir1/executable.gyp +74 -0
  75. data/ext/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
  76. data/ext/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
  77. data/ext/gyp/test/actions/src/subdir1/program.c +12 -0
  78. data/ext/gyp/test/actions/src/subdir2/make-file.py +11 -0
  79. data/ext/gyp/test/actions/src/subdir2/none.gyp +33 -0
  80. data/ext/gyp/test/actions/src/subdir3/generate_main.py +21 -0
  81. data/ext/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
  82. data/ext/gyp/test/actions-bare/gyptest-bare.py +24 -0
  83. data/ext/gyp/test/actions-bare/src/bare.gyp +25 -0
  84. data/ext/gyp/test/actions-bare/src/bare.py +11 -0
  85. data/ext/gyp/test/actions-depfile/depfile.gyp +42 -0
  86. data/ext/gyp/test/actions-depfile/gyptest-all.py +30 -0
  87. data/ext/gyp/test/actions-depfile/input.txt +1 -0
  88. data/ext/gyp/test/actions-depfile/touch.py +18 -0
  89. data/ext/gyp/test/actions-multiple/gyptest-all.py +72 -0
  90. data/ext/gyp/test/actions-multiple/src/actions.gyp +226 -0
  91. data/ext/gyp/test/actions-multiple/src/copyfile.py +9 -0
  92. data/ext/gyp/test/actions-multiple/src/filter.py +12 -0
  93. data/ext/gyp/test/actions-multiple/src/foo.c +11 -0
  94. data/ext/gyp/test/actions-multiple/src/input.txt +1 -0
  95. data/ext/gyp/test/actions-multiple/src/main.c +22 -0
  96. data/ext/gyp/test/actions-multiple-outputs/gyptest-multiple-outputs.py +45 -0
  97. data/ext/gyp/test/actions-multiple-outputs/src/multiple-outputs.gyp +23 -0
  98. data/ext/gyp/test/actions-multiple-outputs/src/touch.py +16 -0
  99. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/gyptest-action.py +45 -0
  100. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/action.gyp +28 -0
  101. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/rcopy.py +20 -0
  102. data/ext/gyp/test/actions-none/gyptest-none.py +24 -0
  103. data/ext/gyp/test/actions-none/src/fake_cross.py +12 -0
  104. data/ext/gyp/test/actions-none/src/foo.cc +1 -0
  105. data/ext/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
  106. data/ext/gyp/test/actions-subdir/gyptest-action.py +26 -0
  107. data/ext/gyp/test/actions-subdir/src/make-file.py +11 -0
  108. data/ext/gyp/test/actions-subdir/src/none.gyp +31 -0
  109. data/ext/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
  110. data/ext/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
  111. data/ext/gyp/test/additional-targets/gyptest-additional.py +63 -0
  112. data/ext/gyp/test/additional-targets/src/all.gyp +13 -0
  113. data/ext/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
  114. data/ext/gyp/test/additional-targets/src/dir1/emit.py +11 -0
  115. data/ext/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
  116. data/ext/gyp/test/analyzer/common.gypi +6 -0
  117. data/ext/gyp/test/analyzer/gyptest-analyzer.py +427 -0
  118. data/ext/gyp/test/analyzer/static_library_test.gyp +34 -0
  119. data/ext/gyp/test/analyzer/subdir/subdir.gyp +36 -0
  120. data/ext/gyp/test/analyzer/subdir/subdir2/subdir2.gyp +15 -0
  121. data/ext/gyp/test/analyzer/subdir2/subdir.gyp +18 -0
  122. data/ext/gyp/test/analyzer/subdir2/subdir.includes.gypi +9 -0
  123. data/ext/gyp/test/analyzer/test.gyp +114 -0
  124. data/ext/gyp/test/analyzer/test2.gyp +25 -0
  125. data/ext/gyp/test/analyzer/test2.includes.gypi +13 -0
  126. data/ext/gyp/test/analyzer/test2.includes.includes.gypi +9 -0
  127. data/ext/gyp/test/analyzer/test2.toplevel_includes.gypi +15 -0
  128. data/ext/gyp/test/analyzer/test3.gyp +77 -0
  129. data/ext/gyp/test/analyzer/test4.gyp +80 -0
  130. data/ext/gyp/test/analyzer/test5.gyp +25 -0
  131. data/ext/gyp/test/arflags/gyptest-arflags.py +26 -0
  132. data/ext/gyp/test/arflags/lib.cc +0 -0
  133. data/ext/gyp/test/arflags/test.gyp +10 -0
  134. data/ext/gyp/test/assembly/gyptest-assembly.py +31 -0
  135. data/ext/gyp/test/assembly/gyptest-override.py +24 -0
  136. data/ext/gyp/test/assembly/src/as.bat +4 -0
  137. data/ext/gyp/test/assembly/src/assembly.gyp +62 -0
  138. data/ext/gyp/test/assembly/src/lib1.S +15 -0
  139. data/ext/gyp/test/assembly/src/lib1.c +3 -0
  140. data/ext/gyp/test/assembly/src/override.gyp +34 -0
  141. data/ext/gyp/test/assembly/src/override_asm.asm +8 -0
  142. data/ext/gyp/test/assembly/src/program.c +12 -0
  143. data/ext/gyp/test/build-option/gyptest-build.py +27 -0
  144. data/ext/gyp/test/build-option/hello.c +13 -0
  145. data/ext/gyp/test/build-option/hello.gyp +15 -0
  146. data/ext/gyp/test/builddir/gyptest-all.py +85 -0
  147. data/ext/gyp/test/builddir/gyptest-default.py +85 -0
  148. data/ext/gyp/test/builddir/src/builddir.gypi +18 -0
  149. data/ext/gyp/test/builddir/src/func1.c +6 -0
  150. data/ext/gyp/test/builddir/src/func2.c +6 -0
  151. data/ext/gyp/test/builddir/src/func3.c +6 -0
  152. data/ext/gyp/test/builddir/src/func4.c +6 -0
  153. data/ext/gyp/test/builddir/src/func5.c +6 -0
  154. data/ext/gyp/test/builddir/src/prog1.c +10 -0
  155. data/ext/gyp/test/builddir/src/prog1.gyp +30 -0
  156. data/ext/gyp/test/builddir/src/subdir2/prog2.c +10 -0
  157. data/ext/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
  158. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
  159. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
  160. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
  161. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
  162. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
  163. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
  164. data/ext/gyp/test/cflags/cflags.c +15 -0
  165. data/ext/gyp/test/cflags/cflags.gyp +23 -0
  166. data/ext/gyp/test/cflags/gyptest-cflags.py +75 -0
  167. data/ext/gyp/test/compilable/gyptest-headers.py +29 -0
  168. data/ext/gyp/test/compilable/src/headers.gyp +26 -0
  169. data/ext/gyp/test/compilable/src/lib1.cpp +7 -0
  170. data/ext/gyp/test/compilable/src/lib1.hpp +6 -0
  171. data/ext/gyp/test/compilable/src/program.cpp +9 -0
  172. data/ext/gyp/test/compiler-override/compiler-exe.gyp +16 -0
  173. data/ext/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
  174. data/ext/gyp/test/compiler-override/compiler-host.gyp +17 -0
  175. data/ext/gyp/test/compiler-override/compiler-shared-lib.gyp +16 -0
  176. data/ext/gyp/test/compiler-override/cxxtest.cc +7 -0
  177. data/ext/gyp/test/compiler-override/gyptest-compiler-env-toolchain.py +78 -0
  178. data/ext/gyp/test/compiler-override/gyptest-compiler-env.py +110 -0
  179. data/ext/gyp/test/compiler-override/gyptest-compiler-global-settings.py +82 -0
  180. data/ext/gyp/test/compiler-override/my_cc.py +7 -0
  181. data/ext/gyp/test/compiler-override/my_cxx.py +7 -0
  182. data/ext/gyp/test/compiler-override/my_ld.py +7 -0
  183. data/ext/gyp/test/compiler-override/my_nm.py +9 -0
  184. data/ext/gyp/test/compiler-override/my_readelf.py +9 -0
  185. data/ext/gyp/test/compiler-override/test.c +7 -0
  186. data/ext/gyp/test/conditions/elseif/elseif.gyp +43 -0
  187. data/ext/gyp/test/conditions/elseif/elseif_bad1.gyp +20 -0
  188. data/ext/gyp/test/conditions/elseif/elseif_bad2.gyp +22 -0
  189. data/ext/gyp/test/conditions/elseif/elseif_bad3.gyp +23 -0
  190. data/ext/gyp/test/conditions/elseif/elseif_conditions.gypi +15 -0
  191. data/ext/gyp/test/conditions/elseif/gyptest_elseif.py +33 -0
  192. data/ext/gyp/test/conditions/elseif/program.cc +10 -0
  193. data/ext/gyp/test/configurations/basics/configurations.c +15 -0
  194. data/ext/gyp/test/configurations/basics/configurations.gyp +32 -0
  195. data/ext/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
  196. data/ext/gyp/test/configurations/inheritance/configurations.c +21 -0
  197. data/ext/gyp/test/configurations/inheritance/configurations.gyp +40 -0
  198. data/ext/gyp/test/configurations/inheritance/duplicates.gyp +27 -0
  199. data/ext/gyp/test/configurations/inheritance/duplicates.gypd.golden +12 -0
  200. data/ext/gyp/test/configurations/inheritance/gyptest-duplicates.py +36 -0
  201. data/ext/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
  202. data/ext/gyp/test/configurations/invalid/actions.gyp +18 -0
  203. data/ext/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
  204. data/ext/gyp/test/configurations/invalid/configurations.gyp +18 -0
  205. data/ext/gyp/test/configurations/invalid/dependencies.gyp +18 -0
  206. data/ext/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
  207. data/ext/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
  208. data/ext/gyp/test/configurations/invalid/libraries.gyp +18 -0
  209. data/ext/gyp/test/configurations/invalid/link_settings.gyp +18 -0
  210. data/ext/gyp/test/configurations/invalid/sources.gyp +18 -0
  211. data/ext/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
  212. data/ext/gyp/test/configurations/invalid/target_name.gyp +18 -0
  213. data/ext/gyp/test/configurations/invalid/type.gyp +18 -0
  214. data/ext/gyp/test/configurations/target_platform/configurations.gyp +58 -0
  215. data/ext/gyp/test/configurations/target_platform/front.c +8 -0
  216. data/ext/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
  217. data/ext/gyp/test/configurations/target_platform/left.c +3 -0
  218. data/ext/gyp/test/configurations/target_platform/right.c +3 -0
  219. data/ext/gyp/test/configurations/x64/configurations.c +12 -0
  220. data/ext/gyp/test/configurations/x64/configurations.gyp +38 -0
  221. data/ext/gyp/test/configurations/x64/gyptest-x86.py +31 -0
  222. data/ext/gyp/test/copies/gyptest-all.py +42 -0
  223. data/ext/gyp/test/copies/gyptest-attribs.py +41 -0
  224. data/ext/gyp/test/copies/gyptest-default.py +42 -0
  225. data/ext/gyp/test/copies/gyptest-samedir.py +28 -0
  226. data/ext/gyp/test/copies/gyptest-slash.py +39 -0
  227. data/ext/gyp/test/copies/gyptest-sourceless-shared-lib.py +20 -0
  228. data/ext/gyp/test/copies/gyptest-updir.py +32 -0
  229. data/ext/gyp/test/copies/src/copies-attribs.gyp +20 -0
  230. data/ext/gyp/test/copies/src/copies-samedir.gyp +37 -0
  231. data/ext/gyp/test/copies/src/copies-slash.gyp +36 -0
  232. data/ext/gyp/test/copies/src/copies-sourceless-shared-lib.gyp +27 -0
  233. data/ext/gyp/test/copies/src/copies-updir.gyp +21 -0
  234. data/ext/gyp/test/copies/src/copies.gyp +70 -0
  235. data/ext/gyp/test/copies/src/directory/file3 +1 -0
  236. data/ext/gyp/test/copies/src/directory/file4 +1 -0
  237. data/ext/gyp/test/copies/src/directory/subdir/file5 +1 -0
  238. data/ext/gyp/test/copies/src/executable-file.sh +3 -0
  239. data/ext/gyp/test/copies/src/file1 +1 -0
  240. data/ext/gyp/test/copies/src/file2 +1 -0
  241. data/ext/gyp/test/copies/src/foo.c +13 -0
  242. data/ext/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
  243. data/ext/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
  244. data/ext/gyp/test/custom-generator/mygenerator.py +14 -0
  245. data/ext/gyp/test/custom-generator/test.gyp +15 -0
  246. data/ext/gyp/test/cxxflags/cxxflags.cc +15 -0
  247. data/ext/gyp/test/cxxflags/cxxflags.gyp +15 -0
  248. data/ext/gyp/test/cxxflags/gyptest-cxxflags.py +45 -0
  249. data/ext/gyp/test/defines/defines-env.gyp +22 -0
  250. data/ext/gyp/test/defines/defines.c +23 -0
  251. data/ext/gyp/test/defines/defines.gyp +38 -0
  252. data/ext/gyp/test/defines/gyptest-define-override.py +43 -0
  253. data/ext/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
  254. data/ext/gyp/test/defines/gyptest-defines-env.py +85 -0
  255. data/ext/gyp/test/defines/gyptest-defines.py +39 -0
  256. data/ext/gyp/test/defines-escaping/defines-escaping.c +11 -0
  257. data/ext/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
  258. data/ext/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
  259. data/ext/gyp/test/dependencies/a.c +9 -0
  260. data/ext/gyp/test/dependencies/adso/all_dependent_settings_order.gyp +45 -0
  261. data/ext/gyp/test/dependencies/adso/write_args.py +11 -0
  262. data/ext/gyp/test/dependencies/b/b.c +3 -0
  263. data/ext/gyp/test/dependencies/b/b.gyp +22 -0
  264. data/ext/gyp/test/dependencies/b/b3.c +9 -0
  265. data/ext/gyp/test/dependencies/c/c.c +4 -0
  266. data/ext/gyp/test/dependencies/c/c.gyp +22 -0
  267. data/ext/gyp/test/dependencies/c/d.c +3 -0
  268. data/ext/gyp/test/dependencies/double_dependency.gyp +23 -0
  269. data/ext/gyp/test/dependencies/double_dependent.gyp +12 -0
  270. data/ext/gyp/test/dependencies/extra_targets.gyp +18 -0
  271. data/ext/gyp/test/dependencies/gyptest-all-dependent-settings-order.py +19 -0
  272. data/ext/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
  273. data/ext/gyp/test/dependencies/gyptest-extra-targets.py +22 -0
  274. data/ext/gyp/test/dependencies/gyptest-indirect-module-dependency.py +22 -0
  275. data/ext/gyp/test/dependencies/gyptest-lib-only.py +39 -0
  276. data/ext/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
  277. data/ext/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
  278. data/ext/gyp/test/dependencies/lib_only.gyp +16 -0
  279. data/ext/gyp/test/dependencies/main.c +14 -0
  280. data/ext/gyp/test/dependencies/module-dep/a.cc +7 -0
  281. data/ext/gyp/test/dependencies/module-dep/dll.cc +9 -0
  282. data/ext/gyp/test/dependencies/module-dep/exe.cc +7 -0
  283. data/ext/gyp/test/dependencies/module-dep/indirect-module-dependency.gyp +37 -0
  284. data/ext/gyp/test/dependencies/none_traversal.gyp +46 -0
  285. data/ext/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
  286. data/ext/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
  287. data/ext/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
  288. data/ext/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
  289. data/ext/gyp/test/dependency-copy/gyptest-copy.py +26 -0
  290. data/ext/gyp/test/dependency-copy/src/copies.gyp +25 -0
  291. data/ext/gyp/test/dependency-copy/src/file1.c +7 -0
  292. data/ext/gyp/test/dependency-copy/src/file2.c +7 -0
  293. data/ext/gyp/test/dependent-settings/nested-dependent-settings/all-dependent-settings.gyp +19 -0
  294. data/ext/gyp/test/dependent-settings/nested-dependent-settings/direct-dependent-settings.gyp +19 -0
  295. data/ext/gyp/test/dependent-settings/nested-dependent-settings/gyptest-nested-dependent-settings.py +18 -0
  296. data/ext/gyp/test/determinism/determinism.gyp +59 -0
  297. data/ext/gyp/test/determinism/empty-targets.gyp +32 -0
  298. data/ext/gyp/test/determinism/gyptest-determinism.py +30 -0
  299. data/ext/gyp/test/determinism/gyptest-empty-target-names.py +30 -0
  300. data/ext/gyp/test/determinism/gyptest-needed-variables.py +30 -0
  301. data/ext/gyp/test/determinism/gyptest-solibs.py +37 -0
  302. data/ext/gyp/test/determinism/main.cc +5 -0
  303. data/ext/gyp/test/determinism/needed-variables.gyp +33 -0
  304. data/ext/gyp/test/determinism/rule.py +8 -0
  305. data/ext/gyp/test/determinism/solib.cc +8 -0
  306. data/ext/gyp/test/determinism/solibs.gyp +32 -0
  307. data/ext/gyp/test/empty-target/empty-target.gyp +12 -0
  308. data/ext/gyp/test/empty-target/gyptest-empty-target.py +18 -0
  309. data/ext/gyp/test/errors/dependency_cycle.gyp +23 -0
  310. data/ext/gyp/test/errors/duplicate_basenames.gyp +13 -0
  311. data/ext/gyp/test/errors/duplicate_node.gyp +12 -0
  312. data/ext/gyp/test/errors/duplicate_rule.gyp +22 -0
  313. data/ext/gyp/test/errors/duplicate_targets.gyp +14 -0
  314. data/ext/gyp/test/errors/error_command.gyp +12 -0
  315. data/ext/gyp/test/errors/file_cycle0.gyp +17 -0
  316. data/ext/gyp/test/errors/file_cycle1.gyp +13 -0
  317. data/ext/gyp/test/errors/gyptest-errors.py +80 -0
  318. data/ext/gyp/test/errors/missing_command.gyp +12 -0
  319. data/ext/gyp/test/errors/missing_dep.gyp +15 -0
  320. data/ext/gyp/test/errors/missing_targets.gyp +8 -0
  321. data/ext/gyp/test/escaping/colon/test.gyp +21 -0
  322. data/ext/gyp/test/escaping/gyptest-colon.py +51 -0
  323. data/ext/gyp/test/exclusion/exclusion.gyp +23 -0
  324. data/ext/gyp/test/exclusion/gyptest-exclusion.py +22 -0
  325. data/ext/gyp/test/exclusion/hello.c +15 -0
  326. data/ext/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
  327. data/ext/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
  328. data/ext/gyp/test/external-cross-compile/src/bogus2.c +1 -0
  329. data/ext/gyp/test/external-cross-compile/src/cross.gyp +83 -0
  330. data/ext/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
  331. data/ext/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
  332. data/ext/gyp/test/external-cross-compile/src/program.cc +16 -0
  333. data/ext/gyp/test/external-cross-compile/src/test1.cc +1 -0
  334. data/ext/gyp/test/external-cross-compile/src/test2.c +1 -0
  335. data/ext/gyp/test/external-cross-compile/src/test3.cc +1 -0
  336. data/ext/gyp/test/external-cross-compile/src/test4.c +1 -0
  337. data/ext/gyp/test/external-cross-compile/src/tochar.py +13 -0
  338. data/ext/gyp/test/generator-output/actions/actions.gyp +16 -0
  339. data/ext/gyp/test/generator-output/actions/build/README.txt +4 -0
  340. data/ext/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
  341. data/ext/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
  342. data/ext/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
  343. data/ext/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
  344. data/ext/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
  345. data/ext/gyp/test/generator-output/actions/subdir1/program.c +12 -0
  346. data/ext/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
  347. data/ext/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
  348. data/ext/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
  349. data/ext/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
  350. data/ext/gyp/test/generator-output/copies/build/README.txt +4 -0
  351. data/ext/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
  352. data/ext/gyp/test/generator-output/copies/copies.gyp +50 -0
  353. data/ext/gyp/test/generator-output/copies/file1 +1 -0
  354. data/ext/gyp/test/generator-output/copies/file2 +1 -0
  355. data/ext/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
  356. data/ext/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
  357. data/ext/gyp/test/generator-output/copies/subdir/file3 +1 -0
  358. data/ext/gyp/test/generator-output/copies/subdir/file4 +1 -0
  359. data/ext/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
  360. data/ext/gyp/test/generator-output/gyptest-actions.py +57 -0
  361. data/ext/gyp/test/generator-output/gyptest-copies.py +59 -0
  362. data/ext/gyp/test/generator-output/gyptest-depth.py +58 -0
  363. data/ext/gyp/test/generator-output/gyptest-mac-bundle.py +33 -0
  364. data/ext/gyp/test/generator-output/gyptest-relocate.py +59 -0
  365. data/ext/gyp/test/generator-output/gyptest-rules.py +58 -0
  366. data/ext/gyp/test/generator-output/gyptest-subdir2-deep.py +36 -0
  367. data/ext/gyp/test/generator-output/gyptest-symlink.py +44 -0
  368. data/ext/gyp/test/generator-output/gyptest-top-all.py +53 -0
  369. data/ext/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
  370. data/ext/gyp/test/generator-output/mac-bundle/app.order +1 -0
  371. data/ext/gyp/test/generator-output/mac-bundle/header.h +1 -0
  372. data/ext/gyp/test/generator-output/mac-bundle/main.c +1 -0
  373. data/ext/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
  374. data/ext/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
  375. data/ext/gyp/test/generator-output/rules/build/README.txt +4 -0
  376. data/ext/gyp/test/generator-output/rules/copy-file.py +12 -0
  377. data/ext/gyp/test/generator-output/rules/rules.gyp +16 -0
  378. data/ext/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
  379. data/ext/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
  380. data/ext/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
  381. data/ext/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
  382. data/ext/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
  383. data/ext/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
  384. data/ext/gyp/test/generator-output/rules/subdir1/program.c +18 -0
  385. data/ext/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
  386. data/ext/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
  387. data/ext/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
  388. data/ext/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
  389. data/ext/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
  390. data/ext/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
  391. data/ext/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
  392. data/ext/gyp/test/generator-output/src/build/README.txt +4 -0
  393. data/ext/gyp/test/generator-output/src/inc.h +1 -0
  394. data/ext/gyp/test/generator-output/src/inc1/include1.h +1 -0
  395. data/ext/gyp/test/generator-output/src/prog1.c +18 -0
  396. data/ext/gyp/test/generator-output/src/prog1.gyp +28 -0
  397. data/ext/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
  398. data/ext/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
  399. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
  400. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
  401. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
  402. data/ext/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
  403. data/ext/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
  404. data/ext/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
  405. data/ext/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
  406. data/ext/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
  407. data/ext/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
  408. data/ext/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
  409. data/ext/gyp/test/generator-output/src/symroot.gypi +16 -0
  410. data/ext/gyp/test/gyp-defines/defines.gyp +26 -0
  411. data/ext/gyp/test/gyp-defines/echo.py +11 -0
  412. data/ext/gyp/test/gyp-defines/gyptest-multiple-values.py +36 -0
  413. data/ext/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
  414. data/ext/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
  415. data/ext/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
  416. data/ext/gyp/test/hard_dependency/src/a.c +9 -0
  417. data/ext/gyp/test/hard_dependency/src/a.h +12 -0
  418. data/ext/gyp/test/hard_dependency/src/b.c +9 -0
  419. data/ext/gyp/test/hard_dependency/src/b.h +12 -0
  420. data/ext/gyp/test/hard_dependency/src/c.c +10 -0
  421. data/ext/gyp/test/hard_dependency/src/c.h +10 -0
  422. data/ext/gyp/test/hard_dependency/src/d.c +9 -0
  423. data/ext/gyp/test/hard_dependency/src/emit.py +11 -0
  424. data/ext/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
  425. data/ext/gyp/test/hello/gyptest-all.py +24 -0
  426. data/ext/gyp/test/hello/gyptest-default.py +24 -0
  427. data/ext/gyp/test/hello/gyptest-disable-regyp.py +32 -0
  428. data/ext/gyp/test/hello/gyptest-regyp-output.py +36 -0
  429. data/ext/gyp/test/hello/gyptest-regyp.py +32 -0
  430. data/ext/gyp/test/hello/gyptest-target.py +24 -0
  431. data/ext/gyp/test/hello/hello.c +11 -0
  432. data/ext/gyp/test/hello/hello.gyp +15 -0
  433. data/ext/gyp/test/hello/hello2.c +11 -0
  434. data/ext/gyp/test/hello/hello2.gyp +15 -0
  435. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
  436. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
  437. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
  438. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
  439. data/ext/gyp/test/home_dot_gyp/home/.gyp/include.gypi +5 -0
  440. data/ext/gyp/test/home_dot_gyp/home2/.gyp/include.gypi +5 -0
  441. data/ext/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi +5 -0
  442. data/ext/gyp/test/home_dot_gyp/src/all.gyp +22 -0
  443. data/ext/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
  444. data/ext/gyp/test/include_dirs/gyptest-all.py +43 -0
  445. data/ext/gyp/test/include_dirs/gyptest-default.py +43 -0
  446. data/ext/gyp/test/include_dirs/src/inc.h +1 -0
  447. data/ext/gyp/test/include_dirs/src/inc1/include1.h +1 -0
  448. data/ext/gyp/test/include_dirs/src/includes.c +19 -0
  449. data/ext/gyp/test/include_dirs/src/includes.gyp +27 -0
  450. data/ext/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
  451. data/ext/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
  452. data/ext/gyp/test/include_dirs/src/subdir/inc.h +1 -0
  453. data/ext/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
  454. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
  455. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
  456. data/ext/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +44 -0
  457. data/ext/gyp/test/intermediate_dir/src/script.py +22 -0
  458. data/ext/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
  459. data/ext/gyp/test/intermediate_dir/src/test.gyp +42 -0
  460. data/ext/gyp/test/intermediate_dir/src/test2.gyp +42 -0
  461. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  462. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  463. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/LanguageMap.plist +8 -0
  464. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +17 -0
  465. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
  466. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  467. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  468. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  469. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  470. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  471. data/ext/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +28 -0
  472. data/ext/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
  473. data/ext/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
  474. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
  475. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
  476. data/ext/gyp/test/ios/app-bundle/test-archs.gyp +109 -0
  477. data/ext/gyp/test/ios/app-bundle/test-assets-catalog.gyp +45 -0
  478. data/ext/gyp/test/ios/app-bundle/test-crosscompile.gyp +47 -0
  479. data/ext/gyp/test/ios/app-bundle/test-device.gyp +109 -0
  480. data/ext/gyp/test/ios/app-bundle/test.gyp +75 -0
  481. data/ext/gyp/test/ios/app-bundle/tool_main.cc +7 -0
  482. data/ext/gyp/test/ios/copies-with-xcode-envvars/Info.plist +24 -0
  483. data/ext/gyp/test/ios/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +97 -0
  484. data/ext/gyp/test/ios/copies-with-xcode-envvars/empty.c +1 -0
  485. data/ext/gyp/test/ios/copies-with-xcode-envvars/file0 +1 -0
  486. data/ext/gyp/test/ios/copies-with-xcode-envvars/file1 +1 -0
  487. data/ext/gyp/test/ios/copies-with-xcode-envvars/file10 +1 -0
  488. data/ext/gyp/test/ios/copies-with-xcode-envvars/file11 +1 -0
  489. data/ext/gyp/test/ios/copies-with-xcode-envvars/file2 +1 -0
  490. data/ext/gyp/test/ios/copies-with-xcode-envvars/file3 +1 -0
  491. data/ext/gyp/test/ios/copies-with-xcode-envvars/file4 +1 -0
  492. data/ext/gyp/test/ios/copies-with-xcode-envvars/file5 +1 -0
  493. data/ext/gyp/test/ios/copies-with-xcode-envvars/file6 +1 -0
  494. data/ext/gyp/test/ios/copies-with-xcode-envvars/file7 +1 -0
  495. data/ext/gyp/test/ios/copies-with-xcode-envvars/file8 +1 -0
  496. data/ext/gyp/test/ios/copies-with-xcode-envvars/file9 +1 -0
  497. data/ext/gyp/test/ios/deployment-target/check-version-min.c +33 -0
  498. data/ext/gyp/test/ios/deployment-target/deployment-target.gyp +34 -0
  499. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.h +9 -0
  500. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.m +31 -0
  501. data/ext/gyp/test/ios/extension/ActionExtension/Info.plist +42 -0
  502. data/ext/gyp/test/ios/extension/ActionExtension/MainInterface.storyboard +63 -0
  503. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.h +12 -0
  504. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.m +19 -0
  505. data/ext/gyp/test/ios/extension/ExtensionContainer/Base.lproj/Main.storyboard +25 -0
  506. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  507. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  508. data/ext/gyp/test/ios/extension/ExtensionContainer/Info.plist +32 -0
  509. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.h +11 -0
  510. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.m +24 -0
  511. data/ext/gyp/test/ios/extension/ExtensionContainer/main.m +13 -0
  512. data/ext/gyp/test/ios/extension/extension.gyp +91 -0
  513. data/ext/gyp/test/ios/framework/framework.gyp +43 -0
  514. data/ext/gyp/test/ios/framework/iOSFramework/Info.plist +26 -0
  515. data/ext/gyp/test/ios/framework/iOSFramework/Thing.h +10 -0
  516. data/ext/gyp/test/ios/framework/iOSFramework/Thing.m +22 -0
  517. data/ext/gyp/test/ios/framework/iOSFramework/iOSFramework.h +9 -0
  518. data/ext/gyp/test/ios/gyptest-app-ios-assets-catalog.py +57 -0
  519. data/ext/gyp/test/ios/gyptest-app-ios.py +76 -0
  520. data/ext/gyp/test/ios/gyptest-archs.py +62 -0
  521. data/ext/gyp/test/ios/gyptest-copies-with-xcode-envvars.py +65 -0
  522. data/ext/gyp/test/ios/gyptest-crosscompile.py +34 -0
  523. data/ext/gyp/test/ios/gyptest-deployment-target.py +23 -0
  524. data/ext/gyp/test/ios/gyptest-extension.py +51 -0
  525. data/ext/gyp/test/ios/gyptest-framework.py +37 -0
  526. data/ext/gyp/test/ios/gyptest-per-config-settings.py +190 -0
  527. data/ext/gyp/test/ios/gyptest-watch.py +44 -0
  528. data/ext/gyp/test/ios/gyptest-xcode-ninja.py +25 -0
  529. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  530. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/LaunchImage.launchimage/Contents.json +24 -0
  531. data/ext/gyp/test/ios/watch/WatchApp/Info.plist +35 -0
  532. data/ext/gyp/test/ios/watch/WatchApp/Interface.storyboard +15 -0
  533. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.h +12 -0
  534. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.m +19 -0
  535. data/ext/gyp/test/ios/watch/WatchContainer/Base.lproj/Main.storyboard +25 -0
  536. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  537. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  538. data/ext/gyp/test/ios/watch/WatchContainer/Info.plist +32 -0
  539. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.h +11 -0
  540. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.m +24 -0
  541. data/ext/gyp/test/ios/watch/WatchContainer/main.m +13 -0
  542. data/ext/gyp/test/ios/watch/WatchKitExtension/Images.xcassets/MyImage.imageset/Contents.json +20 -0
  543. data/ext/gyp/test/ios/watch/WatchKitExtension/Info.plist +38 -0
  544. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.h +10 -0
  545. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.m +25 -0
  546. data/ext/gyp/test/ios/watch/WatchKitExtension/MainInterface.storyboard +63 -0
  547. data/ext/gyp/test/ios/watch/watch.gyp +105 -0
  548. data/ext/gyp/test/ios/xctests/App/AppDelegate.h +11 -0
  549. data/ext/gyp/test/ios/xctests/App/AppDelegate.m +18 -0
  550. data/ext/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib +41 -0
  551. data/ext/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard +25 -0
  552. data/ext/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json +68 -0
  553. data/ext/gyp/test/ios/xctests/App/Info.plist +47 -0
  554. data/ext/gyp/test/ios/xctests/App/ViewController.h +9 -0
  555. data/ext/gyp/test/ios/xctests/App/ViewController.m +21 -0
  556. data/ext/gyp/test/ios/xctests/App/main.m +13 -0
  557. data/ext/gyp/test/ios/xctests/AppTests/AppTests.m +31 -0
  558. data/ext/gyp/test/ios/xctests/AppTests/Info.plist +24 -0
  559. data/ext/gyp/test/ios/xctests/gyptest-xctests.py +49 -0
  560. data/ext/gyp/test/ios/xctests/xctests.gyp +74 -0
  561. data/ext/gyp/test/lib/README.txt +17 -0
  562. data/ext/gyp/test/lib/TestCmd.py +1597 -0
  563. data/ext/gyp/test/lib/TestCommon.py +591 -0
  564. data/ext/gyp/test/lib/TestGyp.py +1259 -0
  565. data/ext/gyp/test/lib/TestMac.py +76 -0
  566. data/ext/gyp/test/lib/TestWin.py +101 -0
  567. data/ext/gyp/test/library/gyptest-shared-obj-install-path.py +39 -0
  568. data/ext/gyp/test/library/gyptest-shared.py +84 -0
  569. data/ext/gyp/test/library/gyptest-static.py +84 -0
  570. data/ext/gyp/test/library/src/lib1.c +10 -0
  571. data/ext/gyp/test/library/src/lib1_moveable.c +10 -0
  572. data/ext/gyp/test/library/src/lib2.c +10 -0
  573. data/ext/gyp/test/library/src/lib2_moveable.c +10 -0
  574. data/ext/gyp/test/library/src/library.gyp +58 -0
  575. data/ext/gyp/test/library/src/program.c +15 -0
  576. data/ext/gyp/test/library/src/shared_dependency.gyp +33 -0
  577. data/ext/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
  578. data/ext/gyp/test/library_dirs/subdir/README.txt +1 -0
  579. data/ext/gyp/test/library_dirs/subdir/hello.cc +11 -0
  580. data/ext/gyp/test/library_dirs/subdir/mylib.cc +9 -0
  581. data/ext/gyp/test/library_dirs/subdir/mylib.h +12 -0
  582. data/ext/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
  583. data/ext/gyp/test/library_dirs/subdir/test.gyp +68 -0
  584. data/ext/gyp/test/link-dependency/gyptest-link-dependency.py +23 -0
  585. data/ext/gyp/test/link-dependency/main.c +7 -0
  586. data/ext/gyp/test/link-dependency/mymalloc.c +12 -0
  587. data/ext/gyp/test/link-dependency/test.gyp +37 -0
  588. data/ext/gyp/test/link-objects/base.c +6 -0
  589. data/ext/gyp/test/link-objects/extra.c +5 -0
  590. data/ext/gyp/test/link-objects/gyptest-all.py +28 -0
  591. data/ext/gyp/test/link-objects/link-objects.gyp +24 -0
  592. data/ext/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
  593. data/ext/gyp/test/linux/gyptest-ldflags-duplicates.py +22 -0
  594. data/ext/gyp/test/linux/gyptest-ldflags-from-environment.py +45 -0
  595. data/ext/gyp/test/linux/gyptest-target-rpath.py +43 -0
  596. data/ext/gyp/test/linux/implicit-rpath/file.c +1 -0
  597. data/ext/gyp/test/linux/implicit-rpath/main.c +1 -0
  598. data/ext/gyp/test/linux/implicit-rpath/test.gyp +47 -0
  599. data/ext/gyp/test/linux/ldflags-duplicates/check-ldflags.py +28 -0
  600. data/ext/gyp/test/linux/ldflags-duplicates/lib1.c +6 -0
  601. data/ext/gyp/test/linux/ldflags-duplicates/lib2.c +6 -0
  602. data/ext/gyp/test/linux/ldflags-duplicates/main.c +7 -0
  603. data/ext/gyp/test/linux/ldflags-duplicates/test.gyp +45 -0
  604. data/ext/gyp/test/linux/ldflags-from-environment/main.c +7 -0
  605. data/ext/gyp/test/linux/ldflags-from-environment/test.gyp +23 -0
  606. data/ext/gyp/test/linux/target-rpath/file.c +1 -0
  607. data/ext/gyp/test/linux/target-rpath/main.c +1 -0
  608. data/ext/gyp/test/linux/target-rpath/test.gyp +47 -0
  609. data/ext/gyp/test/mac/action-envvars/action/action.gyp +34 -0
  610. data/ext/gyp/test/mac/action-envvars/action/action.sh +8 -0
  611. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  612. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  613. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  614. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
  615. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
  616. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  617. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  618. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  619. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  620. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  621. data/ext/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
  622. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
  623. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
  624. data/ext/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
  625. data/ext/gyp/test/mac/app-bundle/empty.c +0 -0
  626. data/ext/gyp/test/mac/app-bundle/test-assets-catalog.gyp +43 -0
  627. data/ext/gyp/test/mac/app-bundle/test-error.gyp +31 -0
  628. data/ext/gyp/test/mac/app-bundle/test.gyp +41 -0
  629. data/ext/gyp/test/mac/archs/empty_main.cc +1 -0
  630. data/ext/gyp/test/mac/archs/file.mm +1 -0
  631. data/ext/gyp/test/mac/archs/file_a.cc +8 -0
  632. data/ext/gyp/test/mac/archs/file_a.h +10 -0
  633. data/ext/gyp/test/mac/archs/file_b.cc +8 -0
  634. data/ext/gyp/test/mac/archs/file_b.h +10 -0
  635. data/ext/gyp/test/mac/archs/file_c.cc +11 -0
  636. data/ext/gyp/test/mac/archs/file_d.cc +11 -0
  637. data/ext/gyp/test/mac/archs/header.h +1 -0
  638. data/ext/gyp/test/mac/archs/my_file.cc +4 -0
  639. data/ext/gyp/test/mac/archs/my_main_file.cc +9 -0
  640. data/ext/gyp/test/mac/archs/test-archs-multiarch.gyp +92 -0
  641. data/ext/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
  642. data/ext/gyp/test/mac/archs/test-dependencies.gyp +92 -0
  643. data/ext/gyp/test/mac/archs/test-no-archs.gyp +21 -0
  644. data/ext/gyp/test/mac/archs/test-valid-archs.gyp +28 -0
  645. data/ext/gyp/test/mac/bundle-resources/change.sh +3 -0
  646. data/ext/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
  647. data/ext/gyp/test/mac/bundle-resources/secret.txt +1 -0
  648. data/ext/gyp/test/mac/bundle-resources/test.gyp +59 -0
  649. data/ext/gyp/test/mac/cflags/ccfile.cc +7 -0
  650. data/ext/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
  651. data/ext/gyp/test/mac/cflags/cfile.c +7 -0
  652. data/ext/gyp/test/mac/cflags/cppfile.cpp +7 -0
  653. data/ext/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
  654. data/ext/gyp/test/mac/cflags/cxxfile.cxx +7 -0
  655. data/ext/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
  656. data/ext/gyp/test/mac/cflags/mfile.m +7 -0
  657. data/ext/gyp/test/mac/cflags/mmfile.mm +7 -0
  658. data/ext/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
  659. data/ext/gyp/test/mac/cflags/test.gyp +132 -0
  660. data/ext/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
  661. data/ext/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
  662. data/ext/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
  663. data/ext/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
  664. data/ext/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
  665. data/ext/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
  666. data/ext/gyp/test/mac/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +87 -0
  667. data/ext/gyp/test/mac/copies-with-xcode-envvars/empty.c +1 -0
  668. data/ext/gyp/test/mac/copies-with-xcode-envvars/file0 +1 -0
  669. data/ext/gyp/test/mac/copies-with-xcode-envvars/file1 +1 -0
  670. data/ext/gyp/test/mac/copies-with-xcode-envvars/file10 +1 -0
  671. data/ext/gyp/test/mac/copies-with-xcode-envvars/file11 +1 -0
  672. data/ext/gyp/test/mac/copies-with-xcode-envvars/file2 +1 -0
  673. data/ext/gyp/test/mac/copies-with-xcode-envvars/file3 +1 -0
  674. data/ext/gyp/test/mac/copies-with-xcode-envvars/file4 +1 -0
  675. data/ext/gyp/test/mac/copies-with-xcode-envvars/file5 +1 -0
  676. data/ext/gyp/test/mac/copies-with-xcode-envvars/file6 +1 -0
  677. data/ext/gyp/test/mac/copies-with-xcode-envvars/file7 +1 -0
  678. data/ext/gyp/test/mac/copies-with-xcode-envvars/file8 +1 -0
  679. data/ext/gyp/test/mac/copies-with-xcode-envvars/file9 +1 -0
  680. data/ext/gyp/test/mac/copy-dylib/empty.c +1 -0
  681. data/ext/gyp/test/mac/copy-dylib/test.gyp +31 -0
  682. data/ext/gyp/test/mac/debuginfo/file.c +6 -0
  683. data/ext/gyp/test/mac/debuginfo/test.gyp +82 -0
  684. data/ext/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
  685. data/ext/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
  686. data/ext/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
  687. data/ext/gyp/test/mac/depend-on-bundle/executable.c +4 -0
  688. data/ext/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
  689. data/ext/gyp/test/mac/deployment-target/check-version-min.c +33 -0
  690. data/ext/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
  691. data/ext/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
  692. data/ext/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
  693. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
  694. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
  695. data/ext/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
  696. data/ext/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
  697. data/ext/gyp/test/mac/framework/empty.c +0 -0
  698. data/ext/gyp/test/mac/framework/framework.gyp +108 -0
  699. data/ext/gyp/test/mac/framework-dirs/calculate.c +15 -0
  700. data/ext/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
  701. data/ext/gyp/test/mac/framework-headers/myframework.h +8 -0
  702. data/ext/gyp/test/mac/framework-headers/myframework.m +8 -0
  703. data/ext/gyp/test/mac/framework-headers/test.gyp +44 -0
  704. data/ext/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
  705. data/ext/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
  706. data/ext/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
  707. data/ext/gyp/test/mac/gyptest-action-envvars.py +36 -0
  708. data/ext/gyp/test/mac/gyptest-app-assets-catalog.py +125 -0
  709. data/ext/gyp/test/mac/gyptest-app-error.py +49 -0
  710. data/ext/gyp/test/mac/gyptest-app.py +122 -0
  711. data/ext/gyp/test/mac/gyptest-archs.py +96 -0
  712. data/ext/gyp/test/mac/gyptest-bundle-resources.py +64 -0
  713. data/ext/gyp/test/mac/gyptest-cflags.py +21 -0
  714. data/ext/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
  715. data/ext/gyp/test/mac/gyptest-clang-cxx-library.py +32 -0
  716. data/ext/gyp/test/mac/gyptest-copies-with-xcode-envvars.py +65 -0
  717. data/ext/gyp/test/mac/gyptest-copies.py +62 -0
  718. data/ext/gyp/test/mac/gyptest-copy-dylib.py +25 -0
  719. data/ext/gyp/test/mac/gyptest-debuginfo.py +36 -0
  720. data/ext/gyp/test/mac/gyptest-depend-on-bundle.py +45 -0
  721. data/ext/gyp/test/mac/gyptest-deployment-target.py +27 -0
  722. data/ext/gyp/test/mac/gyptest-framework-dirs.py +23 -0
  723. data/ext/gyp/test/mac/gyptest-framework-headers.py +38 -0
  724. data/ext/gyp/test/mac/gyptest-framework.py +80 -0
  725. data/ext/gyp/test/mac/gyptest-global-settings.py +33 -0
  726. data/ext/gyp/test/mac/gyptest-identical-name.py +45 -0
  727. data/ext/gyp/test/mac/gyptest-infoplist-process.py +56 -0
  728. data/ext/gyp/test/mac/gyptest-installname.py +85 -0
  729. data/ext/gyp/test/mac/gyptest-kext.py +27 -0
  730. data/ext/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +37 -0
  731. data/ext/gyp/test/mac/gyptest-ldflags.py +74 -0
  732. data/ext/gyp/test/mac/gyptest-libraries.py +30 -0
  733. data/ext/gyp/test/mac/gyptest-libtool-zero.py +26 -0
  734. data/ext/gyp/test/mac/gyptest-loadable-module-bundle-product-extension.py +31 -0
  735. data/ext/gyp/test/mac/gyptest-loadable-module.py +54 -0
  736. data/ext/gyp/test/mac/gyptest-lto.py +66 -0
  737. data/ext/gyp/test/mac/gyptest-missing-cfbundlesignature.py +34 -0
  738. data/ext/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +38 -0
  739. data/ext/gyp/test/mac/gyptest-objc-arc.py +27 -0
  740. data/ext/gyp/test/mac/gyptest-objc-gc.py +51 -0
  741. data/ext/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
  742. data/ext/gyp/test/mac/gyptest-postbuild-defaults.py +34 -0
  743. data/ext/gyp/test/mac/gyptest-postbuild-fail.py +71 -0
  744. data/ext/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
  745. data/ext/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
  746. data/ext/gyp/test/mac/gyptest-postbuild.py +53 -0
  747. data/ext/gyp/test/mac/gyptest-prefixheader.py +20 -0
  748. data/ext/gyp/test/mac/gyptest-rebuild.py +46 -0
  749. data/ext/gyp/test/mac/gyptest-rpath.py +50 -0
  750. data/ext/gyp/test/mac/gyptest-sdkroot.py +56 -0
  751. data/ext/gyp/test/mac/gyptest-sourceless-module.py +77 -0
  752. data/ext/gyp/test/mac/gyptest-strip-default.py +97 -0
  753. data/ext/gyp/test/mac/gyptest-strip.py +66 -0
  754. data/ext/gyp/test/mac/gyptest-swift-library.py +67 -0
  755. data/ext/gyp/test/mac/gyptest-type-envvars.py +26 -0
  756. data/ext/gyp/test/mac/gyptest-unicode-settings.py +20 -0
  757. data/ext/gyp/test/mac/gyptest-xcode-env-order.py +95 -0
  758. data/ext/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
  759. data/ext/gyp/test/mac/gyptest-xcode-gcc.py +60 -0
  760. data/ext/gyp/test/mac/gyptest-xcode-support-actions.py +25 -0
  761. data/ext/gyp/test/mac/gyptest-xctest.py +41 -0
  762. data/ext/gyp/test/mac/gyptest-xcuitest.py +39 -0
  763. data/ext/gyp/test/mac/identical-name/proxy/proxy.cc +2 -0
  764. data/ext/gyp/test/mac/identical-name/proxy/proxy.gyp +9 -0
  765. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.cc +2 -0
  766. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.gyp +8 -0
  767. data/ext/gyp/test/mac/identical-name/test-should-fail.gyp +10 -0
  768. data/ext/gyp/test/mac/identical-name/test.gyp +11 -0
  769. data/ext/gyp/test/mac/identical-name/test.gypi +7 -0
  770. data/ext/gyp/test/mac/identical-name/testlib/main.cc +3 -0
  771. data/ext/gyp/test/mac/identical-name/testlib/testlib.gyp +14 -0
  772. data/ext/gyp/test/mac/identical-name/testlib/void.cc +2 -0
  773. data/ext/gyp/test/mac/infoplist-process/Info.plist +36 -0
  774. data/ext/gyp/test/mac/infoplist-process/main.c +7 -0
  775. data/ext/gyp/test/mac/infoplist-process/test1.gyp +25 -0
  776. data/ext/gyp/test/mac/infoplist-process/test2.gyp +25 -0
  777. data/ext/gyp/test/mac/infoplist-process/test3.gyp +25 -0
  778. data/ext/gyp/test/mac/installname/Info.plist +28 -0
  779. data/ext/gyp/test/mac/installname/file.c +1 -0
  780. data/ext/gyp/test/mac/installname/main.c +1 -0
  781. data/ext/gyp/test/mac/installname/test.gyp +93 -0
  782. data/ext/gyp/test/mac/kext/GypKext/GypKext-Info.plist +35 -0
  783. data/ext/gyp/test/mac/kext/GypKext/GypKext.c +16 -0
  784. data/ext/gyp/test/mac/kext/kext.gyp +18 -0
  785. data/ext/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
  786. data/ext/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
  787. data/ext/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
  788. data/ext/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
  789. data/ext/gyp/test/mac/ldflags-libtool/file.c +1 -0
  790. data/ext/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
  791. data/ext/gyp/test/mac/libraries/subdir/README.txt +1 -0
  792. data/ext/gyp/test/mac/libraries/subdir/hello.cc +10 -0
  793. data/ext/gyp/test/mac/libraries/subdir/mylib.c +7 -0
  794. data/ext/gyp/test/mac/libraries/subdir/test.gyp +65 -0
  795. data/ext/gyp/test/mac/libtool-zero/mylib.c +7 -0
  796. data/ext/gyp/test/mac/libtool-zero/test.gyp +18 -0
  797. data/ext/gyp/test/mac/loadable-module/Info.plist +26 -0
  798. data/ext/gyp/test/mac/loadable-module/module.c +11 -0
  799. data/ext/gyp/test/mac/loadable-module/test.gyp +18 -0
  800. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/src.cc +7 -0
  801. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/test.gyp +24 -0
  802. data/ext/gyp/test/mac/lto/asmfile.S +2 -0
  803. data/ext/gyp/test/mac/lto/ccfile.cc +1 -0
  804. data/ext/gyp/test/mac/lto/cfile.c +1 -0
  805. data/ext/gyp/test/mac/lto/mfile.m +1 -0
  806. data/ext/gyp/test/mac/lto/mmfile.mm +1 -0
  807. data/ext/gyp/test/mac/lto/test.gyp +35 -0
  808. data/ext/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
  809. data/ext/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
  810. data/ext/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
  811. data/ext/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
  812. data/ext/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
  813. data/ext/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
  814. data/ext/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
  815. data/ext/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
  816. data/ext/gyp/test/mac/objc-arc/c-file.c +5 -0
  817. data/ext/gyp/test/mac/objc-arc/cc-file.cc +5 -0
  818. data/ext/gyp/test/mac/objc-arc/m-file-arc-weak.m +9 -0
  819. data/ext/gyp/test/mac/objc-arc/m-file-no-arc.m +9 -0
  820. data/ext/gyp/test/mac/objc-arc/m-file.m +9 -0
  821. data/ext/gyp/test/mac/objc-arc/mm-file-arc-weak.mm +9 -0
  822. data/ext/gyp/test/mac/objc-arc/mm-file-no-arc.mm +9 -0
  823. data/ext/gyp/test/mac/objc-arc/mm-file.mm +9 -0
  824. data/ext/gyp/test/mac/objc-arc/test.gyp +53 -0
  825. data/ext/gyp/test/mac/objc-gc/c-file.c +1 -0
  826. data/ext/gyp/test/mac/objc-gc/cc-file.cc +1 -0
  827. data/ext/gyp/test/mac/objc-gc/main.m +6 -0
  828. data/ext/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
  829. data/ext/gyp/test/mac/objc-gc/needs-gc.m +1 -0
  830. data/ext/gyp/test/mac/objc-gc/test.gyp +102 -0
  831. data/ext/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
  832. data/ext/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
  833. data/ext/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
  834. data/ext/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
  835. data/ext/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
  836. data/ext/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
  837. data/ext/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
  838. data/ext/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
  839. data/ext/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
  840. data/ext/gyp/test/mac/postbuild-defaults/main.c +7 -0
  841. data/ext/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
  842. data/ext/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
  843. data/ext/gyp/test/mac/postbuild-fail/file.c +6 -0
  844. data/ext/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
  845. data/ext/gyp/test/mac/postbuild-fail/test.gyp +38 -0
  846. data/ext/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
  847. data/ext/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
  848. data/ext/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
  849. data/ext/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
  850. data/ext/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
  851. data/ext/gyp/test/mac/postbuild-static-library/empty.c +4 -0
  852. data/ext/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
  853. data/ext/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
  854. data/ext/gyp/test/mac/postbuilds/copy.sh +3 -0
  855. data/ext/gyp/test/mac/postbuilds/file.c +4 -0
  856. data/ext/gyp/test/mac/postbuilds/file_g.c +4 -0
  857. data/ext/gyp/test/mac/postbuilds/file_h.c +4 -0
  858. data/ext/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
  859. data/ext/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
  860. data/ext/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
  861. data/ext/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
  862. data/ext/gyp/test/mac/postbuilds/test.gyp +93 -0
  863. data/ext/gyp/test/mac/prefixheader/file.c +1 -0
  864. data/ext/gyp/test/mac/prefixheader/file.cc +1 -0
  865. data/ext/gyp/test/mac/prefixheader/file.m +1 -0
  866. data/ext/gyp/test/mac/prefixheader/file.mm +1 -0
  867. data/ext/gyp/test/mac/prefixheader/header.h +1 -0
  868. data/ext/gyp/test/mac/prefixheader/test.gyp +82 -0
  869. data/ext/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
  870. data/ext/gyp/test/mac/rebuild/delay-touch.sh +6 -0
  871. data/ext/gyp/test/mac/rebuild/empty.c +0 -0
  872. data/ext/gyp/test/mac/rebuild/main.c +1 -0
  873. data/ext/gyp/test/mac/rebuild/test.gyp +56 -0
  874. data/ext/gyp/test/mac/rpath/file.c +1 -0
  875. data/ext/gyp/test/mac/rpath/main.c +1 -0
  876. data/ext/gyp/test/mac/rpath/test.gyp +48 -0
  877. data/ext/gyp/test/mac/sdkroot/file.cc +5 -0
  878. data/ext/gyp/test/mac/sdkroot/test.gyp +35 -0
  879. data/ext/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
  880. data/ext/gyp/test/mac/sourceless-module/empty.c +1 -0
  881. data/ext/gyp/test/mac/sourceless-module/empty.txt +2 -0
  882. data/ext/gyp/test/mac/sourceless-module/fun.c +1 -0
  883. data/ext/gyp/test/mac/sourceless-module/test.gyp +96 -0
  884. data/ext/gyp/test/mac/strip/file.c +22 -0
  885. data/ext/gyp/test/mac/strip/main.c +25 -0
  886. data/ext/gyp/test/mac/strip/strip.saves +5 -0
  887. data/ext/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
  888. data/ext/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
  889. data/ext/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
  890. data/ext/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
  891. data/ext/gyp/test/mac/strip/test-defaults.gyp +51 -0
  892. data/ext/gyp/test/mac/strip/test.gyp +119 -0
  893. data/ext/gyp/test/mac/swift-library/Info.plist +28 -0
  894. data/ext/gyp/test/mac/swift-library/file.swift +9 -0
  895. data/ext/gyp/test/mac/swift-library/test.gyp +21 -0
  896. data/ext/gyp/test/mac/type_envvars/file.c +6 -0
  897. data/ext/gyp/test/mac/type_envvars/test.gyp +100 -0
  898. data/ext/gyp/test/mac/type_envvars/test_bundle_executable.sh +30 -0
  899. data/ext/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +35 -0
  900. data/ext/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +38 -0
  901. data/ext/gyp/test/mac/type_envvars/test_check_sdkroot.sh +47 -0
  902. data/ext/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +33 -0
  903. data/ext/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +31 -0
  904. data/ext/gyp/test/mac/type_envvars/test_nonbundle_none.sh +32 -0
  905. data/ext/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +31 -0
  906. data/ext/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +31 -0
  907. data/ext/gyp/test/mac/unicode-settings/file.cc +2 -0
  908. data/ext/gyp/test/mac/unicode-settings/test.gyp +23 -0
  909. data/ext/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
  910. data/ext/gyp/test/mac/xcode-env-order/Info.plist +56 -0
  911. data/ext/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
  912. data/ext/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
  913. data/ext/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
  914. data/ext/gyp/test/mac/xcode-env-order/main.c +7 -0
  915. data/ext/gyp/test/mac/xcode-env-order/test.gyp +121 -0
  916. data/ext/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
  917. data/ext/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
  918. data/ext/gyp/test/mac/xcode-gcc/test.gyp +60 -0
  919. data/ext/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
  920. data/ext/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
  921. data/ext/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
  922. data/ext/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
  923. data/ext/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
  924. data/ext/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
  925. data/ext/gyp/test/mac/xcode-support-actions/source.c +0 -0
  926. data/ext/gyp/test/mac/xcode-support-actions/test.gyp +26 -0
  927. data/ext/gyp/test/mac/xctest/MyClass.h +8 -0
  928. data/ext/gyp/test/mac/xctest/MyClass.m +8 -0
  929. data/ext/gyp/test/mac/xctest/TestCase.m +16 -0
  930. data/ext/gyp/test/mac/xctest/resource.txt +1 -0
  931. data/ext/gyp/test/mac/xctest/test.gyp +47 -0
  932. data/ext/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
  933. data/ext/gyp/test/mac/xcuitest/Info.plist +28 -0
  934. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.h +8 -0
  935. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.m +19 -0
  936. data/ext/gyp/test/mac/xcuitest/TestCase.m +15 -0
  937. data/ext/gyp/test/mac/xcuitest/main.m +15 -0
  938. data/ext/gyp/test/mac/xcuitest/resource.txt +1 -0
  939. data/ext/gyp/test/mac/xcuitest/test.gyp +69 -0
  940. data/ext/gyp/test/make/dependencies.gyp +15 -0
  941. data/ext/gyp/test/make/gyptest-dependencies.py +26 -0
  942. data/ext/gyp/test/make/gyptest-noload.py +57 -0
  943. data/ext/gyp/test/make/main.cc +12 -0
  944. data/ext/gyp/test/make/main.h +0 -0
  945. data/ext/gyp/test/make/noload/all.gyp +18 -0
  946. data/ext/gyp/test/make/noload/lib/shared.c +3 -0
  947. data/ext/gyp/test/make/noload/lib/shared.gyp +16 -0
  948. data/ext/gyp/test/make/noload/lib/shared.h +1 -0
  949. data/ext/gyp/test/make/noload/main.c +9 -0
  950. data/ext/gyp/test/make_global_settings/ar/gyptest-make_global_settings_ar.py +126 -0
  951. data/ext/gyp/test/make_global_settings/ar/make_global_settings_ar.gyp +29 -0
  952. data/ext/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +51 -0
  953. data/ext/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
  954. data/ext/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +51 -0
  955. data/ext/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
  956. data/ext/gyp/test/make_global_settings/full-toolchain/bar.cc +1 -0
  957. data/ext/gyp/test/make_global_settings/full-toolchain/foo.c +1 -0
  958. data/ext/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py +53 -0
  959. data/ext/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp +22 -0
  960. data/ext/gyp/test/make_global_settings/full-toolchain/my_nm.py +9 -0
  961. data/ext/gyp/test/make_global_settings/full-toolchain/my_readelf.py +9 -0
  962. data/ext/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +130 -0
  963. data/ext/gyp/test/make_global_settings/ld/make_global_settings_ld.gyp +29 -0
  964. data/ext/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +52 -0
  965. data/ext/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
  966. data/ext/gyp/test/many-actions/file0 +0 -0
  967. data/ext/gyp/test/many-actions/file1 +0 -0
  968. data/ext/gyp/test/many-actions/file2 +0 -0
  969. data/ext/gyp/test/many-actions/file3 +0 -0
  970. data/ext/gyp/test/many-actions/file4 +0 -0
  971. data/ext/gyp/test/many-actions/gyptest-many-actions-unsorted.py +43 -0
  972. data/ext/gyp/test/many-actions/gyptest-many-actions.py +29 -0
  973. data/ext/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
  974. data/ext/gyp/test/many-actions/many-actions.gyp +1817 -0
  975. data/ext/gyp/test/module/gyptest-default.py +28 -0
  976. data/ext/gyp/test/module/src/lib1.c +10 -0
  977. data/ext/gyp/test/module/src/lib2.c +10 -0
  978. data/ext/gyp/test/module/src/module.gyp +53 -0
  979. data/ext/gyp/test/module/src/program.c +111 -0
  980. data/ext/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
  981. data/ext/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
  982. data/ext/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
  983. data/ext/gyp/test/msvs/buildevents/main.cc +5 -0
  984. data/ext/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +41 -0
  985. data/ext/gyp/test/msvs/config_attrs/hello.c +11 -0
  986. data/ext/gyp/test/msvs/config_attrs/hello.gyp +21 -0
  987. data/ext/gyp/test/msvs/express/base/base.gyp +22 -0
  988. data/ext/gyp/test/msvs/express/express.gyp +19 -0
  989. data/ext/gyp/test/msvs/express/gyptest-express.py +29 -0
  990. data/ext/gyp/test/msvs/external_builder/external.gyp +68 -0
  991. data/ext/gyp/test/msvs/external_builder/external_builder.py +9 -0
  992. data/ext/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
  993. data/ext/gyp/test/msvs/external_builder/hello.cpp +10 -0
  994. data/ext/gyp/test/msvs/external_builder/hello.z +6 -0
  995. data/ext/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
  996. data/ext/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
  997. data/ext/gyp/test/msvs/filters/filters.gyp +47 -0
  998. data/ext/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
  999. data/ext/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
  1000. data/ext/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
  1001. data/ext/gyp/test/msvs/list_excluded/hello.cpp +10 -0
  1002. data/ext/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
  1003. data/ext/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
  1004. data/ext/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
  1005. data/ext/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
  1006. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_fail.py +7 -0
  1007. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_succeed.py +7 -0
  1008. data/ext/gyp/test/msvs/multiple_actions_error_handling/actions.gyp +40 -0
  1009. data/ext/gyp/test/msvs/multiple_actions_error_handling/gyptest.py +26 -0
  1010. data/ext/gyp/test/msvs/props/AppName.props +14 -0
  1011. data/ext/gyp/test/msvs/props/AppName.vsprops +11 -0
  1012. data/ext/gyp/test/msvs/props/gyptest-props.py +22 -0
  1013. data/ext/gyp/test/msvs/props/hello.c +11 -0
  1014. data/ext/gyp/test/msvs/props/hello.gyp +22 -0
  1015. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.bar +5 -0
  1016. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.foo +5 -0
  1017. data/ext/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py +29 -0
  1018. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py +8 -0
  1019. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py +7 -0
  1020. data/ext/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp +52 -0
  1021. data/ext/gyp/test/msvs/shared_output/common.gypi +17 -0
  1022. data/ext/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
  1023. data/ext/gyp/test/msvs/shared_output/hello.c +12 -0
  1024. data/ext/gyp/test/msvs/shared_output/hello.gyp +21 -0
  1025. data/ext/gyp/test/msvs/shared_output/there/there.c +12 -0
  1026. data/ext/gyp/test/msvs/shared_output/there/there.gyp +16 -0
  1027. data/ext/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
  1028. data/ext/gyp/test/msvs/uldi2010/hello.c +13 -0
  1029. data/ext/gyp/test/msvs/uldi2010/hello.gyp +26 -0
  1030. data/ext/gyp/test/msvs/uldi2010/hello2.c +10 -0
  1031. data/ext/gyp/test/multiple-targets/gyptest-all.py +30 -0
  1032. data/ext/gyp/test/multiple-targets/gyptest-default.py +30 -0
  1033. data/ext/gyp/test/multiple-targets/src/common.c +7 -0
  1034. data/ext/gyp/test/multiple-targets/src/multiple.gyp +24 -0
  1035. data/ext/gyp/test/multiple-targets/src/prog1.c +10 -0
  1036. data/ext/gyp/test/multiple-targets/src/prog2.c +10 -0
  1037. data/ext/gyp/test/ninja/action-rule-hash/gyptest-action-rule-hash.py +32 -0
  1038. data/ext/gyp/test/ninja/action-rule-hash/subdir/action-rule-hash.gyp +29 -0
  1039. data/ext/gyp/test/ninja/action-rule-hash/subdir/emit.py +13 -0
  1040. data/ext/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +64 -0
  1041. data/ext/gyp/test/ninja/action_dependencies/src/a.c +10 -0
  1042. data/ext/gyp/test/ninja/action_dependencies/src/a.h +13 -0
  1043. data/ext/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
  1044. data/ext/gyp/test/ninja/action_dependencies/src/b.c +18 -0
  1045. data/ext/gyp/test/ninja/action_dependencies/src/b.h +13 -0
  1046. data/ext/gyp/test/ninja/action_dependencies/src/c.c +10 -0
  1047. data/ext/gyp/test/ninja/action_dependencies/src/c.h +13 -0
  1048. data/ext/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
  1049. data/ext/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
  1050. data/ext/gyp/test/ninja/chained-dependency/chained.c +5 -0
  1051. data/ext/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +30 -0
  1052. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py +23 -0
  1053. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/subdir/included.gyp +19 -0
  1054. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/test.gyp +19 -0
  1055. data/ext/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +46 -0
  1056. data/ext/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
  1057. data/ext/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +68 -0
  1058. data/ext/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
  1059. data/ext/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
  1060. data/ext/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
  1061. data/ext/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +48 -0
  1062. data/ext/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
  1063. data/ext/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
  1064. data/ext/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
  1065. data/ext/gyp/test/ninja/use-console/foo.bar +5 -0
  1066. data/ext/gyp/test/ninja/use-console/gyptest-use-console.py +29 -0
  1067. data/ext/gyp/test/ninja/use-console/use-console.gyp +60 -0
  1068. data/ext/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
  1069. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
  1070. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
  1071. data/ext/gyp/test/no-cpp/gyptest-no-cpp.py +53 -0
  1072. data/ext/gyp/test/no-cpp/src/call-f-main.c +2 -0
  1073. data/ext/gyp/test/no-cpp/src/empty-main.c +1 -0
  1074. data/ext/gyp/test/no-cpp/src/f.cc +3 -0
  1075. data/ext/gyp/test/no-cpp/src/test.gyp +25 -0
  1076. data/ext/gyp/test/no-output/gyptest-no-output.py +21 -0
  1077. data/ext/gyp/test/no-output/src/nooutput.gyp +17 -0
  1078. data/ext/gyp/test/product/gyptest-product.py +43 -0
  1079. data/ext/gyp/test/product/hello.c +15 -0
  1080. data/ext/gyp/test/product/product.gyp +128 -0
  1081. data/ext/gyp/test/prune_targets/gyptest-prune-targets.py +66 -0
  1082. data/ext/gyp/test/prune_targets/lib1.cc +6 -0
  1083. data/ext/gyp/test/prune_targets/lib2.cc +6 -0
  1084. data/ext/gyp/test/prune_targets/lib3.cc +6 -0
  1085. data/ext/gyp/test/prune_targets/lib_indirect.cc +6 -0
  1086. data/ext/gyp/test/prune_targets/program.cc +7 -0
  1087. data/ext/gyp/test/prune_targets/test1.gyp +26 -0
  1088. data/ext/gyp/test/prune_targets/test2.gyp +30 -0
  1089. data/ext/gyp/test/relative/foo/a/a.cc +9 -0
  1090. data/ext/gyp/test/relative/foo/a/a.gyp +13 -0
  1091. data/ext/gyp/test/relative/foo/a/c/c.cc +9 -0
  1092. data/ext/gyp/test/relative/foo/a/c/c.gyp +12 -0
  1093. data/ext/gyp/test/relative/foo/b/b.cc +9 -0
  1094. data/ext/gyp/test/relative/foo/b/b.gyp +9 -0
  1095. data/ext/gyp/test/relative/gyptest-default.py +25 -0
  1096. data/ext/gyp/test/rename/filecase/file.c +1 -0
  1097. data/ext/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
  1098. data/ext/gyp/test/rename/filecase/test.gyp +14 -0
  1099. data/ext/gyp/test/rename/gyptest-filecase.py +35 -0
  1100. data/ext/gyp/test/restat/gyptest-restat.py +31 -0
  1101. data/ext/gyp/test/restat/src/create_intermediate.py +17 -0
  1102. data/ext/gyp/test/restat/src/restat.gyp +50 -0
  1103. data/ext/gyp/test/restat/src/touch.py +16 -0
  1104. data/ext/gyp/test/rules/gyptest-all.py +84 -0
  1105. data/ext/gyp/test/rules/gyptest-default.py +70 -0
  1106. data/ext/gyp/test/rules/gyptest-input-root.py +26 -0
  1107. data/ext/gyp/test/rules/gyptest-special-variables.py +18 -0
  1108. data/ext/gyp/test/rules/src/actions.gyp +23 -0
  1109. data/ext/gyp/test/rules/src/an_asm.S +6 -0
  1110. data/ext/gyp/test/rules/src/as.bat +7 -0
  1111. data/ext/gyp/test/rules/src/copy-file.py +11 -0
  1112. data/ext/gyp/test/rules/src/external/external.gyp +66 -0
  1113. data/ext/gyp/test/rules/src/external/file1.in +1 -0
  1114. data/ext/gyp/test/rules/src/external/file2.in +1 -0
  1115. data/ext/gyp/test/rules/src/input-root.gyp +24 -0
  1116. data/ext/gyp/test/rules/src/noaction/file1.in +1 -0
  1117. data/ext/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
  1118. data/ext/gyp/test/rules/src/rule.py +17 -0
  1119. data/ext/gyp/test/rules/src/somefile.ext +0 -0
  1120. data/ext/gyp/test/rules/src/special-variables.gyp +34 -0
  1121. data/ext/gyp/test/rules/src/subdir1/executable.gyp +37 -0
  1122. data/ext/gyp/test/rules/src/subdir1/function1.in +6 -0
  1123. data/ext/gyp/test/rules/src/subdir1/function2.in +6 -0
  1124. data/ext/gyp/test/rules/src/subdir1/program.c +12 -0
  1125. data/ext/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp +50 -0
  1126. data/ext/gyp/test/rules/src/subdir2/file1.in +1 -0
  1127. data/ext/gyp/test/rules/src/subdir2/file2.in +1 -0
  1128. data/ext/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
  1129. data/ext/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
  1130. data/ext/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
  1131. data/ext/gyp/test/rules/src/subdir2/none.gyp +33 -0
  1132. data/ext/gyp/test/rules/src/subdir2/program.c +12 -0
  1133. data/ext/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
  1134. data/ext/gyp/test/rules/src/subdir3/function3.in +6 -0
  1135. data/ext/gyp/test/rules/src/subdir3/program.c +10 -0
  1136. data/ext/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
  1137. data/ext/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
  1138. data/ext/gyp/test/rules/src/subdir4/program.c +19 -0
  1139. data/ext/gyp/test/rules-dirname/gyptest-dirname.py +57 -0
  1140. data/ext/gyp/test/rules-dirname/src/actions.gyp +15 -0
  1141. data/ext/gyp/test/rules-dirname/src/copy-file.py +11 -0
  1142. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +8 -0
  1143. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
  1144. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +8 -0
  1145. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
  1146. data/ext/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +140 -0
  1147. data/ext/gyp/test/rules-dirname/src/subdir/main.cc +14 -0
  1148. data/ext/gyp/test/rules-dirname/src/subdir/nodir.gencc +8 -0
  1149. data/ext/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
  1150. data/ext/gyp/test/rules-rebuild/gyptest-all.py +70 -0
  1151. data/ext/gyp/test/rules-rebuild/gyptest-default.py +91 -0
  1152. data/ext/gyp/test/rules-rebuild/src/main.c +12 -0
  1153. data/ext/gyp/test/rules-rebuild/src/make-sources.py +19 -0
  1154. data/ext/gyp/test/rules-rebuild/src/prog1.in +7 -0
  1155. data/ext/gyp/test/rules-rebuild/src/prog2.in +7 -0
  1156. data/ext/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
  1157. data/ext/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +23 -0
  1158. data/ext/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
  1159. data/ext/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
  1160. data/ext/gyp/test/rules-variables/gyptest-rules-variables.py +35 -0
  1161. data/ext/gyp/test/rules-variables/src/input_ext.c +9 -0
  1162. data/ext/gyp/test/rules-variables/src/input_name/test.c +9 -0
  1163. data/ext/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
  1164. data/ext/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
  1165. data/ext/gyp/test/rules-variables/src/subdir/test.c +18 -0
  1166. data/ext/gyp/test/rules-variables/src/test.input_root.c +9 -0
  1167. data/ext/gyp/test/rules-variables/src/variables.gyp +40 -0
  1168. data/ext/gyp/test/same-gyp-name/gyptest-all.py +38 -0
  1169. data/ext/gyp/test/same-gyp-name/gyptest-default.py +38 -0
  1170. data/ext/gyp/test/same-gyp-name/gyptest-library.py +20 -0
  1171. data/ext/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
  1172. data/ext/gyp/test/same-gyp-name/library/test.gyp +15 -0
  1173. data/ext/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
  1174. data/ext/gyp/test/same-gyp-name/src/all.gyp +16 -0
  1175. data/ext/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
  1176. data/ext/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
  1177. data/ext/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
  1178. data/ext/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
  1179. data/ext/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
  1180. data/ext/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
  1181. data/ext/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
  1182. data/ext/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
  1183. data/ext/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
  1184. data/ext/gyp/test/same-source-file-name/gyptest-all.py +34 -0
  1185. data/ext/gyp/test/same-source-file-name/gyptest-default.py +34 -0
  1186. data/ext/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
  1187. data/ext/gyp/test/same-source-file-name/gyptest-pass-shared.py +18 -0
  1188. data/ext/gyp/test/same-source-file-name/gyptest-static.py +34 -0
  1189. data/ext/gyp/test/same-source-file-name/src/all.gyp +30 -0
  1190. data/ext/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
  1191. data/ext/gyp/test/same-source-file-name/src/double-shared.gyp +27 -0
  1192. data/ext/gyp/test/same-source-file-name/src/double-static.gyp +22 -0
  1193. data/ext/gyp/test/same-source-file-name/src/func.c +6 -0
  1194. data/ext/gyp/test/same-source-file-name/src/prog1.c +16 -0
  1195. data/ext/gyp/test/same-source-file-name/src/prog2.c +16 -0
  1196. data/ext/gyp/test/same-source-file-name/src/prog3.c +18 -0
  1197. data/ext/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
  1198. data/ext/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
  1199. data/ext/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
  1200. data/ext/gyp/test/same-target-name/src/all.gyp +16 -0
  1201. data/ext/gyp/test/same-target-name/src/executable1.gyp +15 -0
  1202. data/ext/gyp/test/same-target-name/src/executable2.gyp +15 -0
  1203. data/ext/gyp/test/same-target-name-different-directory/gyptest-all.py +41 -0
  1204. data/ext/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
  1205. data/ext/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
  1206. data/ext/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
  1207. data/ext/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
  1208. data/ext/gyp/test/sanitize-rule-names/blah.S +0 -0
  1209. data/ext/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
  1210. data/ext/gyp/test/sanitize-rule-names/hello.cc +7 -0
  1211. data/ext/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
  1212. data/ext/gyp/test/sanitize-rule-names/script.py +10 -0
  1213. data/ext/gyp/test/self-dependency/common.gypi +13 -0
  1214. data/ext/gyp/test/self-dependency/dep.gyp +23 -0
  1215. data/ext/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
  1216. data/ext/gyp/test/self-dependency/self_dependency.gyp +15 -0
  1217. data/ext/gyp/test/sibling/gyptest-all.py +42 -0
  1218. data/ext/gyp/test/sibling/gyptest-relocate.py +44 -0
  1219. data/ext/gyp/test/sibling/src/build/all.gyp +16 -0
  1220. data/ext/gyp/test/sibling/src/prog1/prog1.c +7 -0
  1221. data/ext/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
  1222. data/ext/gyp/test/sibling/src/prog2/prog2.c +7 -0
  1223. data/ext/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
  1224. data/ext/gyp/test/small/gyptest-small.py +56 -0
  1225. data/ext/gyp/test/standalone/gyptest-standalone.py +35 -0
  1226. data/ext/gyp/test/standalone/standalone.gyp +12 -0
  1227. data/ext/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +50 -0
  1228. data/ext/gyp/test/standalone-static-library/invalid.gyp +16 -0
  1229. data/ext/gyp/test/standalone-static-library/mylib.c +7 -0
  1230. data/ext/gyp/test/standalone-static-library/mylib.gyp +26 -0
  1231. data/ext/gyp/test/standalone-static-library/prog.c +7 -0
  1232. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
  1233. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
  1234. data/ext/gyp/test/subdirectory/gyptest-subdir-all.py +34 -0
  1235. data/ext/gyp/test/subdirectory/gyptest-subdir-default.py +34 -0
  1236. data/ext/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
  1237. data/ext/gyp/test/subdirectory/gyptest-top-all.py +43 -0
  1238. data/ext/gyp/test/subdirectory/gyptest-top-default.py +43 -0
  1239. data/ext/gyp/test/subdirectory/src/prog1.c +7 -0
  1240. data/ext/gyp/test/subdirectory/src/prog1.gyp +21 -0
  1241. data/ext/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
  1242. data/ext/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
  1243. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
  1244. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
  1245. data/ext/gyp/test/subdirectory/src/symroot.gypi +16 -0
  1246. data/ext/gyp/test/symlinks/gyptest-symlinks.py +66 -0
  1247. data/ext/gyp/test/symlinks/hello.c +12 -0
  1248. data/ext/gyp/test/symlinks/hello.gyp +15 -0
  1249. data/ext/gyp/test/target/gyptest-target.py +37 -0
  1250. data/ext/gyp/test/target/hello.c +7 -0
  1251. data/ext/gyp/test/target/target.gyp +24 -0
  1252. data/ext/gyp/test/toolsets/gyptest-toolsets.py +31 -0
  1253. data/ext/gyp/test/toolsets/main.cc +13 -0
  1254. data/ext/gyp/test/toolsets/toolsets.cc +11 -0
  1255. data/ext/gyp/test/toolsets/toolsets.gyp +62 -0
  1256. data/ext/gyp/test/toolsets/toolsets_shared.cc +11 -0
  1257. data/ext/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
  1258. data/ext/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
  1259. data/ext/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
  1260. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
  1261. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
  1262. data/ext/gyp/test/variables/commands/commands-repeated.gyp +128 -0
  1263. data/ext/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
  1264. data/ext/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
  1265. data/ext/gyp/test/variables/commands/commands.gyp +91 -0
  1266. data/ext/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
  1267. data/ext/gyp/test/variables/commands/commands.gyp.stdout +96 -0
  1268. data/ext/gyp/test/variables/commands/commands.gypd.golden +66 -0
  1269. data/ext/gyp/test/variables/commands/commands.gypi +23 -0
  1270. data/ext/gyp/test/variables/commands/gyptest-commands-ignore-env.py +47 -0
  1271. data/ext/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py +23 -0
  1272. data/ext/gyp/test/variables/commands/gyptest-commands-repeated.py +40 -0
  1273. data/ext/gyp/test/variables/commands/gyptest-commands.py +40 -0
  1274. data/ext/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp +13 -0
  1275. data/ext/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp +13 -0
  1276. data/ext/gyp/test/variables/commands/repeated_multidir/main.gyp +16 -0
  1277. data/ext/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py +11 -0
  1278. data/ext/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi +25 -0
  1279. data/ext/gyp/test/variables/commands/test.py +7 -0
  1280. data/ext/gyp/test/variables/commands/update_golden +11 -0
  1281. data/ext/gyp/test/variables/empty/empty.gyp +13 -0
  1282. data/ext/gyp/test/variables/empty/empty.gypi +9 -0
  1283. data/ext/gyp/test/variables/empty/gyptest-empty.py +19 -0
  1284. data/ext/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
  1285. data/ext/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
  1286. data/ext/gyp/test/variables/filelist/gyptest-filelist-golden.py +53 -0
  1287. data/ext/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
  1288. data/ext/gyp/test/variables/filelist/src/dummy.py +5 -0
  1289. data/ext/gyp/test/variables/filelist/src/filelist.gyp +93 -0
  1290. data/ext/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
  1291. data/ext/gyp/test/variables/filelist/update_golden +8 -0
  1292. data/ext/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
  1293. data/ext/gyp/test/variables/latelate/src/latelate.gyp +34 -0
  1294. data/ext/gyp/test/variables/latelate/src/program.cc +13 -0
  1295. data/ext/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
  1296. data/ext/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
  1297. data/ext/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
  1298. data/ext/gyp/test/win/asm-files/asm-files.gyp +17 -0
  1299. data/ext/gyp/test/win/asm-files/b.s +0 -0
  1300. data/ext/gyp/test/win/asm-files/c.S +0 -0
  1301. data/ext/gyp/test/win/asm-files/hello.cc +7 -0
  1302. data/ext/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
  1303. data/ext/gyp/test/win/batch-file-action/infile +1 -0
  1304. data/ext/gyp/test/win/batch-file-action/somecmd.bat +5 -0
  1305. data/ext/gyp/test/win/command-quote/a.S +0 -0
  1306. data/ext/gyp/test/win/command-quote/bat with spaces.bat +7 -0
  1307. data/ext/gyp/test/win/command-quote/command-quote.gyp +79 -0
  1308. data/ext/gyp/test/win/command-quote/go.bat +7 -0
  1309. data/ext/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +27 -0
  1310. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
  1311. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
  1312. data/ext/gyp/test/win/compiler-flags/additional-options.cc +10 -0
  1313. data/ext/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
  1314. data/ext/gyp/test/win/compiler-flags/analysis.gyp +40 -0
  1315. data/ext/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
  1316. data/ext/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
  1317. data/ext/gyp/test/win/compiler-flags/calling-convention-cdecl.def +6 -0
  1318. data/ext/gyp/test/win/compiler-flags/calling-convention-fastcall.def +6 -0
  1319. data/ext/gyp/test/win/compiler-flags/calling-convention-stdcall.def +6 -0
  1320. data/ext/gyp/test/win/compiler-flags/calling-convention-vectorcall.def +6 -0
  1321. data/ext/gyp/test/win/compiler-flags/calling-convention.cc +6 -0
  1322. data/ext/gyp/test/win/compiler-flags/calling-convention.gyp +66 -0
  1323. data/ext/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
  1324. data/ext/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
  1325. data/ext/gyp/test/win/compiler-flags/character-set.gyp +35 -0
  1326. data/ext/gyp/test/win/compiler-flags/compile-as-managed.cc +9 -0
  1327. data/ext/gyp/test/win/compiler-flags/compile-as-managed.gyp +29 -0
  1328. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.cc +12 -0
  1329. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.gyp +20 -0
  1330. data/ext/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
  1331. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
  1332. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
  1333. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
  1334. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
  1335. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc +28 -0
  1336. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp +68 -0
  1337. data/ext/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
  1338. data/ext/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
  1339. data/ext/gyp/test/win/compiler-flags/floating-point-model-fast.cc +19 -0
  1340. data/ext/gyp/test/win/compiler-flags/floating-point-model-precise.cc +19 -0
  1341. data/ext/gyp/test/win/compiler-flags/floating-point-model-strict.cc +19 -0
  1342. data/ext/gyp/test/win/compiler-flags/floating-point-model.gyp +43 -0
  1343. data/ext/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
  1344. data/ext/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
  1345. data/ext/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
  1346. data/ext/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
  1347. data/ext/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
  1348. data/ext/gyp/test/win/compiler-flags/hello.cc +7 -0
  1349. data/ext/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
  1350. data/ext/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
  1351. data/ext/gyp/test/win/compiler-flags/pdbname.cc +7 -0
  1352. data/ext/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
  1353. data/ext/gyp/test/win/compiler-flags/precomp.cc +6 -0
  1354. data/ext/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
  1355. data/ext/gyp/test/win/compiler-flags/rtti.gyp +37 -0
  1356. data/ext/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
  1357. data/ext/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
  1358. data/ext/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
  1359. data/ext/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
  1360. data/ext/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
  1361. data/ext/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
  1362. data/ext/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
  1363. data/ext/gyp/test/win/compiler-flags/subdir/header.h +0 -0
  1364. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
  1365. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
  1366. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
  1367. data/ext/gyp/test/win/compiler-flags/uninit.cc +13 -0
  1368. data/ext/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
  1369. data/ext/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
  1370. data/ext/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
  1371. data/ext/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
  1372. data/ext/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
  1373. data/ext/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
  1374. data/ext/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
  1375. data/ext/gyp/test/win/enable-winrt/dllmain.cc +30 -0
  1376. data/ext/gyp/test/win/enable-winrt/enable-winrt.gyp +39 -0
  1377. data/ext/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
  1378. data/ext/gyp/test/win/generator-output-different-drive/prog.c +10 -0
  1379. data/ext/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
  1380. data/ext/gyp/test/win/gyptest-asm-files.py +26 -0
  1381. data/ext/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
  1382. data/ext/gyp/test/win/gyptest-cl-additional-options.py +28 -0
  1383. data/ext/gyp/test/win/gyptest-cl-analysis.py +30 -0
  1384. data/ext/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
  1385. data/ext/gyp/test/win/gyptest-cl-calling-convention.py +22 -0
  1386. data/ext/gyp/test/win/gyptest-cl-character-set.py +22 -0
  1387. data/ext/gyp/test/win/gyptest-cl-compile-as-managed.py +24 -0
  1388. data/ext/gyp/test/win/gyptest-cl-compile-as-winrt.py +20 -0
  1389. data/ext/gyp/test/win/gyptest-cl-debug-format.py +43 -0
  1390. data/ext/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
  1391. data/ext/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
  1392. data/ext/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py +49 -0
  1393. data/ext/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
  1394. data/ext/gyp/test/win/gyptest-cl-floating-point-model.py +22 -0
  1395. data/ext/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
  1396. data/ext/gyp/test/win/gyptest-cl-function-level-linking.py +54 -0
  1397. data/ext/gyp/test/win/gyptest-cl-optimizations.py +105 -0
  1398. data/ext/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
  1399. data/ext/gyp/test/win/gyptest-cl-pdbname.py +30 -0
  1400. data/ext/gyp/test/win/gyptest-cl-rtti.py +30 -0
  1401. data/ext/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
  1402. data/ext/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
  1403. data/ext/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
  1404. data/ext/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
  1405. data/ext/gyp/test/win/gyptest-cl-warning-level.py +41 -0
  1406. data/ext/gyp/test/win/gyptest-command-quote.py +42 -0
  1407. data/ext/gyp/test/win/gyptest-crosscompile-ar.py +29 -0
  1408. data/ext/gyp/test/win/gyptest-lib-ltcg.py +22 -0
  1409. data/ext/gyp/test/win/gyptest-link-additional-deps.py +22 -0
  1410. data/ext/gyp/test/win/gyptest-link-additional-options.py +22 -0
  1411. data/ext/gyp/test/win/gyptest-link-aslr.py +35 -0
  1412. data/ext/gyp/test/win/gyptest-link-base-address.py +62 -0
  1413. data/ext/gyp/test/win/gyptest-link-debug-info.py +26 -0
  1414. data/ext/gyp/test/win/gyptest-link-default-libs.py +22 -0
  1415. data/ext/gyp/test/win/gyptest-link-deffile.py +43 -0
  1416. data/ext/gyp/test/win/gyptest-link-defrelink.py +56 -0
  1417. data/ext/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
  1418. data/ext/gyp/test/win/gyptest-link-embed-manifest.py +100 -0
  1419. data/ext/gyp/test/win/gyptest-link-enable-uac.py +104 -0
  1420. data/ext/gyp/test/win/gyptest-link-enable-winrt-app-revision.py +43 -0
  1421. data/ext/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py +47 -0
  1422. data/ext/gyp/test/win/gyptest-link-enable-winrt.py +37 -0
  1423. data/ext/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
  1424. data/ext/gyp/test/win/gyptest-link-fixed-base.py +40 -0
  1425. data/ext/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
  1426. data/ext/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
  1427. data/ext/gyp/test/win/gyptest-link-incremental.py +37 -0
  1428. data/ext/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
  1429. data/ext/gyp/test/win/gyptest-link-large-pdb.py +76 -0
  1430. data/ext/gyp/test/win/gyptest-link-library-adjust.py +21 -0
  1431. data/ext/gyp/test/win/gyptest-link-library-directories.py +35 -0
  1432. data/ext/gyp/test/win/gyptest-link-ltcg.py +44 -0
  1433. data/ext/gyp/test/win/gyptest-link-mapfile.py +44 -0
  1434. data/ext/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
  1435. data/ext/gyp/test/win/gyptest-link-noimportlib.py +30 -0
  1436. data/ext/gyp/test/win/gyptest-link-nxcompat.py +37 -0
  1437. data/ext/gyp/test/win/gyptest-link-opt-icf.py +41 -0
  1438. data/ext/gyp/test/win/gyptest-link-opt-ref.py +40 -0
  1439. data/ext/gyp/test/win/gyptest-link-ordering.py +103 -0
  1440. data/ext/gyp/test/win/gyptest-link-outputfile.py +28 -0
  1441. data/ext/gyp/test/win/gyptest-link-pdb-no-output.py +25 -0
  1442. data/ext/gyp/test/win/gyptest-link-pdb-output.py +33 -0
  1443. data/ext/gyp/test/win/gyptest-link-pdb.py +35 -0
  1444. data/ext/gyp/test/win/gyptest-link-pgo.py +75 -0
  1445. data/ext/gyp/test/win/gyptest-link-profile.py +37 -0
  1446. data/ext/gyp/test/win/gyptest-link-restat-importlib.py +47 -0
  1447. data/ext/gyp/test/win/gyptest-link-safeseh.py +46 -0
  1448. data/ext/gyp/test/win/gyptest-link-shard.py +30 -0
  1449. data/ext/gyp/test/win/gyptest-link-stacksize.py +62 -0
  1450. data/ext/gyp/test/win/gyptest-link-subsystem.py +38 -0
  1451. data/ext/gyp/test/win/gyptest-link-target-machine.py +28 -0
  1452. data/ext/gyp/test/win/gyptest-link-tsaware.py +33 -0
  1453. data/ext/gyp/test/win/gyptest-link-uldi-depending-on-module.py +24 -0
  1454. data/ext/gyp/test/win/gyptest-link-uldi.py +28 -0
  1455. data/ext/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
  1456. data/ext/gyp/test/win/gyptest-link-update-manifest.py +104 -0
  1457. data/ext/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
  1458. data/ext/gyp/test/win/gyptest-long-command-line.py +23 -0
  1459. data/ext/gyp/test/win/gyptest-macro-projectname.py +24 -0
  1460. data/ext/gyp/test/win/gyptest-macro-targetext.py +26 -0
  1461. data/ext/gyp/test/win/gyptest-macro-targetfilename.py +37 -0
  1462. data/ext/gyp/test/win/gyptest-macro-targetname.py +29 -0
  1463. data/ext/gyp/test/win/gyptest-macro-targetpath.py +30 -0
  1464. data/ext/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
  1465. data/ext/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
  1466. data/ext/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
  1467. data/ext/gyp/test/win/gyptest-midl-excluded.py +22 -0
  1468. data/ext/gyp/test/win/gyptest-midl-includedirs.py +21 -0
  1469. data/ext/gyp/test/win/gyptest-midl-rules.py +28 -0
  1470. data/ext/gyp/test/win/gyptest-ml-safeseh.py +22 -0
  1471. data/ext/gyp/test/win/gyptest-quoting-commands.py +25 -0
  1472. data/ext/gyp/test/win/gyptest-rc-build.py +29 -0
  1473. data/ext/gyp/test/win/gyptest-sys.py +27 -0
  1474. data/ext/gyp/test/win/gyptest-system-include.py +21 -0
  1475. data/ext/gyp/test/win/idl-excluded/bad.idl +6 -0
  1476. data/ext/gyp/test/win/idl-excluded/copy-file.py +11 -0
  1477. data/ext/gyp/test/win/idl-excluded/idl-excluded.gyp +58 -0
  1478. data/ext/gyp/test/win/idl-excluded/program.cc +7 -0
  1479. data/ext/gyp/test/win/idl-includedirs/hello.cc +7 -0
  1480. data/ext/gyp/test/win/idl-includedirs/idl-includedirs.gyp +26 -0
  1481. data/ext/gyp/test/win/idl-includedirs/subdir/bar.idl +13 -0
  1482. data/ext/gyp/test/win/idl-includedirs/subdir/foo.idl +14 -0
  1483. data/ext/gyp/test/win/idl-rules/Window.idl +9 -0
  1484. data/ext/gyp/test/win/idl-rules/basic-idl.gyp +67 -0
  1485. data/ext/gyp/test/win/idl-rules/history_indexer.idl +17 -0
  1486. data/ext/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
  1487. data/ext/gyp/test/win/idl-rules/idl_compiler.py +17 -0
  1488. data/ext/gyp/test/win/importlib/dll_no_exports.cc +9 -0
  1489. data/ext/gyp/test/win/importlib/has-exports.cc +10 -0
  1490. data/ext/gyp/test/win/importlib/hello.cc +9 -0
  1491. data/ext/gyp/test/win/importlib/importlib.gyp +30 -0
  1492. data/ext/gyp/test/win/importlib/noimplib.gyp +16 -0
  1493. data/ext/gyp/test/win/large-pdb/dllmain.cc +9 -0
  1494. data/ext/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
  1495. data/ext/gyp/test/win/large-pdb/main.cc +7 -0
  1496. data/ext/gyp/test/win/lib-crosscompile/answer.cc +9 -0
  1497. data/ext/gyp/test/win/lib-crosscompile/answer.h +5 -0
  1498. data/ext/gyp/test/win/lib-crosscompile/use_host_ar.gyp +17 -0
  1499. data/ext/gyp/test/win/lib-flags/answer.cc +9 -0
  1500. data/ext/gyp/test/win/lib-flags/answer.h +5 -0
  1501. data/ext/gyp/test/win/lib-flags/ltcg.gyp +21 -0
  1502. data/ext/gyp/test/win/linker-flags/a/x.cc +7 -0
  1503. data/ext/gyp/test/win/linker-flags/a/z.cc +7 -0
  1504. data/ext/gyp/test/win/linker-flags/additional-deps.cc +10 -0
  1505. data/ext/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
  1506. data/ext/gyp/test/win/linker-flags/additional-options.gyp +29 -0
  1507. data/ext/gyp/test/win/linker-flags/aslr.gyp +35 -0
  1508. data/ext/gyp/test/win/linker-flags/b/y.cc +7 -0
  1509. data/ext/gyp/test/win/linker-flags/base-address.gyp +38 -0
  1510. data/ext/gyp/test/win/linker-flags/debug-info.gyp +28 -0
  1511. data/ext/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
  1512. data/ext/gyp/test/win/linker-flags/deffile.cc +13 -0
  1513. data/ext/gyp/test/win/linker-flags/deffile.def +8 -0
  1514. data/ext/gyp/test/win/linker-flags/deffile.gyp +38 -0
  1515. data/ext/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
  1516. data/ext/gyp/test/win/linker-flags/delay-load.cc +10 -0
  1517. data/ext/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
  1518. data/ext/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
  1519. data/ext/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
  1520. data/ext/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
  1521. data/ext/gyp/test/win/linker-flags/extra.manifest +11 -0
  1522. data/ext/gyp/test/win/linker-flags/extra2.manifest +11 -0
  1523. data/ext/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
  1524. data/ext/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
  1525. data/ext/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
  1526. data/ext/gyp/test/win/linker-flags/hello.cc +7 -0
  1527. data/ext/gyp/test/win/linker-flags/incremental.gyp +65 -0
  1528. data/ext/gyp/test/win/linker-flags/inline_test.cc +12 -0
  1529. data/ext/gyp/test/win/linker-flags/inline_test.h +5 -0
  1530. data/ext/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
  1531. data/ext/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
  1532. data/ext/gyp/test/win/linker-flags/library-adjust.cc +10 -0
  1533. data/ext/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
  1534. data/ext/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
  1535. data/ext/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
  1536. data/ext/gyp/test/win/linker-flags/library-directories.gyp +42 -0
  1537. data/ext/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
  1538. data/ext/gyp/test/win/linker-flags/link-warning.cc +10 -0
  1539. data/ext/gyp/test/win/linker-flags/ltcg.gyp +42 -0
  1540. data/ext/gyp/test/win/linker-flags/main-crt.c +8 -0
  1541. data/ext/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
  1542. data/ext/gyp/test/win/linker-flags/mapfile.cc +12 -0
  1543. data/ext/gyp/test/win/linker-flags/mapfile.gyp +45 -0
  1544. data/ext/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
  1545. data/ext/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
  1546. data/ext/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
  1547. data/ext/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
  1548. data/ext/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
  1549. data/ext/gyp/test/win/linker-flags/opt-icf.cc +29 -0
  1550. data/ext/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
  1551. data/ext/gyp/test/win/linker-flags/opt-ref.cc +11 -0
  1552. data/ext/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
  1553. data/ext/gyp/test/win/linker-flags/outputfile.gyp +58 -0
  1554. data/ext/gyp/test/win/linker-flags/pdb-output.gyp +49 -0
  1555. data/ext/gyp/test/win/linker-flags/pgo.gyp +143 -0
  1556. data/ext/gyp/test/win/linker-flags/profile.gyp +50 -0
  1557. data/ext/gyp/test/win/linker-flags/program-database.gyp +40 -0
  1558. data/ext/gyp/test/win/linker-flags/safeseh.gyp +79 -0
  1559. data/ext/gyp/test/win/linker-flags/safeseh_hello.cc +11 -0
  1560. data/ext/gyp/test/win/linker-flags/safeseh_zero.asm +10 -0
  1561. data/ext/gyp/test/win/linker-flags/safeseh_zero64.asm +9 -0
  1562. data/ext/gyp/test/win/linker-flags/stacksize.gyp +44 -0
  1563. data/ext/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
  1564. data/ext/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
  1565. data/ext/gyp/test/win/linker-flags/subsystem.gyp +70 -0
  1566. data/ext/gyp/test/win/linker-flags/target-machine.gyp +48 -0
  1567. data/ext/gyp/test/win/linker-flags/tsaware.gyp +28 -0
  1568. data/ext/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
  1569. data/ext/gyp/test/win/linker-flags/update_pgd.py +35 -0
  1570. data/ext/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
  1571. data/ext/gyp/test/win/linker-flags/x.cc +7 -0
  1572. data/ext/gyp/test/win/linker-flags/y.cc +7 -0
  1573. data/ext/gyp/test/win/linker-flags/z.cc +7 -0
  1574. data/ext/gyp/test/win/long-command-line/function.cc +7 -0
  1575. data/ext/gyp/test/win/long-command-line/hello.cc +7 -0
  1576. data/ext/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
  1577. data/ext/gyp/test/win/ml-safeseh/a.asm +10 -0
  1578. data/ext/gyp/test/win/ml-safeseh/hello.cc +11 -0
  1579. data/ext/gyp/test/win/ml-safeseh/ml-safeseh.gyp +24 -0
  1580. data/ext/gyp/test/win/precompiled/gyptest-all.py +21 -0
  1581. data/ext/gyp/test/win/precompiled/hello.c +14 -0
  1582. data/ext/gyp/test/win/precompiled/hello.gyp +28 -0
  1583. data/ext/gyp/test/win/precompiled/hello2.c +13 -0
  1584. data/ext/gyp/test/win/precompiled/precomp.c +8 -0
  1585. data/ext/gyp/test/win/rc-build/Resource.h +26 -0
  1586. data/ext/gyp/test/win/rc-build/hello.cpp +30 -0
  1587. data/ext/gyp/test/win/rc-build/hello.gyp +92 -0
  1588. data/ext/gyp/test/win/rc-build/hello.h +3 -0
  1589. data/ext/gyp/test/win/rc-build/hello.ico +0 -0
  1590. data/ext/gyp/test/win/rc-build/hello.rc +86 -0
  1591. data/ext/gyp/test/win/rc-build/hello3.rc +87 -0
  1592. data/ext/gyp/test/win/rc-build/small.ico +0 -0
  1593. data/ext/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
  1594. data/ext/gyp/test/win/rc-build/subdir/include.h +1 -0
  1595. data/ext/gyp/test/win/rc-build/targetver.h +24 -0
  1596. data/ext/gyp/test/win/shard/hello.cc +7 -0
  1597. data/ext/gyp/test/win/shard/hello1.cc +7 -0
  1598. data/ext/gyp/test/win/shard/hello2.cc +7 -0
  1599. data/ext/gyp/test/win/shard/hello3.cc +7 -0
  1600. data/ext/gyp/test/win/shard/hello4.cc +7 -0
  1601. data/ext/gyp/test/win/shard/shard.gyp +31 -0
  1602. data/ext/gyp/test/win/shard/shard_ref.gyp +41 -0
  1603. data/ext/gyp/test/win/system-include/bar/header.h +0 -0
  1604. data/ext/gyp/test/win/system-include/common/commonheader.h +0 -0
  1605. data/ext/gyp/test/win/system-include/foo/header.h +0 -0
  1606. data/ext/gyp/test/win/system-include/main.cc +4 -0
  1607. data/ext/gyp/test/win/system-include/test.gyp +26 -0
  1608. data/ext/gyp/test/win/uldi/a.cc +7 -0
  1609. data/ext/gyp/test/win/uldi/b.cc +7 -0
  1610. data/ext/gyp/test/win/uldi/dll.cc +6 -0
  1611. data/ext/gyp/test/win/uldi/exe.cc +7 -0
  1612. data/ext/gyp/test/win/uldi/main.cc +10 -0
  1613. data/ext/gyp/test/win/uldi/uldi-depending-on-module.gyp +42 -0
  1614. data/ext/gyp/test/win/uldi/uldi.gyp +45 -0
  1615. data/ext/gyp/test/win/vs-macros/as.py +20 -0
  1616. data/ext/gyp/test/win/vs-macros/containing-gyp.gyp +39 -0
  1617. data/ext/gyp/test/win/vs-macros/do_stuff.py +8 -0
  1618. data/ext/gyp/test/win/vs-macros/hello.cc +7 -0
  1619. data/ext/gyp/test/win/vs-macros/input-output-macros.gyp +32 -0
  1620. data/ext/gyp/test/win/vs-macros/input.S +0 -0
  1621. data/ext/gyp/test/win/vs-macros/projectname.gyp +29 -0
  1622. data/ext/gyp/test/win/vs-macros/stuff.blah +1 -0
  1623. data/ext/gyp/test/win/vs-macros/targetext.gyp +59 -0
  1624. data/ext/gyp/test/win/vs-macros/targetfilename.gyp +59 -0
  1625. data/ext/gyp/test/win/vs-macros/targetname.gyp +52 -0
  1626. data/ext/gyp/test/win/vs-macros/targetpath.gyp +59 -0
  1627. data/ext/gyp/test/win/vs-macros/test_exists.py +10 -0
  1628. data/ext/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
  1629. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.c +10 -0
  1630. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp +32 -0
  1631. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.h +13 -0
  1632. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.rc +14 -0
  1633. data/ext/gyp/test/win/win-tool/copies_readonly_files.gyp +29 -0
  1634. data/ext/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py +55 -0
  1635. data/ext/gyp/test/win/winrt-app-type-revision/dllmain.cc +30 -0
  1636. data/ext/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp +43 -0
  1637. data/ext/gyp/test/win/winrt-target-platform-version/dllmain.cc +30 -0
  1638. data/ext/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp +49 -0
  1639. data/ext/gyp/test/xcode-ninja/list_excluded/gyptest-all.py +49 -0
  1640. data/ext/gyp/test/xcode-ninja/list_excluded/hello.cpp +7 -0
  1641. data/ext/gyp/test/xcode-ninja/list_excluded/hello_exclude.gyp +19 -0
  1642. data/ext/gyp/test/xcode-ninja/list_excluded/hello_excluded.cpp +7 -0
  1643. data/ext/gyp/tools/README +15 -0
  1644. data/ext/gyp/tools/Xcode/README +5 -0
  1645. data/ext/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  1646. data/ext/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  1647. data/ext/gyp/tools/emacs/README +12 -0
  1648. data/ext/gyp/tools/emacs/gyp-tests.el +63 -0
  1649. data/ext/gyp/tools/emacs/gyp.el +275 -0
  1650. data/ext/gyp/tools/emacs/run-unit-tests.sh +7 -0
  1651. data/ext/gyp/tools/emacs/testdata/media.gyp +1105 -0
  1652. data/ext/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  1653. data/ext/gyp/tools/graphviz.py +102 -0
  1654. data/ext/gyp/tools/pretty_gyp.py +156 -0
  1655. data/ext/gyp/tools/pretty_sln.py +171 -0
  1656. data/ext/gyp/tools/pretty_vcproj.py +337 -0
  1657. data/ext/libuv/.gitattributes +1 -0
  1658. data/ext/libuv/.github/ISSUE_TEMPLATE.md +13 -0
  1659. data/ext/libuv/.github/stale.yml +22 -0
  1660. data/ext/libuv/.gitignore +80 -0
  1661. data/ext/libuv/.mailmap +50 -0
  1662. data/ext/libuv/AUTHORS +415 -0
  1663. data/ext/libuv/CMakeLists.txt +430 -0
  1664. data/ext/libuv/CONTRIBUTING.md +172 -0
  1665. data/ext/libuv/ChangeLog +4548 -0
  1666. data/ext/libuv/LICENSE +70 -0
  1667. data/ext/libuv/LICENSE-docs +396 -0
  1668. data/ext/libuv/MAINTAINERS.md +48 -0
  1669. data/ext/libuv/Makefile.am +548 -0
  1670. data/ext/libuv/README.md +431 -0
  1671. data/ext/libuv/SUPPORTED_PLATFORMS.md +68 -0
  1672. data/ext/libuv/android-configure-arm +23 -0
  1673. data/ext/libuv/android-configure-arm64 +23 -0
  1674. data/ext/libuv/android-configure-x86 +23 -0
  1675. data/ext/libuv/android-configure-x86_64 +25 -0
  1676. data/ext/libuv/appveyor.yml +32 -0
  1677. data/ext/libuv/autogen.sh +46 -0
  1678. data/ext/libuv/common.gypi +213 -0
  1679. data/ext/libuv/configure.ac +82 -0
  1680. data/ext/libuv/docs/Makefile +183 -0
  1681. data/ext/libuv/docs/code/cgi/main.c +81 -0
  1682. data/ext/libuv/docs/code/cgi/tick.c +13 -0
  1683. data/ext/libuv/docs/code/detach/main.c +31 -0
  1684. data/ext/libuv/docs/code/dns/main.c +80 -0
  1685. data/ext/libuv/docs/code/helloworld/main.c +15 -0
  1686. data/ext/libuv/docs/code/idle-basic/main.c +24 -0
  1687. data/ext/libuv/docs/code/idle-compute/main.c +43 -0
  1688. data/ext/libuv/docs/code/interfaces/main.c +33 -0
  1689. data/ext/libuv/docs/code/locks/main.c +57 -0
  1690. data/ext/libuv/docs/code/multi-echo-server/hammer.js +20 -0
  1691. data/ext/libuv/docs/code/multi-echo-server/main.c +114 -0
  1692. data/ext/libuv/docs/code/multi-echo-server/worker.c +88 -0
  1693. data/ext/libuv/docs/code/onchange/main.c +44 -0
  1694. data/ext/libuv/docs/code/pipe-echo-server/main.c +94 -0
  1695. data/ext/libuv/docs/code/plugin/hello.c +5 -0
  1696. data/ext/libuv/docs/code/plugin/main.c +39 -0
  1697. data/ext/libuv/docs/code/plugin/plugin.h +7 -0
  1698. data/ext/libuv/docs/code/proc-streams/main.c +49 -0
  1699. data/ext/libuv/docs/code/proc-streams/test.c +8 -0
  1700. data/ext/libuv/docs/code/progress/main.c +47 -0
  1701. data/ext/libuv/docs/code/queue-cancel/main.c +59 -0
  1702. data/ext/libuv/docs/code/queue-work/main.c +44 -0
  1703. data/ext/libuv/docs/code/ref-timer/main.c +29 -0
  1704. data/ext/libuv/docs/code/signal/main.c +66 -0
  1705. data/ext/libuv/docs/code/spawn/main.c +36 -0
  1706. data/ext/libuv/docs/code/tcp-echo-server/main.c +87 -0
  1707. data/ext/libuv/docs/code/thread-create/main.c +36 -0
  1708. data/ext/libuv/docs/code/tty/main.c +29 -0
  1709. data/ext/libuv/docs/code/tty-gravity/main.c +48 -0
  1710. data/ext/libuv/docs/code/udp-dhcp/main.c +127 -0
  1711. data/ext/libuv/docs/code/uvcat/main.c +63 -0
  1712. data/ext/libuv/docs/code/uvstop/main.c +33 -0
  1713. data/ext/libuv/docs/code/uvtee/main.c +80 -0
  1714. data/ext/libuv/docs/code/uvwget/main.c +166 -0
  1715. data/ext/libuv/docs/make.bat +243 -0
  1716. data/ext/libuv/docs/src/api.rst +35 -0
  1717. data/ext/libuv/docs/src/async.rst +65 -0
  1718. data/ext/libuv/docs/src/check.rst +46 -0
  1719. data/ext/libuv/docs/src/conf.py +348 -0
  1720. data/ext/libuv/docs/src/design.rst +140 -0
  1721. data/ext/libuv/docs/src/dll.rst +44 -0
  1722. data/ext/libuv/docs/src/dns.rst +108 -0
  1723. data/ext/libuv/docs/src/errors.rst +365 -0
  1724. data/ext/libuv/docs/src/fs.rst +689 -0
  1725. data/ext/libuv/docs/src/fs_event.rst +132 -0
  1726. data/ext/libuv/docs/src/fs_poll.rst +77 -0
  1727. data/ext/libuv/docs/src/guide/about.rst +22 -0
  1728. data/ext/libuv/docs/src/guide/basics.rst +219 -0
  1729. data/ext/libuv/docs/src/guide/eventloops.rst +48 -0
  1730. data/ext/libuv/docs/src/guide/filesystem.rst +330 -0
  1731. data/ext/libuv/docs/src/guide/introduction.rst +75 -0
  1732. data/ext/libuv/docs/src/guide/networking.rst +250 -0
  1733. data/ext/libuv/docs/src/guide/processes.rst +406 -0
  1734. data/ext/libuv/docs/src/guide/threads.rst +385 -0
  1735. data/ext/libuv/docs/src/guide/utilities.rst +437 -0
  1736. data/ext/libuv/docs/src/guide.rst +22 -0
  1737. data/ext/libuv/docs/src/handle.rst +283 -0
  1738. data/ext/libuv/docs/src/idle.rst +54 -0
  1739. data/ext/libuv/docs/src/index.rst +62 -0
  1740. data/ext/libuv/docs/src/loop.rst +238 -0
  1741. data/ext/libuv/docs/src/migration_010_100.rst +244 -0
  1742. data/ext/libuv/docs/src/misc.rst +702 -0
  1743. data/ext/libuv/docs/src/pipe.rst +116 -0
  1744. data/ext/libuv/docs/src/poll.rst +121 -0
  1745. data/ext/libuv/docs/src/prepare.rst +46 -0
  1746. data/ext/libuv/docs/src/process.rst +250 -0
  1747. data/ext/libuv/docs/src/request.rst +116 -0
  1748. data/ext/libuv/docs/src/signal.rst +101 -0
  1749. data/ext/libuv/docs/src/sphinx-plugins/manpage.py +45 -0
  1750. data/ext/libuv/docs/src/static/architecture.png +0 -0
  1751. data/ext/libuv/docs/src/static/diagrams.key/Data/st0-311.jpg +0 -0
  1752. data/ext/libuv/docs/src/static/diagrams.key/Data/st1-475.jpg +0 -0
  1753. data/ext/libuv/docs/src/static/diagrams.key/Index.zip +0 -0
  1754. data/ext/libuv/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist +8 -0
  1755. data/ext/libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier +1 -0
  1756. data/ext/libuv/docs/src/static/diagrams.key/Metadata/Properties.plist +0 -0
  1757. data/ext/libuv/docs/src/static/diagrams.key/preview-micro.jpg +0 -0
  1758. data/ext/libuv/docs/src/static/diagrams.key/preview-web.jpg +0 -0
  1759. data/ext/libuv/docs/src/static/diagrams.key/preview.jpg +0 -0
  1760. data/ext/libuv/docs/src/static/favicon.ico +0 -0
  1761. data/ext/libuv/docs/src/static/logo.png +0 -0
  1762. data/ext/libuv/docs/src/static/loop_iteration.png +0 -0
  1763. data/ext/libuv/docs/src/stream.rst +237 -0
  1764. data/ext/libuv/docs/src/tcp.rst +125 -0
  1765. data/ext/libuv/docs/src/threading.rst +197 -0
  1766. data/ext/libuv/docs/src/threadpool.rst +69 -0
  1767. data/ext/libuv/docs/src/timer.rst +81 -0
  1768. data/ext/libuv/docs/src/tty.rst +139 -0
  1769. data/ext/libuv/docs/src/udp.rst +390 -0
  1770. data/ext/libuv/docs/src/upgrading.rst +11 -0
  1771. data/ext/libuv/docs/src/version.rst +60 -0
  1772. data/ext/libuv/gyp_uv.py +73 -0
  1773. data/ext/libuv/img/banner.png +0 -0
  1774. data/ext/libuv/img/logos.svg +152 -0
  1775. data/ext/libuv/include/uv/aix.h +32 -0
  1776. data/ext/libuv/include/uv/android-ifaddrs.h +54 -0
  1777. data/ext/libuv/include/uv/bsd.h +34 -0
  1778. data/ext/libuv/include/uv/darwin.h +61 -0
  1779. data/ext/libuv/include/uv/errno.h +448 -0
  1780. data/ext/libuv/include/uv/linux.h +34 -0
  1781. data/ext/libuv/include/uv/os390.h +33 -0
  1782. data/ext/libuv/include/uv/posix.h +31 -0
  1783. data/ext/libuv/include/uv/stdint-msvc2008.h +247 -0
  1784. data/ext/libuv/include/uv/sunos.h +44 -0
  1785. data/ext/libuv/include/uv/threadpool.h +37 -0
  1786. data/ext/libuv/include/uv/tree.h +768 -0
  1787. data/ext/libuv/include/uv/unix.h +505 -0
  1788. data/ext/libuv/include/uv/version.h +43 -0
  1789. data/ext/libuv/include/uv/win.h +691 -0
  1790. data/ext/libuv/include/uv.h +1782 -0
  1791. data/ext/libuv/libuv.pc.in +12 -0
  1792. data/ext/libuv/m4/.gitignore +4 -0
  1793. data/ext/libuv/m4/as_case.m4 +21 -0
  1794. data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
  1795. data/ext/libuv/src/fs-poll.c +287 -0
  1796. data/ext/libuv/src/heap-inl.h +245 -0
  1797. data/ext/libuv/src/idna.c +291 -0
  1798. data/ext/libuv/src/idna.h +31 -0
  1799. data/ext/libuv/src/inet.c +302 -0
  1800. data/ext/libuv/src/queue.h +108 -0
  1801. data/ext/libuv/src/random.c +123 -0
  1802. data/ext/libuv/src/strscpy.c +17 -0
  1803. data/ext/libuv/src/strscpy.h +18 -0
  1804. data/ext/libuv/src/threadpool.c +388 -0
  1805. data/ext/libuv/src/timer.c +181 -0
  1806. data/ext/libuv/src/unix/aix-common.c +337 -0
  1807. data/ext/libuv/src/unix/aix.c +1066 -0
  1808. data/ext/libuv/src/unix/android-ifaddrs.c +712 -0
  1809. data/ext/libuv/src/unix/async.c +298 -0
  1810. data/ext/libuv/src/unix/atomic-ops.h +59 -0
  1811. data/ext/libuv/src/unix/bsd-ifaddrs.c +161 -0
  1812. data/ext/libuv/src/unix/bsd-proctitle.c +93 -0
  1813. data/ext/libuv/src/unix/core.c +1571 -0
  1814. data/ext/libuv/src/unix/cygwin.c +53 -0
  1815. data/ext/libuv/src/unix/darwin-proctitle.c +202 -0
  1816. data/ext/libuv/src/unix/darwin.c +225 -0
  1817. data/ext/libuv/src/unix/dl.c +80 -0
  1818. data/ext/libuv/src/unix/freebsd.c +290 -0
  1819. data/ext/libuv/src/unix/fs.c +2044 -0
  1820. data/ext/libuv/src/unix/fsevents.c +924 -0
  1821. data/ext/libuv/src/unix/getaddrinfo.c +255 -0
  1822. data/ext/libuv/src/unix/getnameinfo.c +121 -0
  1823. data/ext/libuv/src/unix/haiku.c +167 -0
  1824. data/ext/libuv/src/unix/ibmi.c +249 -0
  1825. data/ext/libuv/src/unix/internal.h +331 -0
  1826. data/ext/libuv/src/unix/kqueue.c +544 -0
  1827. data/ext/libuv/src/unix/linux-core.c +1091 -0
  1828. data/ext/libuv/src/unix/linux-inotify.c +354 -0
  1829. data/ext/libuv/src/unix/linux-syscalls.c +394 -0
  1830. data/ext/libuv/src/unix/linux-syscalls.h +153 -0
  1831. data/ext/libuv/src/unix/loop-watcher.c +68 -0
  1832. data/ext/libuv/src/unix/loop.c +194 -0
  1833. data/ext/libuv/src/unix/netbsd.c +259 -0
  1834. data/ext/libuv/src/unix/no-fsevents.c +42 -0
  1835. data/ext/libuv/src/unix/no-proctitle.c +42 -0
  1836. data/ext/libuv/src/unix/openbsd.c +244 -0
  1837. data/ext/libuv/src/unix/os390-syscalls.c +519 -0
  1838. data/ext/libuv/src/unix/os390-syscalls.h +68 -0
  1839. data/ext/libuv/src/unix/os390.c +1003 -0
  1840. data/ext/libuv/src/unix/pipe.c +377 -0
  1841. data/ext/libuv/src/unix/poll.c +150 -0
  1842. data/ext/libuv/src/unix/posix-hrtime.c +35 -0
  1843. data/ext/libuv/src/unix/posix-poll.c +336 -0
  1844. data/ext/libuv/src/unix/process.c +603 -0
  1845. data/ext/libuv/src/unix/procfs-exepath.c +45 -0
  1846. data/ext/libuv/src/unix/proctitle.c +132 -0
  1847. data/ext/libuv/src/unix/pthread-fixes.c +56 -0
  1848. data/ext/libuv/src/unix/random-devurandom.c +93 -0
  1849. data/ext/libuv/src/unix/random-getentropy.c +57 -0
  1850. data/ext/libuv/src/unix/random-getrandom.c +88 -0
  1851. data/ext/libuv/src/unix/random-sysctl-linux.c +99 -0
  1852. data/ext/libuv/src/unix/signal.c +577 -0
  1853. data/ext/libuv/src/unix/spinlock.h +53 -0
  1854. data/ext/libuv/src/unix/stream.c +1697 -0
  1855. data/ext/libuv/src/unix/sunos.c +836 -0
  1856. data/ext/libuv/src/unix/sysinfo-loadavg.c +36 -0
  1857. data/ext/libuv/src/unix/sysinfo-memory.c +42 -0
  1858. data/ext/libuv/src/unix/tcp.c +450 -0
  1859. data/ext/libuv/src/unix/thread.c +852 -0
  1860. data/ext/libuv/src/unix/tty.c +381 -0
  1861. data/ext/libuv/src/unix/udp.c +1136 -0
  1862. data/ext/libuv/src/uv-common.c +812 -0
  1863. data/ext/libuv/src/uv-common.h +326 -0
  1864. data/ext/libuv/src/uv-data-getter-setters.c +98 -0
  1865. data/ext/libuv/src/version.c +45 -0
  1866. data/ext/libuv/src/win/async.c +98 -0
  1867. data/ext/libuv/src/win/atomicops-inl.h +57 -0
  1868. data/ext/libuv/src/win/core.c +657 -0
  1869. data/ext/libuv/src/win/detect-wakeup.c +35 -0
  1870. data/ext/libuv/src/win/dl.c +136 -0
  1871. data/ext/libuv/src/win/error.c +172 -0
  1872. data/ext/libuv/src/win/fs-event.c +589 -0
  1873. data/ext/libuv/src/win/fs-fd-hash-inl.h +178 -0
  1874. data/ext/libuv/src/win/fs.c +3238 -0
  1875. data/ext/libuv/src/win/getaddrinfo.c +463 -0
  1876. data/ext/libuv/src/win/getnameinfo.c +157 -0
  1877. data/ext/libuv/src/win/handle-inl.h +180 -0
  1878. data/ext/libuv/src/win/handle.c +162 -0
  1879. data/ext/libuv/src/win/internal.h +344 -0
  1880. data/ext/libuv/src/win/loop-watcher.c +122 -0
  1881. data/ext/libuv/src/win/pipe.c +2386 -0
  1882. data/ext/libuv/src/win/poll.c +643 -0
  1883. data/ext/libuv/src/win/process-stdio.c +512 -0
  1884. data/ext/libuv/src/win/process.c +1282 -0
  1885. data/ext/libuv/src/win/req-inl.h +221 -0
  1886. data/ext/libuv/src/win/signal.c +277 -0
  1887. data/ext/libuv/src/win/snprintf.c +42 -0
  1888. data/ext/libuv/src/win/stream-inl.h +54 -0
  1889. data/ext/libuv/src/win/stream.c +243 -0
  1890. data/ext/libuv/src/win/tcp.c +1520 -0
  1891. data/ext/libuv/src/win/thread.c +520 -0
  1892. data/ext/libuv/src/win/tty.c +2348 -0
  1893. data/ext/libuv/src/win/udp.c +1185 -0
  1894. data/ext/libuv/src/win/util.c +1879 -0
  1895. data/ext/libuv/src/win/winapi.c +149 -0
  1896. data/ext/libuv/src/win/winapi.h +4751 -0
  1897. data/ext/libuv/src/win/winsock.c +575 -0
  1898. data/ext/libuv/src/win/winsock.h +201 -0
  1899. data/ext/libuv/test/benchmark-async-pummel.c +119 -0
  1900. data/ext/libuv/test/benchmark-async.c +141 -0
  1901. data/ext/libuv/test/benchmark-fs-stat.c +136 -0
  1902. data/ext/libuv/test/benchmark-getaddrinfo.c +92 -0
  1903. data/ext/libuv/test/benchmark-list.h +163 -0
  1904. data/ext/libuv/test/benchmark-loop-count.c +92 -0
  1905. data/ext/libuv/test/benchmark-million-async.c +112 -0
  1906. data/ext/libuv/test/benchmark-million-timers.c +86 -0
  1907. data/ext/libuv/test/benchmark-multi-accept.c +447 -0
  1908. data/ext/libuv/test/benchmark-ping-pongs.c +221 -0
  1909. data/ext/libuv/test/benchmark-pound.c +351 -0
  1910. data/ext/libuv/test/benchmark-pump.c +476 -0
  1911. data/ext/libuv/test/benchmark-sizes.c +46 -0
  1912. data/ext/libuv/test/benchmark-spawn.c +164 -0
  1913. data/ext/libuv/test/benchmark-tcp-write-batch.c +144 -0
  1914. data/ext/libuv/test/benchmark-thread.c +64 -0
  1915. data/ext/libuv/test/benchmark-udp-pummel.c +243 -0
  1916. data/ext/libuv/test/blackhole-server.c +121 -0
  1917. data/ext/libuv/test/dns-server.c +340 -0
  1918. data/ext/libuv/test/echo-server.c +382 -0
  1919. data/ext/libuv/test/fixtures/empty_file +0 -0
  1920. data/ext/libuv/test/fixtures/load_error.node +1 -0
  1921. data/ext/libuv/test/fixtures/lorem_ipsum.txt +1 -0
  1922. data/ext/libuv/test/run-benchmarks.c +65 -0
  1923. data/ext/libuv/test/run-tests.c +239 -0
  1924. data/ext/libuv/test/runner-unix.c +450 -0
  1925. data/ext/libuv/test/runner-unix.h +36 -0
  1926. data/ext/libuv/test/runner-win.c +357 -0
  1927. data/ext/libuv/test/runner-win.h +41 -0
  1928. data/ext/libuv/test/runner.c +431 -0
  1929. data/ext/libuv/test/runner.h +176 -0
  1930. data/ext/libuv/test/task.h +238 -0
  1931. data/ext/libuv/test/test-active.c +84 -0
  1932. data/ext/libuv/test/test-async-null-cb.c +64 -0
  1933. data/ext/libuv/test/test-async.c +134 -0
  1934. data/ext/libuv/test/test-barrier.c +148 -0
  1935. data/ext/libuv/test/test-callback-order.c +77 -0
  1936. data/ext/libuv/test/test-callback-stack.c +204 -0
  1937. data/ext/libuv/test/test-close-fd.c +80 -0
  1938. data/ext/libuv/test/test-close-order.c +80 -0
  1939. data/ext/libuv/test/test-condvar.c +267 -0
  1940. data/ext/libuv/test/test-connect-unspecified.c +63 -0
  1941. data/ext/libuv/test/test-connection-fail.c +151 -0
  1942. data/ext/libuv/test/test-cwd-and-chdir.c +58 -0
  1943. data/ext/libuv/test/test-default-loop-close.c +59 -0
  1944. data/ext/libuv/test/test-delayed-accept.c +189 -0
  1945. data/ext/libuv/test/test-dlerror.c +61 -0
  1946. data/ext/libuv/test/test-eintr-handling.c +94 -0
  1947. data/ext/libuv/test/test-embed.c +139 -0
  1948. data/ext/libuv/test/test-emfile.c +121 -0
  1949. data/ext/libuv/test/test-env-vars.c +140 -0
  1950. data/ext/libuv/test/test-error.c +79 -0
  1951. data/ext/libuv/test/test-fail-always.c +29 -0
  1952. data/ext/libuv/test/test-fork.c +683 -0
  1953. data/ext/libuv/test/test-fs-copyfile.c +209 -0
  1954. data/ext/libuv/test/test-fs-event.c +1165 -0
  1955. data/ext/libuv/test/test-fs-fd-hash.c +133 -0
  1956. data/ext/libuv/test/test-fs-open-flags.c +435 -0
  1957. data/ext/libuv/test/test-fs-poll.c +300 -0
  1958. data/ext/libuv/test/test-fs-readdir.c +462 -0
  1959. data/ext/libuv/test/test-fs.c +4238 -0
  1960. data/ext/libuv/test/test-get-currentexe.c +86 -0
  1961. data/ext/libuv/test/test-get-loadavg.c +35 -0
  1962. data/ext/libuv/test/test-get-memory.c +40 -0
  1963. data/ext/libuv/test/test-get-passwd.c +86 -0
  1964. data/ext/libuv/test/test-getaddrinfo.c +191 -0
  1965. data/ext/libuv/test/test-gethostname.c +58 -0
  1966. data/ext/libuv/test/test-getnameinfo.c +101 -0
  1967. data/ext/libuv/test/test-getsockname.c +361 -0
  1968. data/ext/libuv/test/test-getters-setters.c +88 -0
  1969. data/ext/libuv/test/test-gettimeofday.c +39 -0
  1970. data/ext/libuv/test/test-handle-fileno.c +125 -0
  1971. data/ext/libuv/test/test-homedir.c +72 -0
  1972. data/ext/libuv/test/test-hrtime.c +52 -0
  1973. data/ext/libuv/test/test-idle.c +99 -0
  1974. data/ext/libuv/test/test-idna.c +195 -0
  1975. data/ext/libuv/test/test-ip4-addr.c +55 -0
  1976. data/ext/libuv/test/test-ip6-addr.c +171 -0
  1977. data/ext/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
  1978. data/ext/libuv/test/test-ipc-send-recv.c +429 -0
  1979. data/ext/libuv/test/test-ipc.c +974 -0
  1980. data/ext/libuv/test/test-list.h +1064 -0
  1981. data/ext/libuv/test/test-loop-alive.c +67 -0
  1982. data/ext/libuv/test/test-loop-close.c +75 -0
  1983. data/ext/libuv/test/test-loop-configure.c +38 -0
  1984. data/ext/libuv/test/test-loop-handles.c +337 -0
  1985. data/ext/libuv/test/test-loop-stop.c +71 -0
  1986. data/ext/libuv/test/test-loop-time.c +63 -0
  1987. data/ext/libuv/test/test-multiple-listen.c +109 -0
  1988. data/ext/libuv/test/test-mutexes.c +182 -0
  1989. data/ext/libuv/test/test-osx-select.c +140 -0
  1990. data/ext/libuv/test/test-pass-always.c +28 -0
  1991. data/ext/libuv/test/test-ping-pong.c +301 -0
  1992. data/ext/libuv/test/test-pipe-bind-error.c +139 -0
  1993. data/ext/libuv/test/test-pipe-close-stdout-read-stdin.c +112 -0
  1994. data/ext/libuv/test/test-pipe-connect-error.c +95 -0
  1995. data/ext/libuv/test/test-pipe-connect-multiple.c +107 -0
  1996. data/ext/libuv/test/test-pipe-connect-prepare.c +83 -0
  1997. data/ext/libuv/test/test-pipe-getsockname.c +266 -0
  1998. data/ext/libuv/test/test-pipe-pending-instances.c +59 -0
  1999. data/ext/libuv/test/test-pipe-sendmsg.c +172 -0
  2000. data/ext/libuv/test/test-pipe-server-close.c +94 -0
  2001. data/ext/libuv/test/test-pipe-set-fchmod.c +90 -0
  2002. data/ext/libuv/test/test-pipe-set-non-blocking.c +99 -0
  2003. data/ext/libuv/test/test-platform-output.c +170 -0
  2004. data/ext/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
  2005. data/ext/libuv/test/test-poll-close.c +73 -0
  2006. data/ext/libuv/test/test-poll-closesocket.c +92 -0
  2007. data/ext/libuv/test/test-poll-oob.c +210 -0
  2008. data/ext/libuv/test/test-poll.c +668 -0
  2009. data/ext/libuv/test/test-process-priority.c +83 -0
  2010. data/ext/libuv/test/test-process-title-threadsafe.c +89 -0
  2011. data/ext/libuv/test/test-process-title.c +76 -0
  2012. data/ext/libuv/test/test-queue-foreach-delete.c +204 -0
  2013. data/ext/libuv/test/test-random.c +94 -0
  2014. data/ext/libuv/test/test-ref.c +445 -0
  2015. data/ext/libuv/test/test-run-nowait.c +45 -0
  2016. data/ext/libuv/test/test-run-once.c +48 -0
  2017. data/ext/libuv/test/test-semaphore.c +111 -0
  2018. data/ext/libuv/test/test-shutdown-close.c +108 -0
  2019. data/ext/libuv/test/test-shutdown-eof.c +182 -0
  2020. data/ext/libuv/test/test-shutdown-twice.c +85 -0
  2021. data/ext/libuv/test/test-signal-multiple-loops.c +302 -0
  2022. data/ext/libuv/test/test-signal-pending-on-close.c +94 -0
  2023. data/ext/libuv/test/test-signal.c +325 -0
  2024. data/ext/libuv/test/test-socket-buffer-size.c +77 -0
  2025. data/ext/libuv/test/test-spawn.c +1924 -0
  2026. data/ext/libuv/test/test-stdio-over-pipes.c +256 -0
  2027. data/ext/libuv/test/test-strscpy.c +53 -0
  2028. data/ext/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
  2029. data/ext/libuv/test/test-tcp-bind-error.c +254 -0
  2030. data/ext/libuv/test/test-tcp-bind6-error.c +176 -0
  2031. data/ext/libuv/test/test-tcp-close-accept.c +198 -0
  2032. data/ext/libuv/test/test-tcp-close-reset.c +290 -0
  2033. data/ext/libuv/test/test-tcp-close-while-connecting.c +97 -0
  2034. data/ext/libuv/test/test-tcp-close.c +136 -0
  2035. data/ext/libuv/test/test-tcp-connect-error-after-write.c +98 -0
  2036. data/ext/libuv/test/test-tcp-connect-error.c +73 -0
  2037. data/ext/libuv/test/test-tcp-connect-timeout.c +91 -0
  2038. data/ext/libuv/test/test-tcp-connect6-error.c +71 -0
  2039. data/ext/libuv/test/test-tcp-create-socket-early.c +209 -0
  2040. data/ext/libuv/test/test-tcp-flags.c +52 -0
  2041. data/ext/libuv/test/test-tcp-oob.c +146 -0
  2042. data/ext/libuv/test/test-tcp-open.c +400 -0
  2043. data/ext/libuv/test/test-tcp-read-stop.c +76 -0
  2044. data/ext/libuv/test/test-tcp-shutdown-after-write.c +138 -0
  2045. data/ext/libuv/test/test-tcp-try-write-error.c +109 -0
  2046. data/ext/libuv/test/test-tcp-try-write.c +135 -0
  2047. data/ext/libuv/test/test-tcp-unexpected-read.c +117 -0
  2048. data/ext/libuv/test/test-tcp-write-after-connect.c +72 -0
  2049. data/ext/libuv/test/test-tcp-write-fail.c +115 -0
  2050. data/ext/libuv/test/test-tcp-write-queue-order.c +139 -0
  2051. data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
  2052. data/ext/libuv/test/test-tcp-writealot.c +180 -0
  2053. data/ext/libuv/test/test-thread-equal.c +45 -0
  2054. data/ext/libuv/test/test-thread.c +286 -0
  2055. data/ext/libuv/test/test-threadpool-cancel.c +349 -0
  2056. data/ext/libuv/test/test-threadpool.c +76 -0
  2057. data/ext/libuv/test/test-timer-again.c +141 -0
  2058. data/ext/libuv/test/test-timer-from-check.c +80 -0
  2059. data/ext/libuv/test/test-timer.c +343 -0
  2060. data/ext/libuv/test/test-tmpdir.c +82 -0
  2061. data/ext/libuv/test/test-tty-duplicate-key.c +321 -0
  2062. data/ext/libuv/test/test-tty.c +464 -0
  2063. data/ext/libuv/test/test-udp-alloc-cb-fail.c +196 -0
  2064. data/ext/libuv/test/test-udp-bind.c +93 -0
  2065. data/ext/libuv/test/test-udp-connect.c +182 -0
  2066. data/ext/libuv/test/test-udp-create-socket-early.c +135 -0
  2067. data/ext/libuv/test/test-udp-dgram-too-big.c +91 -0
  2068. data/ext/libuv/test/test-udp-ipv6.c +200 -0
  2069. data/ext/libuv/test/test-udp-multicast-interface.c +99 -0
  2070. data/ext/libuv/test/test-udp-multicast-interface6.c +103 -0
  2071. data/ext/libuv/test/test-udp-multicast-join.c +181 -0
  2072. data/ext/libuv/test/test-udp-multicast-join6.c +215 -0
  2073. data/ext/libuv/test/test-udp-multicast-ttl.c +94 -0
  2074. data/ext/libuv/test/test-udp-open.c +350 -0
  2075. data/ext/libuv/test/test-udp-options.c +156 -0
  2076. data/ext/libuv/test/test-udp-send-and-recv.c +212 -0
  2077. data/ext/libuv/test/test-udp-send-hang-loop.c +99 -0
  2078. data/ext/libuv/test/test-udp-send-immediate.c +148 -0
  2079. data/ext/libuv/test/test-udp-send-unreachable.c +150 -0
  2080. data/ext/libuv/test/test-udp-try-send.c +121 -0
  2081. data/ext/libuv/test/test-uname.c +69 -0
  2082. data/ext/libuv/test/test-walk-handles.c +77 -0
  2083. data/ext/libuv/test/test-watcher-cross-stop.c +111 -0
  2084. data/ext/libuv/test/test.gyp +293 -0
  2085. data/ext/libuv/tools/make_dist_html.py +124 -0
  2086. data/ext/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
  2087. data/ext/libuv/uv.gyp +368 -0
  2088. data/ext/libuv/vcbuild.bat +184 -0
  2089. data/lib/mt-libuv/version.rb +1 -1
  2090. data/mt-libuv.gemspec +26 -26
  2091. metadata +2088 -1
@@ -0,0 +1,3537 @@
1
+ # Copyright (c) 2012 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 ntpath
10
+ import os
11
+ import posixpath
12
+ import re
13
+ import subprocess
14
+ import sys
15
+
16
+ import gyp.common
17
+ import gyp.easy_xml as easy_xml
18
+ import gyp.generator.ninja as ninja_generator
19
+ import gyp.MSVSNew as MSVSNew
20
+ import gyp.MSVSProject as MSVSProject
21
+ import gyp.MSVSSettings as MSVSSettings
22
+ import gyp.MSVSToolFile as MSVSToolFile
23
+ import gyp.MSVSUserFile as MSVSUserFile
24
+ import gyp.MSVSUtil as MSVSUtil
25
+ import gyp.MSVSVersion as MSVSVersion
26
+ from gyp.common import GypError
27
+ from gyp.common import OrderedSet
28
+
29
+
30
+ # Regular expression for validating Visual Studio GUIDs. If the GUID
31
+ # contains lowercase hex letters, MSVS will be fine. However,
32
+ # IncrediBuild BuildConsole will parse the solution file, but then
33
+ # silently skip building the target causing hard to track down errors.
34
+ # Note that this only happens with the BuildConsole, and does not occur
35
+ # if IncrediBuild is executed from inside Visual Studio. This regex
36
+ # validates that the string looks like a GUID with all uppercase hex
37
+ # letters.
38
+ VALID_MSVS_GUID_CHARS = re.compile(r'^[A-F0-9\-]+$')
39
+
40
+
41
+ generator_default_variables = {
42
+ 'DRIVER_PREFIX': '',
43
+ 'DRIVER_SUFFIX': '.sys',
44
+ 'EXECUTABLE_PREFIX': '',
45
+ 'EXECUTABLE_SUFFIX': '.exe',
46
+ 'STATIC_LIB_PREFIX': '',
47
+ 'SHARED_LIB_PREFIX': '',
48
+ 'STATIC_LIB_SUFFIX': '.lib',
49
+ 'SHARED_LIB_SUFFIX': '.dll',
50
+ 'INTERMEDIATE_DIR': '$(IntDir)',
51
+ 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate',
52
+ 'OS': 'win',
53
+ 'PRODUCT_DIR': '$(OutDir)',
54
+ 'LIB_DIR': '$(OutDir)lib',
55
+ 'RULE_INPUT_ROOT': '$(InputName)',
56
+ 'RULE_INPUT_DIRNAME': '$(InputDir)',
57
+ 'RULE_INPUT_EXT': '$(InputExt)',
58
+ 'RULE_INPUT_NAME': '$(InputFileName)',
59
+ 'RULE_INPUT_PATH': '$(InputPath)',
60
+ 'CONFIGURATION_NAME': '$(ConfigurationName)',
61
+ }
62
+
63
+
64
+ # The msvs specific sections that hold paths
65
+ generator_additional_path_sections = [
66
+ 'msvs_cygwin_dirs',
67
+ 'msvs_props',
68
+ ]
69
+
70
+
71
+ generator_additional_non_configuration_keys = [
72
+ 'msvs_cygwin_dirs',
73
+ 'msvs_cygwin_shell',
74
+ 'msvs_large_pdb',
75
+ 'msvs_shard',
76
+ 'msvs_external_builder',
77
+ 'msvs_external_builder_out_dir',
78
+ 'msvs_external_builder_build_cmd',
79
+ 'msvs_external_builder_clean_cmd',
80
+ 'msvs_external_builder_clcompile_cmd',
81
+ 'msvs_enable_winrt',
82
+ 'msvs_requires_importlibrary',
83
+ 'msvs_enable_winphone',
84
+ 'msvs_application_type_revision',
85
+ 'msvs_target_platform_version',
86
+ 'msvs_target_platform_minversion',
87
+ ]
88
+
89
+ generator_filelist_paths = None
90
+
91
+ # List of precompiled header related keys.
92
+ precomp_keys = [
93
+ 'msvs_precompiled_header',
94
+ 'msvs_precompiled_source',
95
+ ]
96
+
97
+
98
+ cached_username = None
99
+
100
+
101
+ cached_domain = None
102
+
103
+
104
+ # TODO(gspencer): Switch the os.environ calls to be
105
+ # win32api.GetDomainName() and win32api.GetUserName() once the
106
+ # python version in depot_tools has been updated to work on Vista
107
+ # 64-bit.
108
+ def _GetDomainAndUserName():
109
+ if sys.platform not in ('win32', 'cygwin'):
110
+ return ('DOMAIN', 'USERNAME')
111
+ global cached_username
112
+ global cached_domain
113
+ if not cached_domain or not cached_username:
114
+ domain = os.environ.get('USERDOMAIN')
115
+ username = os.environ.get('USERNAME')
116
+ if not domain or not username:
117
+ call = subprocess.Popen(['net', 'config', 'Workstation'],
118
+ stdout=subprocess.PIPE)
119
+ config = call.communicate()[0]
120
+ username_re = re.compile(r'^User name\s+(\S+)', re.MULTILINE)
121
+ username_match = username_re.search(config)
122
+ if username_match:
123
+ username = username_match.group(1)
124
+ domain_re = re.compile(r'^Logon domain\s+(\S+)', re.MULTILINE)
125
+ domain_match = domain_re.search(config)
126
+ if domain_match:
127
+ domain = domain_match.group(1)
128
+ cached_domain = domain
129
+ cached_username = username
130
+ return (cached_domain, cached_username)
131
+
132
+ fixpath_prefix = None
133
+
134
+
135
+ def _NormalizedSource(source):
136
+ """Normalize the path.
137
+
138
+ But not if that gets rid of a variable, as this may expand to something
139
+ larger than one directory.
140
+
141
+ Arguments:
142
+ source: The path to be normalize.d
143
+
144
+ Returns:
145
+ The normalized path.
146
+ """
147
+ normalized = os.path.normpath(source)
148
+ if source.count('$') == normalized.count('$'):
149
+ source = normalized
150
+ return source
151
+
152
+
153
+ def _FixPath(path):
154
+ """Convert paths to a form that will make sense in a vcproj file.
155
+
156
+ Arguments:
157
+ path: The path to convert, may contain / etc.
158
+ Returns:
159
+ The path with all slashes made into backslashes.
160
+ """
161
+ if fixpath_prefix and path and not os.path.isabs(path) and not path[0] == '$':
162
+ path = os.path.join(fixpath_prefix, path)
163
+ path = path.replace('/', '\\')
164
+ path = _NormalizedSource(path)
165
+ if path and path[-1] == '\\':
166
+ path = path[:-1]
167
+ return path
168
+
169
+
170
+ def _FixPaths(paths):
171
+ """Fix each of the paths of the list."""
172
+ return [_FixPath(i) for i in paths]
173
+
174
+
175
+ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
176
+ list_excluded=True, msvs_version=None):
177
+ """Converts a list split source file paths into a vcproj folder hierarchy.
178
+
179
+ Arguments:
180
+ sources: A list of source file paths split.
181
+ prefix: A list of source file path layers meant to apply to each of sources.
182
+ excluded: A set of excluded files.
183
+ msvs_version: A MSVSVersion object.
184
+
185
+ Returns:
186
+ A hierarchy of filenames and MSVSProject.Filter objects that matches the
187
+ layout of the source tree.
188
+ For example:
189
+ _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']],
190
+ prefix=['joe'])
191
+ -->
192
+ [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']),
193
+ MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])]
194
+ """
195
+ if not prefix: prefix = []
196
+ result = []
197
+ excluded_result = []
198
+ folders = collections.OrderedDict()
199
+ # Gather files into the final result, excluded, or folders.
200
+ for s in sources:
201
+ if len(s) == 1:
202
+ filename = _NormalizedSource('\\'.join(prefix + s))
203
+ if filename in excluded:
204
+ excluded_result.append(filename)
205
+ else:
206
+ result.append(filename)
207
+ elif msvs_version and not msvs_version.UsesVcxproj():
208
+ # For MSVS 2008 and earlier, we need to process all files before walking
209
+ # the sub folders.
210
+ if not folders.get(s[0]):
211
+ folders[s[0]] = []
212
+ folders[s[0]].append(s[1:])
213
+ else:
214
+ contents = _ConvertSourcesToFilterHierarchy([s[1:]], prefix + [s[0]],
215
+ excluded=excluded,
216
+ list_excluded=list_excluded,
217
+ msvs_version=msvs_version)
218
+ contents = MSVSProject.Filter(s[0], contents=contents)
219
+ result.append(contents)
220
+ # Add a folder for excluded files.
221
+ if excluded_result and list_excluded:
222
+ excluded_folder = MSVSProject.Filter('_excluded_files',
223
+ contents=excluded_result)
224
+ result.append(excluded_folder)
225
+
226
+ if msvs_version and msvs_version.UsesVcxproj():
227
+ return result
228
+
229
+ # Populate all the folders.
230
+ for f in folders:
231
+ contents = _ConvertSourcesToFilterHierarchy(folders[f], prefix=prefix + [f],
232
+ excluded=excluded,
233
+ list_excluded=list_excluded,
234
+ msvs_version=msvs_version)
235
+ contents = MSVSProject.Filter(f, contents=contents)
236
+ result.append(contents)
237
+ return result
238
+
239
+
240
+ def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False):
241
+ if not value: return
242
+ _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset)
243
+
244
+
245
+ def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False):
246
+ # TODO(bradnelson): ugly hack, fix this more generally!!!
247
+ if 'Directories' in setting or 'Dependencies' in setting:
248
+ if type(value) == str:
249
+ value = value.replace('/', '\\')
250
+ else:
251
+ value = [i.replace('/', '\\') for i in value]
252
+ if not tools.get(tool_name):
253
+ tools[tool_name] = dict()
254
+ tool = tools[tool_name]
255
+ if 'CompileAsWinRT' == setting:
256
+ return
257
+ if tool.get(setting):
258
+ if only_if_unset: return
259
+ if type(tool[setting]) == list and type(value) == list:
260
+ tool[setting] += value
261
+ else:
262
+ raise TypeError(
263
+ 'Appending "%s" to a non-list setting "%s" for tool "%s" is '
264
+ 'not allowed, previous value: %s' % (
265
+ value, setting, tool_name, str(tool[setting])))
266
+ else:
267
+ tool[setting] = value
268
+
269
+
270
+ def _ConfigTargetVersion(config_data):
271
+ return config_data.get('msvs_target_version', 'Windows7')
272
+
273
+
274
+ def _ConfigPlatform(config_data):
275
+ return config_data.get('msvs_configuration_platform', 'Win32')
276
+
277
+
278
+ def _ConfigBaseName(config_name, platform_name):
279
+ if config_name.endswith('_' + platform_name):
280
+ return config_name[0:-len(platform_name) - 1]
281
+ else:
282
+ return config_name
283
+
284
+
285
+ def _ConfigFullName(config_name, config_data):
286
+ platform_name = _ConfigPlatform(config_data)
287
+ return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name)
288
+
289
+
290
+ def _ConfigWindowsTargetPlatformVersion(config_data, version):
291
+ config_ver = config_data.get('msvs_windows_sdk_version')
292
+ vers = [config_ver] if config_ver else version.compatible_sdks
293
+ for ver in vers:
294
+ for key in [
295
+ r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s',
296
+ r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']:
297
+ sdk_dir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder')
298
+ if not sdk_dir:
299
+ continue
300
+ version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
301
+ # Find a matching entry in sdk_dir\include.
302
+ expected_sdk_dir=r'%s\include' % sdk_dir
303
+ names = sorted([x for x in (os.listdir(expected_sdk_dir)
304
+ if os.path.isdir(expected_sdk_dir)
305
+ else []
306
+ )
307
+ if x.startswith(version)], reverse=True)
308
+ if names:
309
+ return names[0]
310
+ else:
311
+ print('Warning: No include files found for '
312
+ 'detected Windows SDK version %s' % (version))
313
+
314
+
315
+ def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
316
+ quote_cmd, do_setup_env):
317
+
318
+ if [x for x in cmd if '$(InputDir)' in x]:
319
+ input_dir_preamble = (
320
+ 'set INPUTDIR=$(InputDir)\n'
321
+ 'if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n'
322
+ 'set INPUTDIR=%INPUTDIR:~0,-1%\n'
323
+ )
324
+ else:
325
+ input_dir_preamble = ''
326
+
327
+ if cygwin_shell:
328
+ # Find path to cygwin.
329
+ cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0])
330
+ # Prepare command.
331
+ direct_cmd = cmd
332
+ direct_cmd = [i.replace('$(IntDir)',
333
+ '`cygpath -m "${INTDIR}"`') for i in direct_cmd]
334
+ direct_cmd = [i.replace('$(OutDir)',
335
+ '`cygpath -m "${OUTDIR}"`') for i in direct_cmd]
336
+ direct_cmd = [i.replace('$(InputDir)',
337
+ '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd]
338
+ if has_input_path:
339
+ direct_cmd = [i.replace('$(InputPath)',
340
+ '`cygpath -m "${INPUTPATH}"`')
341
+ for i in direct_cmd]
342
+ direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd]
343
+ # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd)
344
+ direct_cmd = ' '.join(direct_cmd)
345
+ # TODO(quote): regularize quoting path names throughout the module
346
+ cmd = ''
347
+ if do_setup_env:
348
+ cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && '
349
+ cmd += 'set CYGWIN=nontsec&& '
350
+ if direct_cmd.find('NUMBER_OF_PROCESSORS') >= 0:
351
+ cmd += 'set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& '
352
+ if direct_cmd.find('INTDIR') >= 0:
353
+ cmd += 'set INTDIR=$(IntDir)&& '
354
+ if direct_cmd.find('OUTDIR') >= 0:
355
+ cmd += 'set OUTDIR=$(OutDir)&& '
356
+ if has_input_path and direct_cmd.find('INPUTPATH') >= 0:
357
+ cmd += 'set INPUTPATH=$(InputPath) && '
358
+ cmd += 'bash -c "%(cmd)s"'
359
+ cmd = cmd % {'cygwin_dir': cygwin_dir,
360
+ 'cmd': direct_cmd}
361
+ return input_dir_preamble + cmd
362
+ else:
363
+ # Convert cat --> type to mimic unix.
364
+ if cmd[0] == 'cat':
365
+ command = ['type']
366
+ else:
367
+ command = [cmd[0].replace('/', '\\')]
368
+ # Add call before command to ensure that commands can be tied together one
369
+ # after the other without aborting in Incredibuild, since IB makes a bat
370
+ # file out of the raw command string, and some commands (like python) are
371
+ # actually batch files themselves.
372
+ command.insert(0, 'call')
373
+ # Fix the paths
374
+ # TODO(quote): This is a really ugly heuristic, and will miss path fixing
375
+ # for arguments like "--arg=path" or "/opt:path".
376
+ # If the argument starts with a slash or dash, it's probably a command line
377
+ # switch
378
+ arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
379
+ arguments = [i.replace('$(InputDir)', '%INPUTDIR%') for i in arguments]
380
+ arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
381
+ if quote_cmd:
382
+ # Support a mode for using cmd directly.
383
+ # Convert any paths to native form (first element is used directly).
384
+ # TODO(quote): regularize quoting path names throughout the module
385
+ arguments = ['"%s"' % i for i in arguments]
386
+ # Collapse into a single command.
387
+ return input_dir_preamble + ' '.join(command + arguments)
388
+
389
+
390
+ def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env):
391
+ # Currently this weird argument munging is used to duplicate the way a
392
+ # python script would need to be run as part of the chrome tree.
393
+ # Eventually we should add some sort of rule_default option to set this
394
+ # per project. For now the behavior chrome needs is the default.
395
+ mcs = rule.get('msvs_cygwin_shell')
396
+ if mcs is None:
397
+ mcs = int(spec.get('msvs_cygwin_shell', 1))
398
+ elif isinstance(mcs, str):
399
+ mcs = int(mcs)
400
+ quote_cmd = int(rule.get('msvs_quote_cmd', 1))
401
+ return _BuildCommandLineForRuleRaw(spec, rule['action'], mcs, has_input_path,
402
+ quote_cmd, do_setup_env=do_setup_env)
403
+
404
+
405
+ def _AddActionStep(actions_dict, inputs, outputs, description, command):
406
+ """Merge action into an existing list of actions.
407
+
408
+ Care must be taken so that actions which have overlapping inputs either don't
409
+ get assigned to the same input, or get collapsed into one.
410
+
411
+ Arguments:
412
+ actions_dict: dictionary keyed on input name, which maps to a list of
413
+ dicts describing the actions attached to that input file.
414
+ inputs: list of inputs
415
+ outputs: list of outputs
416
+ description: description of the action
417
+ command: command line to execute
418
+ """
419
+ # Require there to be at least one input (call sites will ensure this).
420
+ assert inputs
421
+
422
+ action = {
423
+ 'inputs': inputs,
424
+ 'outputs': outputs,
425
+ 'description': description,
426
+ 'command': command,
427
+ }
428
+
429
+ # Pick where to stick this action.
430
+ # While less than optimal in terms of build time, attach them to the first
431
+ # input for now.
432
+ chosen_input = inputs[0]
433
+
434
+ # Add it there.
435
+ if chosen_input not in actions_dict:
436
+ actions_dict[chosen_input] = []
437
+ actions_dict[chosen_input].append(action)
438
+
439
+
440
+ def _AddCustomBuildToolForMSVS(p, spec, primary_input,
441
+ inputs, outputs, description, cmd):
442
+ """Add a custom build tool to execute something.
443
+
444
+ Arguments:
445
+ p: the target project
446
+ spec: the target project dict
447
+ primary_input: input file to attach the build tool to
448
+ inputs: list of inputs
449
+ outputs: list of outputs
450
+ description: description of the action
451
+ cmd: command line to execute
452
+ """
453
+ inputs = _FixPaths(inputs)
454
+ outputs = _FixPaths(outputs)
455
+ tool = MSVSProject.Tool(
456
+ 'VCCustomBuildTool',
457
+ {'Description': description,
458
+ 'AdditionalDependencies': ';'.join(inputs),
459
+ 'Outputs': ';'.join(outputs),
460
+ 'CommandLine': cmd,
461
+ })
462
+ # Add to the properties of primary input for each config.
463
+ for config_name, c_data in spec['configurations'].items():
464
+ p.AddFileConfig(_FixPath(primary_input),
465
+ _ConfigFullName(config_name, c_data), tools=[tool])
466
+
467
+
468
+ def _AddAccumulatedActionsToMSVS(p, spec, actions_dict):
469
+ """Add actions accumulated into an actions_dict, merging as needed.
470
+
471
+ Arguments:
472
+ p: the target project
473
+ spec: the target project dict
474
+ actions_dict: dictionary keyed on input name, which maps to a list of
475
+ dicts describing the actions attached to that input file.
476
+ """
477
+ for primary_input in actions_dict:
478
+ inputs = OrderedSet()
479
+ outputs = OrderedSet()
480
+ descriptions = []
481
+ commands = []
482
+ for action in actions_dict[primary_input]:
483
+ inputs.update(OrderedSet(action['inputs']))
484
+ outputs.update(OrderedSet(action['outputs']))
485
+ descriptions.append(action['description'])
486
+ commands.append(action['command'])
487
+ # Add the custom build step for one input file.
488
+ description = ', and also '.join(descriptions)
489
+ command = '\r\n'.join(commands)
490
+ _AddCustomBuildToolForMSVS(p, spec,
491
+ primary_input=primary_input,
492
+ inputs=inputs,
493
+ outputs=outputs,
494
+ description=description,
495
+ cmd=command)
496
+
497
+
498
+ def _RuleExpandPath(path, input_file):
499
+ """Given the input file to which a rule applied, string substitute a path.
500
+
501
+ Arguments:
502
+ path: a path to string expand
503
+ input_file: the file to which the rule applied.
504
+ Returns:
505
+ The string substituted path.
506
+ """
507
+ path = path.replace('$(InputName)',
508
+ os.path.splitext(os.path.split(input_file)[1])[0])
509
+ path = path.replace('$(InputDir)', os.path.dirname(input_file))
510
+ path = path.replace('$(InputExt)',
511
+ os.path.splitext(os.path.split(input_file)[1])[1])
512
+ path = path.replace('$(InputFileName)', os.path.split(input_file)[1])
513
+ path = path.replace('$(InputPath)', input_file)
514
+ return path
515
+
516
+
517
+ def _FindRuleTriggerFiles(rule, sources):
518
+ """Find the list of files which a particular rule applies to.
519
+
520
+ Arguments:
521
+ rule: the rule in question
522
+ sources: the set of all known source files for this project
523
+ Returns:
524
+ The list of sources that trigger a particular rule.
525
+ """
526
+ return rule.get('rule_sources', [])
527
+
528
+
529
+ def _RuleInputsAndOutputs(rule, trigger_file):
530
+ """Find the inputs and outputs generated by a rule.
531
+
532
+ Arguments:
533
+ rule: the rule in question.
534
+ trigger_file: the main trigger for this rule.
535
+ Returns:
536
+ The pair of (inputs, outputs) involved in this rule.
537
+ """
538
+ raw_inputs = _FixPaths(rule.get('inputs', []))
539
+ raw_outputs = _FixPaths(rule.get('outputs', []))
540
+ inputs = OrderedSet()
541
+ outputs = OrderedSet()
542
+ inputs.add(trigger_file)
543
+ for i in raw_inputs:
544
+ inputs.add(_RuleExpandPath(i, trigger_file))
545
+ for o in raw_outputs:
546
+ outputs.add(_RuleExpandPath(o, trigger_file))
547
+ return (inputs, outputs)
548
+
549
+
550
+ def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options):
551
+ """Generate a native rules file.
552
+
553
+ Arguments:
554
+ p: the target project
555
+ rules: the set of rules to include
556
+ output_dir: the directory in which the project/gyp resides
557
+ spec: the project dict
558
+ options: global generator options
559
+ """
560
+ rules_filename = '%s%s.rules' % (spec['target_name'],
561
+ options.suffix)
562
+ rules_file = MSVSToolFile.Writer(os.path.join(output_dir, rules_filename),
563
+ spec['target_name'])
564
+ # Add each rule.
565
+ for r in rules:
566
+ rule_name = r['rule_name']
567
+ rule_ext = r['extension']
568
+ inputs = _FixPaths(r.get('inputs', []))
569
+ outputs = _FixPaths(r.get('outputs', []))
570
+ # Skip a rule with no action and no inputs.
571
+ if 'action' not in r and not r.get('rule_sources', []):
572
+ continue
573
+ cmd = _BuildCommandLineForRule(spec, r, has_input_path=True,
574
+ do_setup_env=True)
575
+ rules_file.AddCustomBuildRule(name=rule_name,
576
+ description=r.get('message', rule_name),
577
+ extensions=[rule_ext],
578
+ additional_dependencies=inputs,
579
+ outputs=outputs,
580
+ cmd=cmd)
581
+ # Write out rules file.
582
+ rules_file.WriteIfChanged()
583
+
584
+ # Add rules file to project.
585
+ p.AddToolFile(rules_filename)
586
+
587
+
588
+ def _Cygwinify(path):
589
+ path = path.replace('$(OutDir)', '$(OutDirCygwin)')
590
+ path = path.replace('$(IntDir)', '$(IntDirCygwin)')
591
+ return path
592
+
593
+
594
+ def _GenerateExternalRules(rules, output_dir, spec,
595
+ sources, options, actions_to_add):
596
+ """Generate an external makefile to do a set of rules.
597
+
598
+ Arguments:
599
+ rules: the list of rules to include
600
+ output_dir: path containing project and gyp files
601
+ spec: project specification data
602
+ sources: set of sources known
603
+ options: global generator options
604
+ actions_to_add: The list of actions we will add to.
605
+ """
606
+ filename = '%s_rules%s.mk' % (spec['target_name'], options.suffix)
607
+ mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename))
608
+ # Find cygwin style versions of some paths.
609
+ mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n')
610
+ mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n')
611
+ # Gather stuff needed to emit all: target.
612
+ all_inputs = OrderedSet()
613
+ all_outputs = OrderedSet()
614
+ all_output_dirs = OrderedSet()
615
+ first_outputs = []
616
+ for rule in rules:
617
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
618
+ for tf in trigger_files:
619
+ inputs, outputs = _RuleInputsAndOutputs(rule, tf)
620
+ all_inputs.update(OrderedSet(inputs))
621
+ all_outputs.update(OrderedSet(outputs))
622
+ # Only use one target from each rule as the dependency for
623
+ # 'all' so we don't try to build each rule multiple times.
624
+ first_outputs.append(list(outputs)[0])
625
+ # Get the unique output directories for this rule.
626
+ output_dirs = [os.path.split(i)[0] for i in outputs]
627
+ for od in output_dirs:
628
+ all_output_dirs.add(od)
629
+ first_outputs_cyg = [_Cygwinify(i) for i in first_outputs]
630
+ # Write out all: target, including mkdir for each output directory.
631
+ mk_file.write('all: %s\n' % ' '.join(first_outputs_cyg))
632
+ for od in all_output_dirs:
633
+ if od:
634
+ mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od)
635
+ mk_file.write('\n')
636
+ # Define how each output is generated.
637
+ for rule in rules:
638
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
639
+ for tf in trigger_files:
640
+ # Get all the inputs and outputs for this rule for this trigger file.
641
+ inputs, outputs = _RuleInputsAndOutputs(rule, tf)
642
+ inputs = [_Cygwinify(i) for i in inputs]
643
+ outputs = [_Cygwinify(i) for i in outputs]
644
+ # Prepare the command line for this rule.
645
+ cmd = [_RuleExpandPath(c, tf) for c in rule['action']]
646
+ cmd = ['"%s"' % i for i in cmd]
647
+ cmd = ' '.join(cmd)
648
+ # Add it to the makefile.
649
+ mk_file.write('%s: %s\n' % (' '.join(outputs), ' '.join(inputs)))
650
+ mk_file.write('\t%s\n\n' % cmd)
651
+ # Close up the file.
652
+ mk_file.close()
653
+
654
+ # Add makefile to list of sources.
655
+ sources.add(filename)
656
+ # Add a build action to call makefile.
657
+ cmd = ['make',
658
+ 'OutDir=$(OutDir)',
659
+ 'IntDir=$(IntDir)',
660
+ '-j', '${NUMBER_OF_PROCESSORS_PLUS_1}',
661
+ '-f', filename]
662
+ cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True)
663
+ # Insert makefile as 0'th input, so it gets the action attached there,
664
+ # as this is easier to understand from in the IDE.
665
+ all_inputs = list(all_inputs)
666
+ all_inputs.insert(0, filename)
667
+ _AddActionStep(actions_to_add,
668
+ inputs=_FixPaths(all_inputs),
669
+ outputs=_FixPaths(all_outputs),
670
+ description='Running external rules for %s' %
671
+ spec['target_name'],
672
+ command=cmd)
673
+
674
+
675
+ def _EscapeEnvironmentVariableExpansion(s):
676
+ """Escapes % characters.
677
+
678
+ Escapes any % characters so that Windows-style environment variable
679
+ expansions will leave them alone.
680
+ See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
681
+ to understand why we have to do this.
682
+
683
+ Args:
684
+ s: The string to be escaped.
685
+
686
+ Returns:
687
+ The escaped string.
688
+ """
689
+ s = s.replace('%', '%%')
690
+ return s
691
+
692
+
693
+ quote_replacer_regex = re.compile(r'(\\*)"')
694
+
695
+
696
+ def _EscapeCommandLineArgumentForMSVS(s):
697
+ """Escapes a Windows command-line argument.
698
+
699
+ So that the Win32 CommandLineToArgv function will turn the escaped result back
700
+ into the original string.
701
+ See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
702
+ ("Parsing C++ Command-Line Arguments") to understand why we have to do
703
+ this.
704
+
705
+ Args:
706
+ s: the string to be escaped.
707
+ Returns:
708
+ the escaped string.
709
+ """
710
+
711
+ def _Replace(match):
712
+ # For a literal quote, CommandLineToArgv requires an odd number of
713
+ # backslashes preceding it, and it produces half as many literal backslashes
714
+ # (rounded down). So we need to produce 2n+1 backslashes.
715
+ return 2 * match.group(1) + '\\"'
716
+
717
+ # Escape all quotes so that they are interpreted literally.
718
+ s = quote_replacer_regex.sub(_Replace, s)
719
+ # Now add unescaped quotes so that any whitespace is interpreted literally.
720
+ s = '"' + s + '"'
721
+ return s
722
+
723
+
724
+ delimiters_replacer_regex = re.compile(r'(\\*)([,;]+)')
725
+
726
+
727
+ def _EscapeVCProjCommandLineArgListItem(s):
728
+ """Escapes command line arguments for MSVS.
729
+
730
+ The VCProj format stores string lists in a single string using commas and
731
+ semi-colons as separators, which must be quoted if they are to be
732
+ interpreted literally. However, command-line arguments may already have
733
+ quotes, and the VCProj parser is ignorant of the backslash escaping
734
+ convention used by CommandLineToArgv, so the command-line quotes and the
735
+ VCProj quotes may not be the same quotes. So to store a general
736
+ command-line argument in a VCProj list, we need to parse the existing
737
+ quoting according to VCProj's convention and quote any delimiters that are
738
+ not already quoted by that convention. The quotes that we add will also be
739
+ seen by CommandLineToArgv, so if backslashes precede them then we also have
740
+ to escape those backslashes according to the CommandLineToArgv
741
+ convention.
742
+
743
+ Args:
744
+ s: the string to be escaped.
745
+ Returns:
746
+ the escaped string.
747
+ """
748
+
749
+ def _Replace(match):
750
+ # For a non-literal quote, CommandLineToArgv requires an even number of
751
+ # backslashes preceding it, and it produces half as many literal
752
+ # backslashes. So we need to produce 2n backslashes.
753
+ return 2 * match.group(1) + '"' + match.group(2) + '"'
754
+
755
+ segments = s.split('"')
756
+ # The unquoted segments are at the even-numbered indices.
757
+ for i in range(0, len(segments), 2):
758
+ segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i])
759
+ # Concatenate back into a single string
760
+ s = '"'.join(segments)
761
+ if len(segments) % 2 == 0:
762
+ # String ends while still quoted according to VCProj's convention. This
763
+ # means the delimiter and the next list item that follow this one in the
764
+ # .vcproj file will be misinterpreted as part of this item. There is nothing
765
+ # we can do about this. Adding an extra quote would correct the problem in
766
+ # the VCProj but cause the same problem on the final command-line. Moving
767
+ # the item to the end of the list does works, but that's only possible if
768
+ # there's only one such item. Let's just warn the user.
769
+ print(('Warning: MSVS may misinterpret the odd number of ' +
770
+ 'quotes in ' + s), file=sys.stderr)
771
+ return s
772
+
773
+
774
+ def _EscapeCppDefineForMSVS(s):
775
+ """Escapes a CPP define so that it will reach the compiler unaltered."""
776
+ s = _EscapeEnvironmentVariableExpansion(s)
777
+ s = _EscapeCommandLineArgumentForMSVS(s)
778
+ s = _EscapeVCProjCommandLineArgListItem(s)
779
+ # cl.exe replaces literal # characters with = in preprocesor definitions for
780
+ # some reason. Octal-encode to work around that.
781
+ s = s.replace('#', '\\%03o' % ord('#'))
782
+ return s
783
+
784
+
785
+ quote_replacer_regex2 = re.compile(r'(\\+)"')
786
+
787
+
788
+ def _EscapeCommandLineArgumentForMSBuild(s):
789
+ """Escapes a Windows command-line argument for use by MSBuild."""
790
+
791
+ def _Replace(match):
792
+ return (len(match.group(1)) / 2 * 4) * '\\' + '\\"'
793
+
794
+ # Escape all quotes so that they are interpreted literally.
795
+ s = quote_replacer_regex2.sub(_Replace, s)
796
+ return s
797
+
798
+
799
+ def _EscapeMSBuildSpecialCharacters(s):
800
+ escape_dictionary = {
801
+ '%': '%25',
802
+ '$': '%24',
803
+ '@': '%40',
804
+ "'": '%27',
805
+ ';': '%3B',
806
+ '?': '%3F',
807
+ '*': '%2A'
808
+ }
809
+ result = ''.join([escape_dictionary.get(c, c) for c in s])
810
+ return result
811
+
812
+
813
+ def _EscapeCppDefineForMSBuild(s):
814
+ """Escapes a CPP define so that it will reach the compiler unaltered."""
815
+ s = _EscapeEnvironmentVariableExpansion(s)
816
+ s = _EscapeCommandLineArgumentForMSBuild(s)
817
+ s = _EscapeMSBuildSpecialCharacters(s)
818
+ # cl.exe replaces literal # characters with = in preprocesor definitions for
819
+ # some reason. Octal-encode to work around that.
820
+ s = s.replace('#', '\\%03o' % ord('#'))
821
+ return s
822
+
823
+
824
+ def _GenerateRulesForMSVS(p, output_dir, options, spec,
825
+ sources, excluded_sources,
826
+ actions_to_add):
827
+ """Generate all the rules for a particular project.
828
+
829
+ Arguments:
830
+ p: the project
831
+ output_dir: directory to emit rules to
832
+ options: global options passed to the generator
833
+ spec: the specification for this project
834
+ sources: the set of all known source files in this project
835
+ excluded_sources: the set of sources excluded from normal processing
836
+ actions_to_add: deferred list of actions to add in
837
+ """
838
+ rules = spec.get('rules', [])
839
+ rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))]
840
+ rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))]
841
+
842
+ # Handle rules that use a native rules file.
843
+ if rules_native:
844
+ _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options)
845
+
846
+ # Handle external rules (non-native rules).
847
+ if rules_external:
848
+ _GenerateExternalRules(rules_external, output_dir, spec,
849
+ sources, options, actions_to_add)
850
+ _AdjustSourcesForRules(rules, sources, excluded_sources, False)
851
+
852
+
853
+ def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild):
854
+ # Add outputs generated by each rule (if applicable).
855
+ for rule in rules:
856
+ # Add in the outputs from this rule.
857
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
858
+ for trigger_file in trigger_files:
859
+ # Remove trigger_file from excluded_sources to let the rule be triggered
860
+ # (e.g. rule trigger ax_enums.idl is added to excluded_sources
861
+ # because it's also in an action's inputs in the same project)
862
+ excluded_sources.discard(_FixPath(trigger_file))
863
+ # Done if not processing outputs as sources.
864
+ if int(rule.get('process_outputs_as_sources', False)):
865
+ inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file)
866
+ inputs = OrderedSet(_FixPaths(inputs))
867
+ outputs = OrderedSet(_FixPaths(outputs))
868
+ inputs.remove(_FixPath(trigger_file))
869
+ sources.update(inputs)
870
+ if not is_msbuild:
871
+ excluded_sources.update(inputs)
872
+ sources.update(outputs)
873
+
874
+
875
+ def _FilterActionsFromExcluded(excluded_sources, actions_to_add):
876
+ """Take inputs with actions attached out of the list of exclusions.
877
+
878
+ Arguments:
879
+ excluded_sources: list of source files not to be built.
880
+ actions_to_add: dict of actions keyed on source file they're attached to.
881
+ Returns:
882
+ excluded_sources with files that have actions attached removed.
883
+ """
884
+ must_keep = OrderedSet(_FixPaths(actions_to_add.keys()))
885
+ return [s for s in excluded_sources if s not in must_keep]
886
+
887
+
888
+ def _GetDefaultConfiguration(spec):
889
+ return spec['configurations'][spec['default_configuration']]
890
+
891
+
892
+ def _GetGuidOfProject(proj_path, spec):
893
+ """Get the guid for the project.
894
+
895
+ Arguments:
896
+ proj_path: Path of the vcproj or vcxproj file to generate.
897
+ spec: The target dictionary containing the properties of the target.
898
+ Returns:
899
+ the guid.
900
+ Raises:
901
+ ValueError: if the specified GUID is invalid.
902
+ """
903
+ # Pluck out the default configuration.
904
+ default_config = _GetDefaultConfiguration(spec)
905
+ # Decide the guid of the project.
906
+ guid = default_config.get('msvs_guid')
907
+ if guid:
908
+ if VALID_MSVS_GUID_CHARS.match(guid) is None:
909
+ raise ValueError('Invalid MSVS guid: "%s". Must match regex: "%s".' %
910
+ (guid, VALID_MSVS_GUID_CHARS.pattern))
911
+ guid = '{%s}' % guid
912
+ guid = guid or MSVSNew.MakeGuid(proj_path)
913
+ return guid
914
+
915
+
916
+ def _GetMsbuildToolsetOfProject(proj_path, spec, version):
917
+ """Get the platform toolset for the project.
918
+
919
+ Arguments:
920
+ proj_path: Path of the vcproj or vcxproj file to generate.
921
+ spec: The target dictionary containing the properties of the target.
922
+ version: The MSVSVersion object.
923
+ Returns:
924
+ the platform toolset string or None.
925
+ """
926
+ # Pluck out the default configuration.
927
+ default_config = _GetDefaultConfiguration(spec)
928
+ toolset = default_config.get('msbuild_toolset')
929
+ if not toolset and version.DefaultToolset():
930
+ toolset = version.DefaultToolset()
931
+ if spec['type'] == 'windows_driver':
932
+ toolset = 'WindowsKernelModeDriver10.0'
933
+ return toolset
934
+
935
+
936
+ def _GenerateProject(project, options, version, generator_flags):
937
+ """Generates a vcproj file.
938
+
939
+ Arguments:
940
+ project: the MSVSProject object.
941
+ options: global generator options.
942
+ version: the MSVSVersion object.
943
+ generator_flags: dict of generator-specific flags.
944
+ Returns:
945
+ A list of source files that cannot be found on disk.
946
+ """
947
+ default_config = _GetDefaultConfiguration(project.spec)
948
+
949
+ # Skip emitting anything if told to with msvs_existing_vcproj option.
950
+ if default_config.get('msvs_existing_vcproj'):
951
+ return []
952
+
953
+ if version.UsesVcxproj():
954
+ return _GenerateMSBuildProject(project, options, version, generator_flags)
955
+ else:
956
+ return _GenerateMSVSProject(project, options, version, generator_flags)
957
+
958
+
959
+ # TODO: Avoid code duplication with _ValidateSourcesForOSX in make.py.
960
+ def _ValidateSourcesForMSVSProject(spec, version):
961
+ """Makes sure if duplicate basenames are not specified in the source list.
962
+
963
+ Arguments:
964
+ spec: The target dictionary containing the properties of the target.
965
+ version: The VisualStudioVersion object.
966
+ """
967
+ # This validation should not be applied to MSVC2010 and later.
968
+ assert not version.UsesVcxproj()
969
+
970
+ # TODO: Check if MSVC allows this for loadable_module targets.
971
+ if spec.get('type', None) not in ('static_library', 'shared_library'):
972
+ return
973
+ sources = spec.get('sources', [])
974
+ basenames = {}
975
+ for source in sources:
976
+ name, ext = os.path.splitext(source)
977
+ is_compiled_file = ext in [
978
+ '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S']
979
+ if not is_compiled_file:
980
+ continue
981
+ basename = os.path.basename(name) # Don't include extension.
982
+ basenames.setdefault(basename, []).append(source)
983
+
984
+ error = ''
985
+ for basename, files in basenames.items():
986
+ if len(files) > 1:
987
+ error += ' %s: %s\n' % (basename, ' '.join(files))
988
+
989
+ if error:
990
+ print('static library %s has several files with the same basename:\n' %
991
+ spec['target_name'] + error + 'MSVC08 cannot handle that.')
992
+ raise GypError('Duplicate basenames in sources section, see list above')
993
+
994
+
995
+ def _GenerateMSVSProject(project, options, version, generator_flags):
996
+ """Generates a .vcproj file. It may create .rules and .user files too.
997
+
998
+ Arguments:
999
+ project: The project object we will generate the file for.
1000
+ options: Global options passed to the generator.
1001
+ version: The VisualStudioVersion object.
1002
+ generator_flags: dict of generator-specific flags.
1003
+ """
1004
+ spec = project.spec
1005
+ gyp.common.EnsureDirExists(project.path)
1006
+
1007
+ platforms = _GetUniquePlatforms(spec)
1008
+ p = MSVSProject.Writer(project.path, version, spec['target_name'],
1009
+ project.guid, platforms)
1010
+
1011
+ # Get directory project file is in.
1012
+ project_dir = os.path.split(project.path)[0]
1013
+ gyp_path = _NormalizedSource(project.build_file)
1014
+ relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
1015
+
1016
+ config_type = _GetMSVSConfigurationType(spec, project.build_file)
1017
+ for config_name, config in spec['configurations'].items():
1018
+ _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config)
1019
+
1020
+ # MSVC08 and prior version cannot handle duplicate basenames in the same
1021
+ # target.
1022
+ # TODO: Take excluded sources into consideration if possible.
1023
+ _ValidateSourcesForMSVSProject(spec, version)
1024
+
1025
+ # Prepare list of sources and excluded sources.
1026
+ gyp_file = os.path.split(project.build_file)[1]
1027
+ sources, excluded_sources = _PrepareListOfSources(spec, generator_flags,
1028
+ gyp_file)
1029
+
1030
+ # Add rules.
1031
+ actions_to_add = {}
1032
+ _GenerateRulesForMSVS(p, project_dir, options, spec,
1033
+ sources, excluded_sources,
1034
+ actions_to_add)
1035
+ list_excluded = generator_flags.get('msvs_list_excluded_files', True)
1036
+ sources, excluded_sources, excluded_idl = (
1037
+ _AdjustSourcesAndConvertToFilterHierarchy(spec, options, project_dir,
1038
+ sources, excluded_sources,
1039
+ list_excluded, version))
1040
+
1041
+ # Add in files.
1042
+ missing_sources = _VerifySourcesExist(sources, project_dir)
1043
+ p.AddFiles(sources)
1044
+
1045
+ _AddToolFilesToMSVS(p, spec)
1046
+ _HandlePreCompiledHeaders(p, sources, spec)
1047
+ _AddActions(actions_to_add, spec, relative_path_of_gyp_file)
1048
+ _AddCopies(actions_to_add, spec)
1049
+ _WriteMSVSUserFile(project.path, version, spec)
1050
+
1051
+ # NOTE: this stanza must appear after all actions have been decided.
1052
+ # Don't excluded sources with actions attached, or they won't run.
1053
+ excluded_sources = _FilterActionsFromExcluded(
1054
+ excluded_sources, actions_to_add)
1055
+ _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl,
1056
+ list_excluded)
1057
+ _AddAccumulatedActionsToMSVS(p, spec, actions_to_add)
1058
+
1059
+ # Write it out.
1060
+ p.WriteIfChanged()
1061
+
1062
+ return missing_sources
1063
+
1064
+
1065
+ def _GetUniquePlatforms(spec):
1066
+ """Returns the list of unique platforms for this spec, e.g ['win32', ...].
1067
+
1068
+ Arguments:
1069
+ spec: The target dictionary containing the properties of the target.
1070
+ Returns:
1071
+ The MSVSUserFile object created.
1072
+ """
1073
+ # Gather list of unique platforms.
1074
+ platforms = OrderedSet()
1075
+ for configuration in spec['configurations']:
1076
+ platforms.add(_ConfigPlatform(spec['configurations'][configuration]))
1077
+ platforms = list(platforms)
1078
+ return platforms
1079
+
1080
+
1081
+ def _CreateMSVSUserFile(proj_path, version, spec):
1082
+ """Generates a .user file for the user running this Gyp program.
1083
+
1084
+ Arguments:
1085
+ proj_path: The path of the project file being created. The .user file
1086
+ shares the same path (with an appropriate suffix).
1087
+ version: The VisualStudioVersion object.
1088
+ spec: The target dictionary containing the properties of the target.
1089
+ Returns:
1090
+ The MSVSUserFile object created.
1091
+ """
1092
+ (domain, username) = _GetDomainAndUserName()
1093
+ vcuser_filename = '.'.join([proj_path, domain, username, 'user'])
1094
+ user_file = MSVSUserFile.Writer(vcuser_filename, version,
1095
+ spec['target_name'])
1096
+ return user_file
1097
+
1098
+
1099
+ def _GetMSVSConfigurationType(spec, build_file):
1100
+ """Returns the configuration type for this project.
1101
+
1102
+ It's a number defined by Microsoft. May raise an exception.
1103
+
1104
+ Args:
1105
+ spec: The target dictionary containing the properties of the target.
1106
+ build_file: The path of the gyp file.
1107
+ Returns:
1108
+ An integer, the configuration type.
1109
+ """
1110
+ try:
1111
+ config_type = {
1112
+ 'executable': '1', # .exe
1113
+ 'shared_library': '2', # .dll
1114
+ 'loadable_module': '2', # .dll
1115
+ 'static_library': '4', # .lib
1116
+ 'windows_driver': '5', # .sys
1117
+ 'none': '10', # Utility type
1118
+ }[spec['type']]
1119
+ except KeyError:
1120
+ if spec.get('type'):
1121
+ raise GypError('Target type %s is not a valid target type for '
1122
+ 'target %s in %s.' %
1123
+ (spec['type'], spec['target_name'], build_file))
1124
+ else:
1125
+ raise GypError('Missing type field for target %s in %s.' %
1126
+ (spec['target_name'], build_file))
1127
+ return config_type
1128
+
1129
+
1130
+ def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
1131
+ """Adds a configuration to the MSVS project.
1132
+
1133
+ Many settings in a vcproj file are specific to a configuration. This
1134
+ function the main part of the vcproj file that's configuration specific.
1135
+
1136
+ Arguments:
1137
+ p: The target project being generated.
1138
+ spec: The target dictionary containing the properties of the target.
1139
+ config_type: The configuration type, a number as defined by Microsoft.
1140
+ config_name: The name of the configuration.
1141
+ config: The dictionary that defines the special processing to be done
1142
+ for this configuration.
1143
+ """
1144
+ # Get the information for this configuration
1145
+ include_dirs, midl_include_dirs, resource_include_dirs = \
1146
+ _GetIncludeDirs(config)
1147
+ libraries = _GetLibraries(spec)
1148
+ library_dirs = _GetLibraryDirs(config)
1149
+ out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False)
1150
+ defines = _GetDefines(config)
1151
+ defines = [_EscapeCppDefineForMSVS(d) for d in defines]
1152
+ disabled_warnings = _GetDisabledWarnings(config)
1153
+ prebuild = config.get('msvs_prebuild')
1154
+ postbuild = config.get('msvs_postbuild')
1155
+ def_file = _GetModuleDefinition(spec)
1156
+ precompiled_header = config.get('msvs_precompiled_header')
1157
+
1158
+ # Prepare the list of tools as a dictionary.
1159
+ tools = dict()
1160
+ # Add in user specified msvs_settings.
1161
+ msvs_settings = config.get('msvs_settings', {})
1162
+ MSVSSettings.ValidateMSVSSettings(msvs_settings)
1163
+
1164
+ # Prevent default library inheritance from the environment.
1165
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', ['$(NOINHERIT)'])
1166
+
1167
+ for tool in msvs_settings:
1168
+ settings = config['msvs_settings'][tool]
1169
+ for setting in settings:
1170
+ _ToolAppend(tools, tool, setting, settings[setting])
1171
+ # Add the information to the appropriate tool
1172
+ _ToolAppend(tools, 'VCCLCompilerTool',
1173
+ 'AdditionalIncludeDirectories', include_dirs)
1174
+ _ToolAppend(tools, 'VCMIDLTool',
1175
+ 'AdditionalIncludeDirectories', midl_include_dirs)
1176
+ _ToolAppend(tools, 'VCResourceCompilerTool',
1177
+ 'AdditionalIncludeDirectories', resource_include_dirs)
1178
+ # Add in libraries.
1179
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries)
1180
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalLibraryDirectories',
1181
+ library_dirs)
1182
+ if out_file:
1183
+ _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True)
1184
+ # Add defines.
1185
+ _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines)
1186
+ _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions',
1187
+ defines)
1188
+ # Change program database directory to prevent collisions.
1189
+ _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName',
1190
+ '$(IntDir)$(ProjectName)\\vc80.pdb', only_if_unset=True)
1191
+ # Add disabled warnings.
1192
+ _ToolAppend(tools, 'VCCLCompilerTool',
1193
+ 'DisableSpecificWarnings', disabled_warnings)
1194
+ # Add Pre-build.
1195
+ _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild)
1196
+ # Add Post-build.
1197
+ _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild)
1198
+ # Turn on precompiled headers if appropriate.
1199
+ if precompiled_header:
1200
+ precompiled_header = os.path.split(precompiled_header)[1]
1201
+ _ToolAppend(tools, 'VCCLCompilerTool', 'UsePrecompiledHeader', '2')
1202
+ _ToolAppend(tools, 'VCCLCompilerTool',
1203
+ 'PrecompiledHeaderThrough', precompiled_header)
1204
+ _ToolAppend(tools, 'VCCLCompilerTool',
1205
+ 'ForcedIncludeFiles', precompiled_header)
1206
+ # Loadable modules don't generate import libraries;
1207
+ # tell dependent projects to not expect one.
1208
+ if spec['type'] == 'loadable_module':
1209
+ _ToolAppend(tools, 'VCLinkerTool', 'IgnoreImportLibrary', 'true')
1210
+ # Set the module definition file if any.
1211
+ if def_file:
1212
+ _ToolAppend(tools, 'VCLinkerTool', 'ModuleDefinitionFile', def_file)
1213
+
1214
+ _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name)
1215
+
1216
+
1217
+ def _GetIncludeDirs(config):
1218
+ """Returns the list of directories to be used for #include directives.
1219
+
1220
+ Arguments:
1221
+ config: The dictionary that defines the special processing to be done
1222
+ for this configuration.
1223
+ Returns:
1224
+ The list of directory paths.
1225
+ """
1226
+ # TODO(bradnelson): include_dirs should really be flexible enough not to
1227
+ # require this sort of thing.
1228
+ include_dirs = (
1229
+ config.get('include_dirs', []) +
1230
+ config.get('msvs_system_include_dirs', []))
1231
+ midl_include_dirs = (
1232
+ config.get('midl_include_dirs', []) +
1233
+ config.get('msvs_system_include_dirs', []))
1234
+ resource_include_dirs = config.get('resource_include_dirs', include_dirs)
1235
+ include_dirs = _FixPaths(include_dirs)
1236
+ midl_include_dirs = _FixPaths(midl_include_dirs)
1237
+ resource_include_dirs = _FixPaths(resource_include_dirs)
1238
+ return include_dirs, midl_include_dirs, resource_include_dirs
1239
+
1240
+
1241
+ def _GetLibraryDirs(config):
1242
+ """Returns the list of directories to be used for library search paths.
1243
+
1244
+ Arguments:
1245
+ config: The dictionary that defines the special processing to be done
1246
+ for this configuration.
1247
+ Returns:
1248
+ The list of directory paths.
1249
+ """
1250
+
1251
+ library_dirs = config.get('library_dirs', [])
1252
+ library_dirs = _FixPaths(library_dirs)
1253
+ return library_dirs
1254
+
1255
+
1256
+ def _GetLibraries(spec):
1257
+ """Returns the list of libraries for this configuration.
1258
+
1259
+ Arguments:
1260
+ spec: The target dictionary containing the properties of the target.
1261
+ Returns:
1262
+ The list of directory paths.
1263
+ """
1264
+ libraries = spec.get('libraries', [])
1265
+ # Strip out -l, as it is not used on windows (but is needed so we can pass
1266
+ # in libraries that are assumed to be in the default library path).
1267
+ # Also remove duplicate entries, leaving only the last duplicate, while
1268
+ # preserving order.
1269
+ found = OrderedSet()
1270
+ unique_libraries_list = []
1271
+ for entry in reversed(libraries):
1272
+ library = re.sub(r'^\-l', '', entry)
1273
+ if not os.path.splitext(library)[1]:
1274
+ library += '.lib'
1275
+ if library not in found:
1276
+ found.add(library)
1277
+ unique_libraries_list.append(library)
1278
+ unique_libraries_list.reverse()
1279
+ return unique_libraries_list
1280
+
1281
+
1282
+ def _GetOutputFilePathAndTool(spec, msbuild):
1283
+ """Returns the path and tool to use for this target.
1284
+
1285
+ Figures out the path of the file this spec will create and the name of
1286
+ the VC tool that will create it.
1287
+
1288
+ Arguments:
1289
+ spec: The target dictionary containing the properties of the target.
1290
+ Returns:
1291
+ A triple of (file path, name of the vc tool, name of the msbuild tool)
1292
+ """
1293
+ # Select a name for the output file.
1294
+ out_file = ''
1295
+ vc_tool = ''
1296
+ msbuild_tool = ''
1297
+ output_file_map = {
1298
+ 'executable': ('VCLinkerTool', 'Link', '$(OutDir)', '.exe'),
1299
+ 'shared_library': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'),
1300
+ 'loadable_module': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'),
1301
+ 'windows_driver': ('VCLinkerTool', 'Link', '$(OutDir)', '.sys'),
1302
+ 'static_library': ('VCLibrarianTool', 'Lib', '$(OutDir)lib\\', '.lib'),
1303
+ }
1304
+ output_file_props = output_file_map.get(spec['type'])
1305
+ if output_file_props and int(spec.get('msvs_auto_output_file', 1)):
1306
+ vc_tool, msbuild_tool, out_dir, suffix = output_file_props
1307
+ if spec.get('standalone_static_library', 0):
1308
+ out_dir = '$(OutDir)'
1309
+ out_dir = spec.get('product_dir', out_dir)
1310
+ product_extension = spec.get('product_extension')
1311
+ if product_extension:
1312
+ suffix = '.' + product_extension
1313
+ elif msbuild:
1314
+ suffix = '$(TargetExt)'
1315
+ prefix = spec.get('product_prefix', '')
1316
+ product_name = spec.get('product_name', '$(ProjectName)')
1317
+ out_file = ntpath.join(out_dir, prefix + product_name + suffix)
1318
+ return out_file, vc_tool, msbuild_tool
1319
+
1320
+
1321
+ def _GetOutputTargetExt(spec):
1322
+ """Returns the extension for this target, including the dot
1323
+
1324
+ If product_extension is specified, set target_extension to this to avoid
1325
+ MSB8012, returns None otherwise. Ignores any target_extension settings in
1326
+ the input files.
1327
+
1328
+ Arguments:
1329
+ spec: The target dictionary containing the properties of the target.
1330
+ Returns:
1331
+ A string with the extension, or None
1332
+ """
1333
+ target_extension = spec.get('product_extension')
1334
+ if target_extension:
1335
+ return '.' + target_extension
1336
+ return None
1337
+
1338
+
1339
+ def _GetDefines(config):
1340
+ """Returns the list of preprocessor definitions for this configuation.
1341
+
1342
+ Arguments:
1343
+ config: The dictionary that defines the special processing to be done
1344
+ for this configuration.
1345
+ Returns:
1346
+ The list of preprocessor definitions.
1347
+ """
1348
+ defines = []
1349
+ for d in config.get('defines', []):
1350
+ if type(d) == list:
1351
+ fd = '='.join([str(dpart) for dpart in d])
1352
+ else:
1353
+ fd = str(d)
1354
+ defines.append(fd)
1355
+ return defines
1356
+
1357
+
1358
+ def _GetDisabledWarnings(config):
1359
+ return [str(i) for i in config.get('msvs_disabled_warnings', [])]
1360
+
1361
+
1362
+ def _GetModuleDefinition(spec):
1363
+ def_file = ''
1364
+ if spec['type'] in ['shared_library', 'loadable_module', 'executable',
1365
+ 'windows_driver']:
1366
+ def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
1367
+ if len(def_files) == 1:
1368
+ def_file = _FixPath(def_files[0])
1369
+ elif def_files:
1370
+ raise ValueError(
1371
+ 'Multiple module definition files in one target, target %s lists '
1372
+ 'multiple .def files: %s' % (
1373
+ spec['target_name'], ' '.join(def_files)))
1374
+ return def_file
1375
+
1376
+
1377
+ def _ConvertToolsToExpectedForm(tools):
1378
+ """Convert tools to a form expected by Visual Studio.
1379
+
1380
+ Arguments:
1381
+ tools: A dictionary of settings; the tool name is the key.
1382
+ Returns:
1383
+ A list of Tool objects.
1384
+ """
1385
+ tool_list = []
1386
+ for tool, settings in tools.items():
1387
+ # Collapse settings with lists.
1388
+ settings_fixed = {}
1389
+ for setting, value in settings.items():
1390
+ if type(value) == list:
1391
+ if ((tool == 'VCLinkerTool' and
1392
+ setting == 'AdditionalDependencies') or
1393
+ setting == 'AdditionalOptions'):
1394
+ settings_fixed[setting] = ' '.join(value)
1395
+ else:
1396
+ settings_fixed[setting] = ';'.join(value)
1397
+ else:
1398
+ settings_fixed[setting] = value
1399
+ # Add in this tool.
1400
+ tool_list.append(MSVSProject.Tool(tool, settings_fixed))
1401
+ return tool_list
1402
+
1403
+
1404
+ def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):
1405
+ """Add to the project file the configuration specified by config.
1406
+
1407
+ Arguments:
1408
+ p: The target project being generated.
1409
+ spec: the target project dict.
1410
+ tools: A dictionary of settings; the tool name is the key.
1411
+ config: The dictionary that defines the special processing to be done
1412
+ for this configuration.
1413
+ config_type: The configuration type, a number as defined by Microsoft.
1414
+ config_name: The name of the configuration.
1415
+ """
1416
+ attributes = _GetMSVSAttributes(spec, config, config_type)
1417
+ # Add in this configuration.
1418
+ tool_list = _ConvertToolsToExpectedForm(tools)
1419
+ p.AddConfig(_ConfigFullName(config_name, config),
1420
+ attrs=attributes, tools=tool_list)
1421
+
1422
+
1423
+ def _GetMSVSAttributes(spec, config, config_type):
1424
+ # Prepare configuration attributes.
1425
+ prepared_attrs = {}
1426
+ source_attrs = config.get('msvs_configuration_attributes', {})
1427
+ for a in source_attrs:
1428
+ prepared_attrs[a] = source_attrs[a]
1429
+ # Add props files.
1430
+ vsprops_dirs = config.get('msvs_props', [])
1431
+ vsprops_dirs = _FixPaths(vsprops_dirs)
1432
+ if vsprops_dirs:
1433
+ prepared_attrs['InheritedPropertySheets'] = ';'.join(vsprops_dirs)
1434
+ # Set configuration type.
1435
+ prepared_attrs['ConfigurationType'] = config_type
1436
+ output_dir = prepared_attrs.get('OutputDirectory',
1437
+ '$(SolutionDir)$(ConfigurationName)')
1438
+ prepared_attrs['OutputDirectory'] = _FixPath(output_dir) + '\\'
1439
+ if 'IntermediateDirectory' not in prepared_attrs:
1440
+ intermediate = '$(ConfigurationName)\\obj\\$(ProjectName)'
1441
+ prepared_attrs['IntermediateDirectory'] = _FixPath(intermediate) + '\\'
1442
+ else:
1443
+ intermediate = _FixPath(prepared_attrs['IntermediateDirectory']) + '\\'
1444
+ intermediate = MSVSSettings.FixVCMacroSlashes(intermediate)
1445
+ prepared_attrs['IntermediateDirectory'] = intermediate
1446
+ return prepared_attrs
1447
+
1448
+
1449
+ def _AddNormalizedSources(sources_set, sources_array):
1450
+ sources_set.update(_NormalizedSource(s) for s in sources_array)
1451
+
1452
+
1453
+ def _PrepareListOfSources(spec, generator_flags, gyp_file):
1454
+ """Prepare list of sources and excluded sources.
1455
+
1456
+ Besides the sources specified directly in the spec, adds the gyp file so
1457
+ that a change to it will cause a re-compile. Also adds appropriate sources
1458
+ for actions and copies. Assumes later stage will un-exclude files which
1459
+ have custom build steps attached.
1460
+
1461
+ Arguments:
1462
+ spec: The target dictionary containing the properties of the target.
1463
+ gyp_file: The name of the gyp file.
1464
+ Returns:
1465
+ A pair of (list of sources, list of excluded sources).
1466
+ The sources will be relative to the gyp file.
1467
+ """
1468
+ sources = OrderedSet()
1469
+ _AddNormalizedSources(sources, spec.get('sources', []))
1470
+ excluded_sources = OrderedSet()
1471
+ # Add in the gyp file.
1472
+ if not generator_flags.get('standalone'):
1473
+ sources.add(gyp_file)
1474
+
1475
+ # Add in 'action' inputs and outputs.
1476
+ for a in spec.get('actions', []):
1477
+ inputs = a['inputs']
1478
+ inputs = [_NormalizedSource(i) for i in inputs]
1479
+ # Add all inputs to sources and excluded sources.
1480
+ inputs = OrderedSet(inputs)
1481
+ sources.update(inputs)
1482
+ if not spec.get('msvs_external_builder'):
1483
+ excluded_sources.update(inputs)
1484
+ if int(a.get('process_outputs_as_sources', False)):
1485
+ _AddNormalizedSources(sources, a.get('outputs', []))
1486
+ # Add in 'copies' inputs and outputs.
1487
+ for cpy in spec.get('copies', []):
1488
+ _AddNormalizedSources(sources, cpy.get('files', []))
1489
+ return (sources, excluded_sources)
1490
+
1491
+
1492
+ def _AdjustSourcesAndConvertToFilterHierarchy(
1493
+ spec, options, gyp_dir, sources, excluded_sources, list_excluded, version):
1494
+ """Adjusts the list of sources and excluded sources.
1495
+
1496
+ Also converts the sets to lists.
1497
+
1498
+ Arguments:
1499
+ spec: The target dictionary containing the properties of the target.
1500
+ options: Global generator options.
1501
+ gyp_dir: The path to the gyp file being processed.
1502
+ sources: A set of sources to be included for this project.
1503
+ excluded_sources: A set of sources to be excluded for this project.
1504
+ version: A MSVSVersion object.
1505
+ Returns:
1506
+ A trio of (list of sources, list of excluded sources,
1507
+ path of excluded IDL file)
1508
+ """
1509
+ # Exclude excluded sources coming into the generator.
1510
+ excluded_sources.update(OrderedSet(spec.get('sources_excluded', [])))
1511
+ # Add excluded sources into sources for good measure.
1512
+ sources.update(excluded_sources)
1513
+ # Convert to proper windows form.
1514
+ # NOTE: sources goes from being a set to a list here.
1515
+ # NOTE: excluded_sources goes from being a set to a list here.
1516
+ sources = _FixPaths(sources)
1517
+ # Convert to proper windows form.
1518
+ excluded_sources = _FixPaths(excluded_sources)
1519
+
1520
+ excluded_idl = _IdlFilesHandledNonNatively(spec, sources)
1521
+
1522
+ precompiled_related = _GetPrecompileRelatedFiles(spec)
1523
+ # Find the excluded ones, minus the precompiled header related ones.
1524
+ fully_excluded = [i for i in excluded_sources if i not in precompiled_related]
1525
+
1526
+ # Convert to folders and the right slashes.
1527
+ sources = [i.split('\\') for i in sources]
1528
+ sources = _ConvertSourcesToFilterHierarchy(sources, excluded=fully_excluded,
1529
+ list_excluded=list_excluded,
1530
+ msvs_version=version)
1531
+
1532
+ # Prune filters with a single child to flatten ugly directory structures
1533
+ # such as ../../src/modules/module1 etc.
1534
+ if version.UsesVcxproj():
1535
+ while all([isinstance(s, MSVSProject.Filter) for s in sources]) \
1536
+ and len(set([s.name for s in sources])) == 1:
1537
+ assert all([len(s.contents) == 1 for s in sources])
1538
+ sources = [s.contents[0] for s in sources]
1539
+ else:
1540
+ while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter):
1541
+ sources = sources[0].contents
1542
+
1543
+ return sources, excluded_sources, excluded_idl
1544
+
1545
+
1546
+ def _IdlFilesHandledNonNatively(spec, sources):
1547
+ # If any non-native rules use 'idl' as an extension exclude idl files.
1548
+ # Gather a list here to use later.
1549
+ using_idl = False
1550
+ for rule in spec.get('rules', []):
1551
+ if rule['extension'] == 'idl' and int(rule.get('msvs_external_rule', 0)):
1552
+ using_idl = True
1553
+ break
1554
+ if using_idl:
1555
+ excluded_idl = [i for i in sources if i.endswith('.idl')]
1556
+ else:
1557
+ excluded_idl = []
1558
+ return excluded_idl
1559
+
1560
+
1561
+ def _GetPrecompileRelatedFiles(spec):
1562
+ # Gather a list of precompiled header related sources.
1563
+ precompiled_related = []
1564
+ for _, config in spec['configurations'].items():
1565
+ for k in precomp_keys:
1566
+ f = config.get(k)
1567
+ if f:
1568
+ precompiled_related.append(_FixPath(f))
1569
+ return precompiled_related
1570
+
1571
+
1572
+ def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl,
1573
+ list_excluded):
1574
+ exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
1575
+ for file_name, excluded_configs in exclusions.items():
1576
+ if (not list_excluded and
1577
+ len(excluded_configs) == len(spec['configurations'])):
1578
+ # If we're not listing excluded files, then they won't appear in the
1579
+ # project, so don't try to configure them to be excluded.
1580
+ pass
1581
+ else:
1582
+ for config_name, config in excluded_configs:
1583
+ p.AddFileConfig(file_name, _ConfigFullName(config_name, config),
1584
+ {'ExcludedFromBuild': 'true'})
1585
+
1586
+
1587
+ def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl):
1588
+ exclusions = {}
1589
+ # Exclude excluded sources from being built.
1590
+ for f in excluded_sources:
1591
+ excluded_configs = []
1592
+ for config_name, config in spec['configurations'].items():
1593
+ precomped = [_FixPath(config.get(i, '')) for i in precomp_keys]
1594
+ # Don't do this for ones that are precompiled header related.
1595
+ if f not in precomped:
1596
+ excluded_configs.append((config_name, config))
1597
+ exclusions[f] = excluded_configs
1598
+ # If any non-native rules use 'idl' as an extension exclude idl files.
1599
+ # Exclude them now.
1600
+ for f in excluded_idl:
1601
+ excluded_configs = []
1602
+ for config_name, config in spec['configurations'].items():
1603
+ excluded_configs.append((config_name, config))
1604
+ exclusions[f] = excluded_configs
1605
+ return exclusions
1606
+
1607
+
1608
+ def _AddToolFilesToMSVS(p, spec):
1609
+ # Add in tool files (rules).
1610
+ tool_files = OrderedSet()
1611
+ for _, config in spec['configurations'].items():
1612
+ for f in config.get('msvs_tool_files', []):
1613
+ tool_files.add(f)
1614
+ for f in tool_files:
1615
+ p.AddToolFile(f)
1616
+
1617
+
1618
+ def _HandlePreCompiledHeaders(p, sources, spec):
1619
+ # Pre-compiled header source stubs need a different compiler flag
1620
+ # (generate precompiled header) and any source file not of the same
1621
+ # kind (i.e. C vs. C++) as the precompiled header source stub needs
1622
+ # to have use of precompiled headers disabled.
1623
+ extensions_excluded_from_precompile = []
1624
+ for config_name, config in spec['configurations'].items():
1625
+ source = config.get('msvs_precompiled_source')
1626
+ if source:
1627
+ source = _FixPath(source)
1628
+ # UsePrecompiledHeader=1 for if using precompiled headers.
1629
+ tool = MSVSProject.Tool('VCCLCompilerTool',
1630
+ {'UsePrecompiledHeader': '1'})
1631
+ p.AddFileConfig(source, _ConfigFullName(config_name, config),
1632
+ {}, tools=[tool])
1633
+ basename, extension = os.path.splitext(source)
1634
+ if extension == '.c':
1635
+ extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx']
1636
+ else:
1637
+ extensions_excluded_from_precompile = ['.c']
1638
+ def DisableForSourceTree(source_tree):
1639
+ for source in source_tree:
1640
+ if isinstance(source, MSVSProject.Filter):
1641
+ DisableForSourceTree(source.contents)
1642
+ else:
1643
+ basename, extension = os.path.splitext(source)
1644
+ if extension in extensions_excluded_from_precompile:
1645
+ for config_name, config in spec['configurations'].items():
1646
+ tool = MSVSProject.Tool('VCCLCompilerTool',
1647
+ {'UsePrecompiledHeader': '0',
1648
+ 'ForcedIncludeFiles': '$(NOINHERIT)'})
1649
+ p.AddFileConfig(_FixPath(source),
1650
+ _ConfigFullName(config_name, config),
1651
+ {}, tools=[tool])
1652
+ # Do nothing if there was no precompiled source.
1653
+ if extensions_excluded_from_precompile:
1654
+ DisableForSourceTree(sources)
1655
+
1656
+
1657
+ def _AddActions(actions_to_add, spec, relative_path_of_gyp_file):
1658
+ # Add actions.
1659
+ actions = spec.get('actions', [])
1660
+ # Don't setup_env every time. When all the actions are run together in one
1661
+ # batch file in VS, the PATH will grow too long.
1662
+ # Membership in this set means that the cygwin environment has been set up,
1663
+ # and does not need to be set up again.
1664
+ have_setup_env = set()
1665
+ for a in actions:
1666
+ # Attach actions to the gyp file if nothing else is there.
1667
+ inputs = a.get('inputs') or [relative_path_of_gyp_file]
1668
+ attached_to = inputs[0]
1669
+ need_setup_env = attached_to not in have_setup_env
1670
+ cmd = _BuildCommandLineForRule(spec, a, has_input_path=False,
1671
+ do_setup_env=need_setup_env)
1672
+ have_setup_env.add(attached_to)
1673
+ # Add the action.
1674
+ _AddActionStep(actions_to_add,
1675
+ inputs=inputs,
1676
+ outputs=a.get('outputs', []),
1677
+ description=a.get('message', a['action_name']),
1678
+ command=cmd)
1679
+
1680
+
1681
+ def _WriteMSVSUserFile(project_path, version, spec):
1682
+ # Add run_as and test targets.
1683
+ if 'run_as' in spec:
1684
+ run_as = spec['run_as']
1685
+ action = run_as.get('action', [])
1686
+ environment = run_as.get('environment', [])
1687
+ working_directory = run_as.get('working_directory', '.')
1688
+ elif int(spec.get('test', 0)):
1689
+ action = ['$(TargetPath)', '--gtest_print_time']
1690
+ environment = []
1691
+ working_directory = '.'
1692
+ else:
1693
+ return # Nothing to add
1694
+ # Write out the user file.
1695
+ user_file = _CreateMSVSUserFile(project_path, version, spec)
1696
+ for config_name, c_data in spec['configurations'].items():
1697
+ user_file.AddDebugSettings(_ConfigFullName(config_name, c_data),
1698
+ action, environment, working_directory)
1699
+ user_file.WriteIfChanged()
1700
+
1701
+
1702
+ def _AddCopies(actions_to_add, spec):
1703
+ copies = _GetCopies(spec)
1704
+ for inputs, outputs, cmd, description in copies:
1705
+ _AddActionStep(actions_to_add, inputs=inputs, outputs=outputs,
1706
+ description=description, command=cmd)
1707
+
1708
+
1709
+ def _GetCopies(spec):
1710
+ copies = []
1711
+ # Add copies.
1712
+ for cpy in spec.get('copies', []):
1713
+ for src in cpy.get('files', []):
1714
+ dst = os.path.join(cpy['destination'], os.path.basename(src))
1715
+ # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and
1716
+ # outputs, so do the same for our generated command line.
1717
+ if src.endswith('/'):
1718
+ src_bare = src[:-1]
1719
+ base_dir = posixpath.split(src_bare)[0]
1720
+ outer_dir = posixpath.split(src_bare)[1]
1721
+ fixed_dst = _FixPath(dst)
1722
+ full_dst = '"%s\\%s\\"' % (fixed_dst, outer_dir)
1723
+ cmd = 'mkdir %s 2>nul & cd "%s" && xcopy /e /f /y "%s" %s' % (
1724
+ full_dst, _FixPath(base_dir), outer_dir, full_dst)
1725
+ copies.append(([src], ['dummy_copies', dst], cmd,
1726
+ 'Copying %s to %s' % (src, fixed_dst)))
1727
+ else:
1728
+ fix_dst = _FixPath(cpy['destination'])
1729
+ cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % (
1730
+ fix_dst, _FixPath(src), _FixPath(dst))
1731
+ copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, fix_dst)))
1732
+ return copies
1733
+
1734
+
1735
+ def _GetPathDict(root, path):
1736
+ # |path| will eventually be empty (in the recursive calls) if it was initially
1737
+ # relative; otherwise it will eventually end up as '\', 'D:\', etc.
1738
+ if not path or path.endswith(os.sep):
1739
+ return root
1740
+ parent, folder = os.path.split(path)
1741
+ parent_dict = _GetPathDict(root, parent)
1742
+ if folder not in parent_dict:
1743
+ parent_dict[folder] = dict()
1744
+ return parent_dict[folder]
1745
+
1746
+
1747
+ def _DictsToFolders(base_path, bucket, flat):
1748
+ # Convert to folders recursively.
1749
+ children = []
1750
+ for folder, contents in bucket.items():
1751
+ if type(contents) == dict:
1752
+ folder_children = _DictsToFolders(os.path.join(base_path, folder),
1753
+ contents, flat)
1754
+ if flat:
1755
+ children += folder_children
1756
+ else:
1757
+ folder_children = MSVSNew.MSVSFolder(os.path.join(base_path, folder),
1758
+ name='(' + folder + ')',
1759
+ entries=folder_children)
1760
+ children.append(folder_children)
1761
+ else:
1762
+ children.append(contents)
1763
+ return children
1764
+
1765
+
1766
+ def _CollapseSingles(parent, node):
1767
+ # Recursively explorer the tree of dicts looking for projects which are
1768
+ # the sole item in a folder which has the same name as the project. Bring
1769
+ # such projects up one level.
1770
+ if (type(node) == dict and
1771
+ len(node) == 1 and
1772
+ next(iter(node)) == parent + '.vcproj'):
1773
+ return node[next(iter(node))]
1774
+ if type(node) != dict:
1775
+ return node
1776
+ for child in node:
1777
+ node[child] = _CollapseSingles(child, node[child])
1778
+ return node
1779
+
1780
+
1781
+ def _GatherSolutionFolders(sln_projects, project_objects, flat):
1782
+ root = {}
1783
+ # Convert into a tree of dicts on path.
1784
+ for p in sln_projects:
1785
+ gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2]
1786
+ gyp_dir = os.path.dirname(gyp_file)
1787
+ path_dict = _GetPathDict(root, gyp_dir)
1788
+ path_dict[target + '.vcproj'] = project_objects[p]
1789
+ # Walk down from the top until we hit a folder that has more than one entry.
1790
+ # In practice, this strips the top-level "src/" dir from the hierarchy in
1791
+ # the solution.
1792
+ while len(root) == 1 and type(root[next(iter(root))]) == dict:
1793
+ root = root[next(iter(root))]
1794
+ # Collapse singles.
1795
+ root = _CollapseSingles('', root)
1796
+ # Merge buckets until everything is a root entry.
1797
+ return _DictsToFolders('', root, flat)
1798
+
1799
+
1800
+ def _GetPathOfProject(qualified_target, spec, options, msvs_version):
1801
+ default_config = _GetDefaultConfiguration(spec)
1802
+ proj_filename = default_config.get('msvs_existing_vcproj')
1803
+ if not proj_filename:
1804
+ proj_filename = (spec['target_name'] + options.suffix +
1805
+ msvs_version.ProjectExtension())
1806
+
1807
+ build_file = gyp.common.BuildFile(qualified_target)
1808
+ proj_path = os.path.join(os.path.dirname(build_file), proj_filename)
1809
+ fix_prefix = None
1810
+ if options.generator_output:
1811
+ project_dir_path = os.path.dirname(os.path.abspath(proj_path))
1812
+ proj_path = os.path.join(options.generator_output, proj_path)
1813
+ fix_prefix = gyp.common.RelativePath(project_dir_path,
1814
+ os.path.dirname(proj_path))
1815
+ return proj_path, fix_prefix
1816
+
1817
+
1818
+ def _GetPlatformOverridesOfProject(spec):
1819
+ # Prepare a dict indicating which project configurations are used for which
1820
+ # solution configurations for this target.
1821
+ config_platform_overrides = {}
1822
+ for config_name, c in spec['configurations'].items():
1823
+ config_fullname = _ConfigFullName(config_name, c)
1824
+ platform = c.get('msvs_target_platform', _ConfigPlatform(c))
1825
+ fixed_config_fullname = '%s|%s' % (
1826
+ _ConfigBaseName(config_name, _ConfigPlatform(c)), platform)
1827
+ config_platform_overrides[config_fullname] = fixed_config_fullname
1828
+ return config_platform_overrides
1829
+
1830
+
1831
+ def _CreateProjectObjects(target_list, target_dicts, options, msvs_version):
1832
+ """Create a MSVSProject object for the targets found in target list.
1833
+
1834
+ Arguments:
1835
+ target_list: the list of targets to generate project objects for.
1836
+ target_dicts: the dictionary of specifications.
1837
+ options: global generator options.
1838
+ msvs_version: the MSVSVersion object.
1839
+ Returns:
1840
+ A set of created projects, keyed by target.
1841
+ """
1842
+ global fixpath_prefix
1843
+ # Generate each project.
1844
+ projects = {}
1845
+ for qualified_target in target_list:
1846
+ spec = target_dicts[qualified_target]
1847
+ if spec['toolset'] != 'target':
1848
+ raise GypError(
1849
+ 'Multiple toolsets not supported in msvs build (target %s)' %
1850
+ qualified_target)
1851
+ proj_path, fixpath_prefix = _GetPathOfProject(qualified_target, spec,
1852
+ options, msvs_version)
1853
+ guid = _GetGuidOfProject(proj_path, spec)
1854
+ overrides = _GetPlatformOverridesOfProject(spec)
1855
+ build_file = gyp.common.BuildFile(qualified_target)
1856
+ # Create object for this project.
1857
+ obj = MSVSNew.MSVSProject(
1858
+ proj_path,
1859
+ name=spec['target_name'],
1860
+ guid=guid,
1861
+ spec=spec,
1862
+ build_file=build_file,
1863
+ config_platform_overrides=overrides,
1864
+ fixpath_prefix=fixpath_prefix)
1865
+ # Set project toolset if any (MS build only)
1866
+ if msvs_version.UsesVcxproj():
1867
+ obj.set_msbuild_toolset(
1868
+ _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version))
1869
+ projects[qualified_target] = obj
1870
+ # Set all the dependencies, but not if we are using an external builder like
1871
+ # ninja
1872
+ for project in projects.values():
1873
+ if not project.spec.get('msvs_external_builder'):
1874
+ deps = project.spec.get('dependencies', [])
1875
+ deps = [projects[d] for d in deps]
1876
+ project.set_dependencies(deps)
1877
+ return projects
1878
+
1879
+
1880
+ def _InitNinjaFlavor(params, target_list, target_dicts):
1881
+ """Initialize targets for the ninja flavor.
1882
+
1883
+ This sets up the necessary variables in the targets to generate msvs projects
1884
+ that use ninja as an external builder. The variables in the spec are only set
1885
+ if they have not been set. This allows individual specs to override the
1886
+ default values initialized here.
1887
+ Arguments:
1888
+ params: Params provided to the generator.
1889
+ target_list: List of target pairs: 'base/base.gyp:base'.
1890
+ target_dicts: Dict of target properties keyed on target pair.
1891
+ """
1892
+ for qualified_target in target_list:
1893
+ spec = target_dicts[qualified_target]
1894
+ if spec.get('msvs_external_builder'):
1895
+ # The spec explicitly defined an external builder, so don't change it.
1896
+ continue
1897
+
1898
+ path_to_ninja = spec.get('msvs_path_to_ninja', 'ninja.exe')
1899
+
1900
+ spec['msvs_external_builder'] = 'ninja'
1901
+ if not spec.get('msvs_external_builder_out_dir'):
1902
+ gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target)
1903
+ gyp_dir = os.path.dirname(gyp_file)
1904
+ configuration = '$(Configuration)'
1905
+ if params.get('target_arch') == 'x64':
1906
+ configuration += '_x64'
1907
+ spec['msvs_external_builder_out_dir'] = os.path.join(
1908
+ gyp.common.RelativePath(params['options'].toplevel_dir, gyp_dir),
1909
+ ninja_generator.ComputeOutputDir(params),
1910
+ configuration)
1911
+ if not spec.get('msvs_external_builder_build_cmd'):
1912
+ spec['msvs_external_builder_build_cmd'] = [
1913
+ path_to_ninja,
1914
+ '-C',
1915
+ '$(OutDir)',
1916
+ '$(ProjectName)',
1917
+ ]
1918
+ if not spec.get('msvs_external_builder_clean_cmd'):
1919
+ spec['msvs_external_builder_clean_cmd'] = [
1920
+ path_to_ninja,
1921
+ '-C',
1922
+ '$(OutDir)',
1923
+ '-tclean',
1924
+ '$(ProjectName)',
1925
+ ]
1926
+
1927
+
1928
+ def CalculateVariables(default_variables, params):
1929
+ """Generated variables that require params to be known."""
1930
+
1931
+ generator_flags = params.get('generator_flags', {})
1932
+
1933
+ # Select project file format version (if unset, default to auto detecting).
1934
+ msvs_version = MSVSVersion.SelectVisualStudioVersion(
1935
+ generator_flags.get('msvs_version', 'auto'))
1936
+ # Stash msvs_version for later (so we don't have to probe the system twice).
1937
+ params['msvs_version'] = msvs_version
1938
+
1939
+ # Set a variable so conditions can be based on msvs_version.
1940
+ default_variables['MSVS_VERSION'] = msvs_version.ShortName()
1941
+
1942
+ # To determine processor word size on Windows, in addition to checking
1943
+ # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
1944
+ # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which
1945
+ # contains the actual word size of the system when running thru WOW64).
1946
+ if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or
1947
+ os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0):
1948
+ default_variables['MSVS_OS_BITS'] = 64
1949
+ else:
1950
+ default_variables['MSVS_OS_BITS'] = 32
1951
+
1952
+ if gyp.common.GetFlavor(params) == 'ninja':
1953
+ default_variables['SHARED_INTERMEDIATE_DIR'] = '$(OutDir)gen'
1954
+
1955
+
1956
+ def PerformBuild(data, configurations, params):
1957
+ options = params['options']
1958
+ msvs_version = params['msvs_version']
1959
+ devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com')
1960
+
1961
+ for build_file, build_file_dict in data.items():
1962
+ (build_file_root, build_file_ext) = os.path.splitext(build_file)
1963
+ if build_file_ext != '.gyp':
1964
+ continue
1965
+ sln_path = build_file_root + options.suffix + '.sln'
1966
+ if options.generator_output:
1967
+ sln_path = os.path.join(options.generator_output, sln_path)
1968
+
1969
+ for config in configurations:
1970
+ arguments = [devenv, sln_path, '/Build', config]
1971
+ print('Building [%s]: %s' % (config, arguments))
1972
+ rtn = subprocess.check_call(arguments)
1973
+
1974
+
1975
+ def CalculateGeneratorInputInfo(params):
1976
+ if params.get('flavor') == 'ninja':
1977
+ toplevel = params['options'].toplevel_dir
1978
+ qualified_out_dir = os.path.normpath(os.path.join(
1979
+ toplevel, ninja_generator.ComputeOutputDir(params),
1980
+ 'gypfiles-msvs-ninja'))
1981
+
1982
+ global generator_filelist_paths
1983
+ generator_filelist_paths = {
1984
+ 'toplevel': toplevel,
1985
+ 'qualified_out_dir': qualified_out_dir,
1986
+ }
1987
+
1988
+ def GenerateOutput(target_list, target_dicts, data, params):
1989
+ """Generate .sln and .vcproj files.
1990
+
1991
+ This is the entry point for this generator.
1992
+ Arguments:
1993
+ target_list: List of target pairs: 'base/base.gyp:base'.
1994
+ target_dicts: Dict of target properties keyed on target pair.
1995
+ data: Dictionary containing per .gyp data.
1996
+ """
1997
+ global fixpath_prefix
1998
+
1999
+ options = params['options']
2000
+
2001
+ # Get the project file format version back out of where we stashed it in
2002
+ # GeneratorCalculatedVariables.
2003
+ msvs_version = params['msvs_version']
2004
+
2005
+ generator_flags = params.get('generator_flags', {})
2006
+
2007
+ # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT.
2008
+ (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts)
2009
+
2010
+ # Optionally use the large PDB workaround for targets marked with
2011
+ # 'msvs_large_pdb': 1.
2012
+ (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims(
2013
+ target_list, target_dicts, generator_default_variables)
2014
+
2015
+ # Optionally configure each spec to use ninja as the external builder.
2016
+ if params.get('flavor') == 'ninja':
2017
+ _InitNinjaFlavor(params, target_list, target_dicts)
2018
+
2019
+ # Prepare the set of configurations.
2020
+ configs = set()
2021
+ for qualified_target in target_list:
2022
+ spec = target_dicts[qualified_target]
2023
+ for config_name, config in spec['configurations'].items():
2024
+ configs.add(_ConfigFullName(config_name, config))
2025
+ configs = list(configs)
2026
+
2027
+ # Figure out all the projects that will be generated and their guids
2028
+ project_objects = _CreateProjectObjects(target_list, target_dicts, options,
2029
+ msvs_version)
2030
+
2031
+ # Generate each project.
2032
+ missing_sources = []
2033
+ for project in project_objects.values():
2034
+ fixpath_prefix = project.fixpath_prefix
2035
+ missing_sources.extend(_GenerateProject(project, options, msvs_version,
2036
+ generator_flags))
2037
+ fixpath_prefix = None
2038
+
2039
+ for build_file in data:
2040
+ # Validate build_file extension
2041
+ if not build_file.endswith('.gyp'):
2042
+ continue
2043
+ sln_path = os.path.splitext(build_file)[0] + options.suffix + '.sln'
2044
+ if options.generator_output:
2045
+ sln_path = os.path.join(options.generator_output, sln_path)
2046
+ # Get projects in the solution, and their dependents.
2047
+ sln_projects = gyp.common.BuildFileTargets(target_list, build_file)
2048
+ sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects)
2049
+ # Create folder hierarchy.
2050
+ root_entries = _GatherSolutionFolders(
2051
+ sln_projects, project_objects, flat=msvs_version.FlatSolution())
2052
+ # Create solution.
2053
+ sln = MSVSNew.MSVSSolution(sln_path,
2054
+ entries=root_entries,
2055
+ variants=configs,
2056
+ websiteProperties=False,
2057
+ version=msvs_version)
2058
+ sln.Write()
2059
+
2060
+ if missing_sources:
2061
+ error_message = "Missing input files:\n" + \
2062
+ '\n'.join(set(missing_sources))
2063
+ if generator_flags.get('msvs_error_on_missing_sources', False):
2064
+ raise GypError(error_message)
2065
+ else:
2066
+ print("Warning: " + error_message)
2067
+
2068
+
2069
+ def _GenerateMSBuildFiltersFile(filters_path, source_files,
2070
+ rule_dependencies, extension_to_rule_name):
2071
+ """Generate the filters file.
2072
+
2073
+ This file is used by Visual Studio to organize the presentation of source
2074
+ files into folders.
2075
+
2076
+ Arguments:
2077
+ filters_path: The path of the file to be created.
2078
+ source_files: The hierarchical structure of all the sources.
2079
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2080
+ """
2081
+ filter_group = []
2082
+ source_group = []
2083
+ _AppendFiltersForMSBuild('', source_files, rule_dependencies,
2084
+ extension_to_rule_name, filter_group, source_group)
2085
+ if filter_group:
2086
+ content = ['Project',
2087
+ {'ToolsVersion': '4.0',
2088
+ 'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'
2089
+ },
2090
+ ['ItemGroup'] + filter_group,
2091
+ ['ItemGroup'] + source_group
2092
+ ]
2093
+ easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
2094
+ elif os.path.exists(filters_path):
2095
+ # We don't need this filter anymore. Delete the old filter file.
2096
+ os.unlink(filters_path)
2097
+
2098
+
2099
+ def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies,
2100
+ extension_to_rule_name,
2101
+ filter_group, source_group):
2102
+ """Creates the list of filters and sources to be added in the filter file.
2103
+
2104
+ Args:
2105
+ parent_filter_name: The name of the filter under which the sources are
2106
+ found.
2107
+ sources: The hierarchy of filters and sources to process.
2108
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2109
+ filter_group: The list to which filter entries will be appended.
2110
+ source_group: The list to which source entries will be appeneded.
2111
+ """
2112
+ for source in sources:
2113
+ if isinstance(source, MSVSProject.Filter):
2114
+ # We have a sub-filter. Create the name of that sub-filter.
2115
+ if not parent_filter_name:
2116
+ filter_name = source.name
2117
+ else:
2118
+ filter_name = '%s\\%s' % (parent_filter_name, source.name)
2119
+ # Add the filter to the group.
2120
+ filter_group.append(
2121
+ ['Filter', {'Include': filter_name},
2122
+ ['UniqueIdentifier', MSVSNew.MakeGuid(source.name)]])
2123
+ # Recurse and add its dependents.
2124
+ _AppendFiltersForMSBuild(filter_name, source.contents,
2125
+ rule_dependencies, extension_to_rule_name,
2126
+ filter_group, source_group)
2127
+ else:
2128
+ # It's a source. Create a source entry.
2129
+ _, element = _MapFileToMsBuildSourceType(source, rule_dependencies,
2130
+ extension_to_rule_name)
2131
+ source_entry = [element, {'Include': source}]
2132
+ # Specify the filter it is part of, if any.
2133
+ if parent_filter_name:
2134
+ source_entry.append(['Filter', parent_filter_name])
2135
+ source_group.append(source_entry)
2136
+
2137
+
2138
+ def _MapFileToMsBuildSourceType(source, rule_dependencies,
2139
+ extension_to_rule_name):
2140
+ """Returns the group and element type of the source file.
2141
+
2142
+ Arguments:
2143
+ source: The source file name.
2144
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2145
+
2146
+ Returns:
2147
+ A pair of (group this file should be part of, the label of element)
2148
+ """
2149
+ _, ext = os.path.splitext(source)
2150
+ if ext in extension_to_rule_name:
2151
+ group = 'rule'
2152
+ element = extension_to_rule_name[ext]
2153
+ elif ext in ['.cc', '.cpp', '.c', '.cxx']:
2154
+ group = 'compile'
2155
+ element = 'ClCompile'
2156
+ elif ext in ['.h', '.hxx']:
2157
+ group = 'include'
2158
+ element = 'ClInclude'
2159
+ elif ext == '.rc':
2160
+ group = 'resource'
2161
+ element = 'ResourceCompile'
2162
+ elif ext == '.asm':
2163
+ group = 'masm'
2164
+ element = 'MASM'
2165
+ elif ext == '.idl':
2166
+ group = 'midl'
2167
+ element = 'Midl'
2168
+ elif source in rule_dependencies:
2169
+ group = 'rule_dependency'
2170
+ element = 'CustomBuild'
2171
+ else:
2172
+ group = 'none'
2173
+ element = 'None'
2174
+ return (group, element)
2175
+
2176
+
2177
+ def _GenerateRulesForMSBuild(output_dir, options, spec,
2178
+ sources, excluded_sources,
2179
+ props_files_of_rules, targets_files_of_rules,
2180
+ actions_to_add, rule_dependencies,
2181
+ extension_to_rule_name):
2182
+ # MSBuild rules are implemented using three files: an XML file, a .targets
2183
+ # file and a .props file.
2184
+ # See http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx
2185
+ # for more details.
2186
+ rules = spec.get('rules', [])
2187
+ rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))]
2188
+ rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))]
2189
+
2190
+ msbuild_rules = []
2191
+ for rule in rules_native:
2192
+ # Skip a rule with no action and no inputs.
2193
+ if 'action' not in rule and not rule.get('rule_sources', []):
2194
+ continue
2195
+ msbuild_rule = MSBuildRule(rule, spec)
2196
+ msbuild_rules.append(msbuild_rule)
2197
+ rule_dependencies.update(msbuild_rule.additional_dependencies.split(';'))
2198
+ extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name
2199
+ if msbuild_rules:
2200
+ base = spec['target_name'] + options.suffix
2201
+ props_name = base + '.props'
2202
+ targets_name = base + '.targets'
2203
+ xml_name = base + '.xml'
2204
+
2205
+ props_files_of_rules.add(props_name)
2206
+ targets_files_of_rules.add(targets_name)
2207
+
2208
+ props_path = os.path.join(output_dir, props_name)
2209
+ targets_path = os.path.join(output_dir, targets_name)
2210
+ xml_path = os.path.join(output_dir, xml_name)
2211
+
2212
+ _GenerateMSBuildRulePropsFile(props_path, msbuild_rules)
2213
+ _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules)
2214
+ _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules)
2215
+
2216
+ if rules_external:
2217
+ _GenerateExternalRules(rules_external, output_dir, spec,
2218
+ sources, options, actions_to_add)
2219
+ _AdjustSourcesForRules(rules, sources, excluded_sources, True)
2220
+
2221
+
2222
+ class MSBuildRule(object):
2223
+ """Used to store information used to generate an MSBuild rule.
2224
+
2225
+ Attributes:
2226
+ rule_name: The rule name, sanitized to use in XML.
2227
+ target_name: The name of the target.
2228
+ after_targets: The name of the AfterTargets element.
2229
+ before_targets: The name of the BeforeTargets element.
2230
+ depends_on: The name of the DependsOn element.
2231
+ compute_output: The name of the ComputeOutput element.
2232
+ dirs_to_make: The name of the DirsToMake element.
2233
+ inputs: The name of the _inputs element.
2234
+ tlog: The name of the _tlog element.
2235
+ extension: The extension this rule applies to.
2236
+ description: The message displayed when this rule is invoked.
2237
+ additional_dependencies: A string listing additional dependencies.
2238
+ outputs: The outputs of this rule.
2239
+ command: The command used to run the rule.
2240
+ """
2241
+
2242
+ def __init__(self, rule, spec):
2243
+ self.display_name = rule['rule_name']
2244
+ # Assure that the rule name is only characters and numbers
2245
+ self.rule_name = re.sub(r'\W', '_', self.display_name)
2246
+ # Create the various element names, following the example set by the
2247
+ # Visual Studio 2008 to 2010 conversion. I don't know if VS2010
2248
+ # is sensitive to the exact names.
2249
+ self.target_name = '_' + self.rule_name
2250
+ self.after_targets = self.rule_name + 'AfterTargets'
2251
+ self.before_targets = self.rule_name + 'BeforeTargets'
2252
+ self.depends_on = self.rule_name + 'DependsOn'
2253
+ self.compute_output = 'Compute%sOutput' % self.rule_name
2254
+ self.dirs_to_make = self.rule_name + 'DirsToMake'
2255
+ self.inputs = self.rule_name + '_inputs'
2256
+ self.tlog = self.rule_name + '_tlog'
2257
+ self.extension = rule['extension']
2258
+ if not self.extension.startswith('.'):
2259
+ self.extension = '.' + self.extension
2260
+
2261
+ self.description = MSVSSettings.ConvertVCMacrosToMSBuild(
2262
+ rule.get('message', self.rule_name))
2263
+ old_additional_dependencies = _FixPaths(rule.get('inputs', []))
2264
+ self.additional_dependencies = (
2265
+ ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i)
2266
+ for i in old_additional_dependencies]))
2267
+ old_outputs = _FixPaths(rule.get('outputs', []))
2268
+ self.outputs = ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i)
2269
+ for i in old_outputs])
2270
+ old_command = _BuildCommandLineForRule(spec, rule, has_input_path=True,
2271
+ do_setup_env=True)
2272
+ self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command)
2273
+
2274
+
2275
+ def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules):
2276
+ """Generate the .props file."""
2277
+ content = ['Project',
2278
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'}]
2279
+ for rule in msbuild_rules:
2280
+ content.extend([
2281
+ ['PropertyGroup',
2282
+ {'Condition': "'$(%s)' == '' and '$(%s)' == '' and "
2283
+ "'$(ConfigurationType)' != 'Makefile'" % (rule.before_targets,
2284
+ rule.after_targets)
2285
+ },
2286
+ [rule.before_targets, 'Midl'],
2287
+ [rule.after_targets, 'CustomBuild'],
2288
+ ],
2289
+ ['PropertyGroup',
2290
+ [rule.depends_on,
2291
+ {'Condition': "'$(ConfigurationType)' != 'Makefile'"},
2292
+ '_SelectedFiles;$(%s)' % rule.depends_on
2293
+ ],
2294
+ ],
2295
+ ['ItemDefinitionGroup',
2296
+ [rule.rule_name,
2297
+ ['CommandLineTemplate', rule.command],
2298
+ ['Outputs', rule.outputs],
2299
+ ['ExecutionDescription', rule.description],
2300
+ ['AdditionalDependencies', rule.additional_dependencies],
2301
+ ],
2302
+ ]
2303
+ ])
2304
+ easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True)
2305
+
2306
+
2307
+ def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules):
2308
+ """Generate the .targets file."""
2309
+ content = ['Project',
2310
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'
2311
+ }
2312
+ ]
2313
+ item_group = [
2314
+ 'ItemGroup',
2315
+ ['PropertyPageSchema',
2316
+ {'Include': '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'}
2317
+ ]
2318
+ ]
2319
+ for rule in msbuild_rules:
2320
+ item_group.append(
2321
+ ['AvailableItemName',
2322
+ {'Include': rule.rule_name},
2323
+ ['Targets', rule.target_name],
2324
+ ])
2325
+ content.append(item_group)
2326
+
2327
+ for rule in msbuild_rules:
2328
+ content.append(
2329
+ ['UsingTask',
2330
+ {'TaskName': rule.rule_name,
2331
+ 'TaskFactory': 'XamlTaskFactory',
2332
+ 'AssemblyName': 'Microsoft.Build.Tasks.v4.0'
2333
+ },
2334
+ ['Task', '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'],
2335
+ ])
2336
+ for rule in msbuild_rules:
2337
+ rule_name = rule.rule_name
2338
+ target_outputs = '%%(%s.Outputs)' % rule_name
2339
+ target_inputs = ('%%(%s.Identity);%%(%s.AdditionalDependencies);'
2340
+ '$(MSBuildProjectFile)') % (rule_name, rule_name)
2341
+ rule_inputs = '%%(%s.Identity)' % rule_name
2342
+ extension_condition = ("'%(Extension)'=='.obj' or "
2343
+ "'%(Extension)'=='.res' or "
2344
+ "'%(Extension)'=='.rsc' or "
2345
+ "'%(Extension)'=='.lib'")
2346
+ remove_section = [
2347
+ 'ItemGroup',
2348
+ {'Condition': "'@(SelectedFiles)' != ''"},
2349
+ [rule_name,
2350
+ {'Remove': '@(%s)' % rule_name,
2351
+ 'Condition': "'%(Identity)' != '@(SelectedFiles)'"
2352
+ }
2353
+ ]
2354
+ ]
2355
+ inputs_section = [
2356
+ 'ItemGroup',
2357
+ [rule.inputs, {'Include': '%%(%s.AdditionalDependencies)' % rule_name}]
2358
+ ]
2359
+ logging_section = [
2360
+ 'ItemGroup',
2361
+ [rule.tlog,
2362
+ {'Include': '%%(%s.Outputs)' % rule_name,
2363
+ 'Condition': ("'%%(%s.Outputs)' != '' and "
2364
+ "'%%(%s.ExcludedFromBuild)' != 'true'" %
2365
+ (rule_name, rule_name))
2366
+ },
2367
+ ['Source', "@(%s, '|')" % rule_name],
2368
+ ['Inputs', "@(%s -> '%%(Fullpath)', ';')" % rule.inputs],
2369
+ ],
2370
+ ]
2371
+ message_section = [
2372
+ 'Message',
2373
+ {'Importance': 'High',
2374
+ 'Text': '%%(%s.ExecutionDescription)' % rule_name
2375
+ }
2376
+ ]
2377
+ write_tlog_section = [
2378
+ 'WriteLinesToFile',
2379
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2380
+ "'true'" % (rule.tlog, rule.tlog),
2381
+ 'File': '$(IntDir)$(ProjectName).write.1.tlog',
2382
+ 'Lines': "^%%(%s.Source);@(%s->'%%(Fullpath)')" % (rule.tlog,
2383
+ rule.tlog)
2384
+ }
2385
+ ]
2386
+ read_tlog_section = [
2387
+ 'WriteLinesToFile',
2388
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2389
+ "'true'" % (rule.tlog, rule.tlog),
2390
+ 'File': '$(IntDir)$(ProjectName).read.1.tlog',
2391
+ 'Lines': "^%%(%s.Source);%%(%s.Inputs)" % (rule.tlog, rule.tlog)
2392
+ }
2393
+ ]
2394
+ command_and_input_section = [
2395
+ rule_name,
2396
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2397
+ "'true'" % (rule_name, rule_name),
2398
+ 'EchoOff': 'true',
2399
+ 'StandardOutputImportance': 'High',
2400
+ 'StandardErrorImportance': 'High',
2401
+ 'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name,
2402
+ 'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name,
2403
+ 'Inputs': rule_inputs
2404
+ }
2405
+ ]
2406
+ content.extend([
2407
+ ['Target',
2408
+ {'Name': rule.target_name,
2409
+ 'BeforeTargets': '$(%s)' % rule.before_targets,
2410
+ 'AfterTargets': '$(%s)' % rule.after_targets,
2411
+ 'Condition': "'@(%s)' != ''" % rule_name,
2412
+ 'DependsOnTargets': '$(%s);%s' % (rule.depends_on,
2413
+ rule.compute_output),
2414
+ 'Outputs': target_outputs,
2415
+ 'Inputs': target_inputs
2416
+ },
2417
+ remove_section,
2418
+ inputs_section,
2419
+ logging_section,
2420
+ message_section,
2421
+ write_tlog_section,
2422
+ read_tlog_section,
2423
+ command_and_input_section,
2424
+ ],
2425
+ ['PropertyGroup',
2426
+ ['ComputeLinkInputsTargets',
2427
+ '$(ComputeLinkInputsTargets);',
2428
+ '%s;' % rule.compute_output
2429
+ ],
2430
+ ['ComputeLibInputsTargets',
2431
+ '$(ComputeLibInputsTargets);',
2432
+ '%s;' % rule.compute_output
2433
+ ],
2434
+ ],
2435
+ ['Target',
2436
+ {'Name': rule.compute_output,
2437
+ 'Condition': "'@(%s)' != ''" % rule_name
2438
+ },
2439
+ ['ItemGroup',
2440
+ [rule.dirs_to_make,
2441
+ {'Condition': "'@(%s)' != '' and "
2442
+ "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name),
2443
+ 'Include': '%%(%s.Outputs)' % rule_name
2444
+ }
2445
+ ],
2446
+ ['Link',
2447
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2448
+ 'Condition': extension_condition
2449
+ }
2450
+ ],
2451
+ ['Lib',
2452
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2453
+ 'Condition': extension_condition
2454
+ }
2455
+ ],
2456
+ ['ImpLib',
2457
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2458
+ 'Condition': extension_condition
2459
+ }
2460
+ ],
2461
+ ],
2462
+ ['MakeDir',
2463
+ {'Directories': ("@(%s->'%%(RootDir)%%(Directory)')" %
2464
+ rule.dirs_to_make)
2465
+ }
2466
+ ]
2467
+ ],
2468
+ ])
2469
+ easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True)
2470
+
2471
+
2472
+ def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules):
2473
+ # Generate the .xml file
2474
+ content = [
2475
+ 'ProjectSchemaDefinitions',
2476
+ {'xmlns': ('clr-namespace:Microsoft.Build.Framework.XamlTypes;'
2477
+ 'assembly=Microsoft.Build.Framework'),
2478
+ 'xmlns:x': 'http://schemas.microsoft.com/winfx/2006/xaml',
2479
+ 'xmlns:sys': 'clr-namespace:System;assembly=mscorlib',
2480
+ 'xmlns:transformCallback':
2481
+ 'Microsoft.Cpp.Dev10.ConvertPropertyCallback'
2482
+ }
2483
+ ]
2484
+ for rule in msbuild_rules:
2485
+ content.extend([
2486
+ ['Rule',
2487
+ {'Name': rule.rule_name,
2488
+ 'PageTemplate': 'tool',
2489
+ 'DisplayName': rule.display_name,
2490
+ 'Order': '200'
2491
+ },
2492
+ ['Rule.DataSource',
2493
+ ['DataSource',
2494
+ {'Persistence': 'ProjectFile',
2495
+ 'ItemType': rule.rule_name
2496
+ }
2497
+ ]
2498
+ ],
2499
+ ['Rule.Categories',
2500
+ ['Category',
2501
+ {'Name': 'General'},
2502
+ ['Category.DisplayName',
2503
+ ['sys:String', 'General'],
2504
+ ],
2505
+ ],
2506
+ ['Category',
2507
+ {'Name': 'Command Line',
2508
+ 'Subtype': 'CommandLine'
2509
+ },
2510
+ ['Category.DisplayName',
2511
+ ['sys:String', 'Command Line'],
2512
+ ],
2513
+ ],
2514
+ ],
2515
+ ['StringListProperty',
2516
+ {'Name': 'Inputs',
2517
+ 'Category': 'Command Line',
2518
+ 'IsRequired': 'true',
2519
+ 'Switch': ' '
2520
+ },
2521
+ ['StringListProperty.DataSource',
2522
+ ['DataSource',
2523
+ {'Persistence': 'ProjectFile',
2524
+ 'ItemType': rule.rule_name,
2525
+ 'SourceType': 'Item'
2526
+ }
2527
+ ]
2528
+ ],
2529
+ ],
2530
+ ['StringProperty',
2531
+ {'Name': 'CommandLineTemplate',
2532
+ 'DisplayName': 'Command Line',
2533
+ 'Visible': 'False',
2534
+ 'IncludeInCommandLine': 'False'
2535
+ }
2536
+ ],
2537
+ ['DynamicEnumProperty',
2538
+ {'Name': rule.before_targets,
2539
+ 'Category': 'General',
2540
+ 'EnumProvider': 'Targets',
2541
+ 'IncludeInCommandLine': 'False'
2542
+ },
2543
+ ['DynamicEnumProperty.DisplayName',
2544
+ ['sys:String', 'Execute Before'],
2545
+ ],
2546
+ ['DynamicEnumProperty.Description',
2547
+ ['sys:String', 'Specifies the targets for the build customization'
2548
+ ' to run before.'
2549
+ ],
2550
+ ],
2551
+ ['DynamicEnumProperty.ProviderSettings',
2552
+ ['NameValuePair',
2553
+ {'Name': 'Exclude',
2554
+ 'Value': '^%s|^Compute' % rule.before_targets
2555
+ }
2556
+ ]
2557
+ ],
2558
+ ['DynamicEnumProperty.DataSource',
2559
+ ['DataSource',
2560
+ {'Persistence': 'ProjectFile',
2561
+ 'HasConfigurationCondition': 'true'
2562
+ }
2563
+ ]
2564
+ ],
2565
+ ],
2566
+ ['DynamicEnumProperty',
2567
+ {'Name': rule.after_targets,
2568
+ 'Category': 'General',
2569
+ 'EnumProvider': 'Targets',
2570
+ 'IncludeInCommandLine': 'False'
2571
+ },
2572
+ ['DynamicEnumProperty.DisplayName',
2573
+ ['sys:String', 'Execute After'],
2574
+ ],
2575
+ ['DynamicEnumProperty.Description',
2576
+ ['sys:String', ('Specifies the targets for the build customization'
2577
+ ' to run after.')
2578
+ ],
2579
+ ],
2580
+ ['DynamicEnumProperty.ProviderSettings',
2581
+ ['NameValuePair',
2582
+ {'Name': 'Exclude',
2583
+ 'Value': '^%s|^Compute' % rule.after_targets
2584
+ }
2585
+ ]
2586
+ ],
2587
+ ['DynamicEnumProperty.DataSource',
2588
+ ['DataSource',
2589
+ {'Persistence': 'ProjectFile',
2590
+ 'ItemType': '',
2591
+ 'HasConfigurationCondition': 'true'
2592
+ }
2593
+ ]
2594
+ ],
2595
+ ],
2596
+ ['StringListProperty',
2597
+ {'Name': 'Outputs',
2598
+ 'DisplayName': 'Outputs',
2599
+ 'Visible': 'False',
2600
+ 'IncludeInCommandLine': 'False'
2601
+ }
2602
+ ],
2603
+ ['StringProperty',
2604
+ {'Name': 'ExecutionDescription',
2605
+ 'DisplayName': 'Execution Description',
2606
+ 'Visible': 'False',
2607
+ 'IncludeInCommandLine': 'False'
2608
+ }
2609
+ ],
2610
+ ['StringListProperty',
2611
+ {'Name': 'AdditionalDependencies',
2612
+ 'DisplayName': 'Additional Dependencies',
2613
+ 'IncludeInCommandLine': 'False',
2614
+ 'Visible': 'false'
2615
+ }
2616
+ ],
2617
+ ['StringProperty',
2618
+ {'Subtype': 'AdditionalOptions',
2619
+ 'Name': 'AdditionalOptions',
2620
+ 'Category': 'Command Line'
2621
+ },
2622
+ ['StringProperty.DisplayName',
2623
+ ['sys:String', 'Additional Options'],
2624
+ ],
2625
+ ['StringProperty.Description',
2626
+ ['sys:String', 'Additional Options'],
2627
+ ],
2628
+ ],
2629
+ ],
2630
+ ['ItemType',
2631
+ {'Name': rule.rule_name,
2632
+ 'DisplayName': rule.display_name
2633
+ }
2634
+ ],
2635
+ ['FileExtension',
2636
+ {'Name': '*' + rule.extension,
2637
+ 'ContentType': rule.rule_name
2638
+ }
2639
+ ],
2640
+ ['ContentType',
2641
+ {'Name': rule.rule_name,
2642
+ 'DisplayName': '',
2643
+ 'ItemType': rule.rule_name
2644
+ }
2645
+ ]
2646
+ ])
2647
+ easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True)
2648
+
2649
+
2650
+ def _GetConfigurationAndPlatform(name, settings):
2651
+ configuration = name.rsplit('_', 1)[0]
2652
+ platform = settings.get('msvs_configuration_platform', 'Win32')
2653
+ return (configuration, platform)
2654
+
2655
+
2656
+ def _GetConfigurationCondition(name, settings):
2657
+ return (r"'$(Configuration)|$(Platform)'=='%s|%s'" %
2658
+ _GetConfigurationAndPlatform(name, settings))
2659
+
2660
+
2661
+ def _GetMSBuildProjectConfigurations(configurations):
2662
+ group = ['ItemGroup', {'Label': 'ProjectConfigurations'}]
2663
+ for (name, settings) in sorted(configurations.items()):
2664
+ configuration, platform = _GetConfigurationAndPlatform(name, settings)
2665
+ designation = '%s|%s' % (configuration, platform)
2666
+ group.append(
2667
+ ['ProjectConfiguration', {'Include': designation},
2668
+ ['Configuration', configuration],
2669
+ ['Platform', platform]])
2670
+ return [group]
2671
+
2672
+
2673
+ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
2674
+ namespace = os.path.splitext(gyp_file_name)[0]
2675
+ properties = [
2676
+ ['PropertyGroup', {'Label': 'Globals'},
2677
+ ['ProjectGuid', guid],
2678
+ ['Keyword', 'Win32Proj'],
2679
+ ['RootNamespace', namespace],
2680
+ ['IgnoreWarnCompileDuplicatedFilename', 'true'],
2681
+ ]
2682
+ ]
2683
+
2684
+ if os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or \
2685
+ os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64':
2686
+ properties[0].append(['PreferredToolArchitecture', 'x64'])
2687
+
2688
+ if spec.get('msvs_target_platform_version'):
2689
+ target_platform_version = spec.get('msvs_target_platform_version')
2690
+ properties[0].append(['WindowsTargetPlatformVersion',
2691
+ target_platform_version])
2692
+ if spec.get('msvs_target_platform_minversion'):
2693
+ target_platform_minversion = spec.get('msvs_target_platform_minversion')
2694
+ properties[0].append(['WindowsTargetPlatformMinVersion',
2695
+ target_platform_minversion])
2696
+ else:
2697
+ properties[0].append(['WindowsTargetPlatformMinVersion',
2698
+ target_platform_version])
2699
+
2700
+ if spec.get('msvs_enable_winrt'):
2701
+ properties[0].append(['DefaultLanguage', 'en-US'])
2702
+ properties[0].append(['AppContainerApplication', 'true'])
2703
+ if spec.get('msvs_application_type_revision'):
2704
+ app_type_revision = spec.get('msvs_application_type_revision')
2705
+ properties[0].append(['ApplicationTypeRevision', app_type_revision])
2706
+ else:
2707
+ properties[0].append(['ApplicationTypeRevision', '8.1'])
2708
+ if spec.get('msvs_enable_winphone'):
2709
+ properties[0].append(['ApplicationType', 'Windows Phone'])
2710
+ else:
2711
+ properties[0].append(['ApplicationType', 'Windows Store'])
2712
+
2713
+ platform_name = None
2714
+ msvs_windows_sdk_version = None
2715
+ for configuration in spec['configurations'].values():
2716
+ platform_name = platform_name or _ConfigPlatform(configuration)
2717
+ msvs_windows_sdk_version = (msvs_windows_sdk_version or
2718
+ _ConfigWindowsTargetPlatformVersion(configuration, version))
2719
+ if platform_name and msvs_windows_sdk_version:
2720
+ break
2721
+ if msvs_windows_sdk_version:
2722
+ properties[0].append(['WindowsTargetPlatformVersion',
2723
+ str(msvs_windows_sdk_version)])
2724
+ elif version.compatible_sdks:
2725
+ raise GypError('%s requires any SDK of %s version, but none were found' %
2726
+ (version.description, version.compatible_sdks))
2727
+
2728
+ if platform_name == 'ARM':
2729
+ properties[0].append(['WindowsSDKDesktopARMSupport', 'true'])
2730
+
2731
+ return properties
2732
+
2733
+
2734
+ def _GetMSBuildConfigurationDetails(spec, build_file):
2735
+ properties = {}
2736
+ for name, settings in spec['configurations'].items():
2737
+ msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file)
2738
+ condition = _GetConfigurationCondition(name, settings)
2739
+ character_set = msbuild_attributes.get('CharacterSet')
2740
+ config_type = msbuild_attributes.get('ConfigurationType')
2741
+ _AddConditionalProperty(properties, condition, 'ConfigurationType',
2742
+ config_type)
2743
+ if config_type == 'Driver':
2744
+ _AddConditionalProperty(properties, condition, 'DriverType', 'WDM')
2745
+ _AddConditionalProperty(properties, condition, 'TargetVersion',
2746
+ _ConfigTargetVersion(settings))
2747
+ if character_set:
2748
+ if 'msvs_enable_winrt' not in spec :
2749
+ _AddConditionalProperty(properties, condition, 'CharacterSet',
2750
+ character_set)
2751
+ return _GetMSBuildPropertyGroup(spec, 'Configuration', properties)
2752
+
2753
+
2754
+ def _GetMSBuildLocalProperties(msbuild_toolset):
2755
+ # Currently the only local property we support is PlatformToolset
2756
+ properties = {}
2757
+ if msbuild_toolset:
2758
+ properties = [
2759
+ ['PropertyGroup', {'Label': 'Locals'},
2760
+ ['PlatformToolset', msbuild_toolset],
2761
+ ]
2762
+ ]
2763
+ return properties
2764
+
2765
+
2766
+ def _GetMSBuildPropertySheets(configurations):
2767
+ user_props = r'$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props'
2768
+ additional_props = {}
2769
+ props_specified = False
2770
+ for name, settings in sorted(configurations.items()):
2771
+ configuration = _GetConfigurationCondition(name, settings)
2772
+ if 'msbuild_props' in settings:
2773
+ additional_props[configuration] = _FixPaths(settings['msbuild_props'])
2774
+ props_specified = True
2775
+ else:
2776
+ additional_props[configuration] = ''
2777
+
2778
+ if not props_specified:
2779
+ return [
2780
+ ['ImportGroup',
2781
+ {'Label': 'PropertySheets'},
2782
+ ['Import',
2783
+ {'Project': user_props,
2784
+ 'Condition': "exists('%s')" % user_props,
2785
+ 'Label': 'LocalAppDataPlatform'
2786
+ }
2787
+ ]
2788
+ ]
2789
+ ]
2790
+ else:
2791
+ sheets = []
2792
+ for condition, props in additional_props.items():
2793
+ import_group = [
2794
+ 'ImportGroup',
2795
+ {'Label': 'PropertySheets',
2796
+ 'Condition': condition
2797
+ },
2798
+ ['Import',
2799
+ {'Project': user_props,
2800
+ 'Condition': "exists('%s')" % user_props,
2801
+ 'Label': 'LocalAppDataPlatform'
2802
+ }
2803
+ ]
2804
+ ]
2805
+ for props_file in props:
2806
+ import_group.append(['Import', {'Project':props_file}])
2807
+ sheets.append(import_group)
2808
+ return sheets
2809
+
2810
+ def _ConvertMSVSBuildAttributes(spec, config, build_file):
2811
+ config_type = _GetMSVSConfigurationType(spec, build_file)
2812
+ msvs_attributes = _GetMSVSAttributes(spec, config, config_type)
2813
+ msbuild_attributes = {}
2814
+ for a in msvs_attributes:
2815
+ if a in ['IntermediateDirectory', 'OutputDirectory']:
2816
+ directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a])
2817
+ if not directory.endswith('\\'):
2818
+ directory += '\\'
2819
+ msbuild_attributes[a] = directory
2820
+ elif a == 'CharacterSet':
2821
+ msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a])
2822
+ elif a == 'ConfigurationType':
2823
+ msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a])
2824
+ else:
2825
+ print('Warning: Do not know how to convert MSVS attribute ' + a)
2826
+ return msbuild_attributes
2827
+
2828
+
2829
+ def _ConvertMSVSCharacterSet(char_set):
2830
+ if char_set.isdigit():
2831
+ char_set = {
2832
+ '0': 'MultiByte',
2833
+ '1': 'Unicode',
2834
+ '2': 'MultiByte',
2835
+ }[char_set]
2836
+ return char_set
2837
+
2838
+
2839
+ def _ConvertMSVSConfigurationType(config_type):
2840
+ if config_type.isdigit():
2841
+ config_type = {
2842
+ '1': 'Application',
2843
+ '2': 'DynamicLibrary',
2844
+ '4': 'StaticLibrary',
2845
+ '5': 'Driver',
2846
+ '10': 'Utility'
2847
+ }[config_type]
2848
+ return config_type
2849
+
2850
+
2851
+ def _GetMSBuildAttributes(spec, config, build_file):
2852
+ if 'msbuild_configuration_attributes' not in config:
2853
+ msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file)
2854
+
2855
+ else:
2856
+ config_type = _GetMSVSConfigurationType(spec, build_file)
2857
+ config_type = _ConvertMSVSConfigurationType(config_type)
2858
+ msbuild_attributes = config.get('msbuild_configuration_attributes', {})
2859
+ msbuild_attributes.setdefault('ConfigurationType', config_type)
2860
+ output_dir = msbuild_attributes.get('OutputDirectory',
2861
+ '$(SolutionDir)$(Configuration)')
2862
+ msbuild_attributes['OutputDirectory'] = _FixPath(output_dir) + '\\'
2863
+ if 'IntermediateDirectory' not in msbuild_attributes:
2864
+ intermediate = _FixPath('$(Configuration)') + '\\'
2865
+ msbuild_attributes['IntermediateDirectory'] = intermediate
2866
+ if 'CharacterSet' in msbuild_attributes:
2867
+ msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet(
2868
+ msbuild_attributes['CharacterSet'])
2869
+ if 'TargetName' not in msbuild_attributes:
2870
+ prefix = spec.get('product_prefix', '')
2871
+ product_name = spec.get('product_name', '$(ProjectName)')
2872
+ target_name = prefix + product_name
2873
+ msbuild_attributes['TargetName'] = target_name
2874
+ if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec:
2875
+ ext = spec.get('product_extension')
2876
+ msbuild_attributes['TargetExt'] = '.' + ext
2877
+
2878
+ if spec.get('msvs_external_builder'):
2879
+ external_out_dir = spec.get('msvs_external_builder_out_dir', '.')
2880
+ msbuild_attributes['OutputDirectory'] = _FixPath(external_out_dir) + '\\'
2881
+
2882
+ # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile'
2883
+ # (depending on the tool used) to avoid MSB8012 warning.
2884
+ msbuild_tool_map = {
2885
+ 'executable': 'Link',
2886
+ 'shared_library': 'Link',
2887
+ 'loadable_module': 'Link',
2888
+ 'windows_driver': 'Link',
2889
+ 'static_library': 'Lib',
2890
+ }
2891
+ msbuild_tool = msbuild_tool_map.get(spec['type'])
2892
+ if msbuild_tool:
2893
+ msbuild_settings = config['finalized_msbuild_settings']
2894
+ out_file = msbuild_settings[msbuild_tool].get('OutputFile')
2895
+ if out_file:
2896
+ msbuild_attributes['TargetPath'] = _FixPath(out_file)
2897
+ target_ext = msbuild_settings[msbuild_tool].get('TargetExt')
2898
+ if target_ext:
2899
+ msbuild_attributes['TargetExt'] = target_ext
2900
+
2901
+ return msbuild_attributes
2902
+
2903
+
2904
+ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
2905
+ # TODO(jeanluc) We could optimize out the following and do it only if
2906
+ # there are actions.
2907
+ # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'.
2908
+ new_paths = []
2909
+ cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.'])[0]
2910
+ if cygwin_dirs:
2911
+ cyg_path = '$(MSBuildProjectDirectory)\\%s\\bin\\' % _FixPath(cygwin_dirs)
2912
+ new_paths.append(cyg_path)
2913
+ # TODO(jeanluc) Change the convention to have both a cygwin_dir and a
2914
+ # python_dir.
2915
+ python_path = cyg_path.replace('cygwin\\bin', 'python_26')
2916
+ new_paths.append(python_path)
2917
+ if new_paths:
2918
+ new_paths = '$(ExecutablePath);' + ';'.join(new_paths)
2919
+
2920
+ properties = {}
2921
+ for (name, configuration) in sorted(configurations.items()):
2922
+ condition = _GetConfigurationCondition(name, configuration)
2923
+ attributes = _GetMSBuildAttributes(spec, configuration, build_file)
2924
+ msbuild_settings = configuration['finalized_msbuild_settings']
2925
+ _AddConditionalProperty(properties, condition, 'IntDir',
2926
+ attributes['IntermediateDirectory'])
2927
+ _AddConditionalProperty(properties, condition, 'OutDir',
2928
+ attributes['OutputDirectory'])
2929
+ _AddConditionalProperty(properties, condition, 'TargetName',
2930
+ attributes['TargetName'])
2931
+ if 'TargetExt' in attributes:
2932
+ _AddConditionalProperty(properties, condition, 'TargetExt',
2933
+ attributes['TargetExt'])
2934
+
2935
+ if attributes.get('TargetPath'):
2936
+ _AddConditionalProperty(properties, condition, 'TargetPath',
2937
+ attributes['TargetPath'])
2938
+ if attributes.get('TargetExt'):
2939
+ _AddConditionalProperty(properties, condition, 'TargetExt',
2940
+ attributes['TargetExt'])
2941
+
2942
+ if new_paths:
2943
+ _AddConditionalProperty(properties, condition, 'ExecutablePath',
2944
+ new_paths)
2945
+ tool_settings = msbuild_settings.get('', {})
2946
+ for name, value in sorted(tool_settings.items()):
2947
+ formatted_value = _GetValueFormattedForMSBuild('', name, value)
2948
+ _AddConditionalProperty(properties, condition, name, formatted_value)
2949
+ return _GetMSBuildPropertyGroup(spec, None, properties)
2950
+
2951
+
2952
+ def _AddConditionalProperty(properties, condition, name, value):
2953
+ """Adds a property / conditional value pair to a dictionary.
2954
+
2955
+ Arguments:
2956
+ properties: The dictionary to be modified. The key is the name of the
2957
+ property. The value is itself a dictionary; its key is the value and
2958
+ the value a list of condition for which this value is true.
2959
+ condition: The condition under which the named property has the value.
2960
+ name: The name of the property.
2961
+ value: The value of the property.
2962
+ """
2963
+ if name not in properties:
2964
+ properties[name] = {}
2965
+ values = properties[name]
2966
+ if value not in values:
2967
+ values[value] = []
2968
+ conditions = values[value]
2969
+ conditions.append(condition)
2970
+
2971
+
2972
+ # Regex for msvs variable references ( i.e. $(FOO) ).
2973
+ MSVS_VARIABLE_REFERENCE = re.compile(r'\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)')
2974
+
2975
+
2976
+ def _GetMSBuildPropertyGroup(spec, label, properties):
2977
+ """Returns a PropertyGroup definition for the specified properties.
2978
+
2979
+ Arguments:
2980
+ spec: The target project dict.
2981
+ label: An optional label for the PropertyGroup.
2982
+ properties: The dictionary to be converted. The key is the name of the
2983
+ property. The value is itself a dictionary; its key is the value and
2984
+ the value a list of condition for which this value is true.
2985
+ """
2986
+ group = ['PropertyGroup']
2987
+ if label:
2988
+ group.append({'Label': label})
2989
+ num_configurations = len(spec['configurations'])
2990
+ def GetEdges(node):
2991
+ # Use a definition of edges such that user_of_variable -> used_varible.
2992
+ # This happens to be easier in this case, since a variable's
2993
+ # definition contains all variables it references in a single string.
2994
+ edges = set()
2995
+ for value in sorted(properties[node].keys()):
2996
+ # Add to edges all $(...) references to variables.
2997
+ #
2998
+ # Variable references that refer to names not in properties are excluded
2999
+ # These can exist for instance to refer built in definitions like
3000
+ # $(SolutionDir).
3001
+ #
3002
+ # Self references are ignored. Self reference is used in a few places to
3003
+ # append to the default value. I.e. PATH=$(PATH);other_path
3004
+ edges.update(set([v for v in MSVS_VARIABLE_REFERENCE.findall(value)
3005
+ if v in properties and v != node]))
3006
+ return edges
3007
+ properties_ordered = gyp.common.TopologicallySorted(
3008
+ properties.keys(), GetEdges)
3009
+ # Walk properties in the reverse of a topological sort on
3010
+ # user_of_variable -> used_variable as this ensures variables are
3011
+ # defined before they are used.
3012
+ # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG))
3013
+ for name in reversed(properties_ordered):
3014
+ values = properties[name]
3015
+ for value, conditions in sorted(values.items()):
3016
+ if len(conditions) == num_configurations:
3017
+ # If the value is the same all configurations,
3018
+ # just add one unconditional entry.
3019
+ group.append([name, value])
3020
+ else:
3021
+ for condition in conditions:
3022
+ group.append([name, {'Condition': condition}, value])
3023
+ return [group]
3024
+
3025
+
3026
+ def _GetMSBuildToolSettingsSections(spec, configurations):
3027
+ groups = []
3028
+ for (name, configuration) in sorted(configurations.items()):
3029
+ msbuild_settings = configuration['finalized_msbuild_settings']
3030
+ group = ['ItemDefinitionGroup',
3031
+ {'Condition': _GetConfigurationCondition(name, configuration)}
3032
+ ]
3033
+ for tool_name, tool_settings in sorted(msbuild_settings.items()):
3034
+ # Skip the tool named '' which is a holder of global settings handled
3035
+ # by _GetMSBuildConfigurationGlobalProperties.
3036
+ if tool_name:
3037
+ if tool_settings:
3038
+ tool = [tool_name]
3039
+ for name, value in sorted(tool_settings.items()):
3040
+ formatted_value = _GetValueFormattedForMSBuild(tool_name, name,
3041
+ value)
3042
+ tool.append([name, formatted_value])
3043
+ group.append(tool)
3044
+ groups.append(group)
3045
+ return groups
3046
+
3047
+
3048
+ def _FinalizeMSBuildSettings(spec, configuration):
3049
+ if 'msbuild_settings' in configuration:
3050
+ converted = False
3051
+ msbuild_settings = configuration['msbuild_settings']
3052
+ MSVSSettings.ValidateMSBuildSettings(msbuild_settings)
3053
+ else:
3054
+ converted = True
3055
+ msvs_settings = configuration.get('msvs_settings', {})
3056
+ msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings)
3057
+ include_dirs, midl_include_dirs, resource_include_dirs = \
3058
+ _GetIncludeDirs(configuration)
3059
+ libraries = _GetLibraries(spec)
3060
+ library_dirs = _GetLibraryDirs(configuration)
3061
+ out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True)
3062
+ target_ext = _GetOutputTargetExt(spec)
3063
+ defines = _GetDefines(configuration)
3064
+ if converted:
3065
+ # Visual Studio 2010 has TR1
3066
+ defines = [d for d in defines if d != '_HAS_TR1=0']
3067
+ # Warn of ignored settings
3068
+ ignored_settings = ['msvs_tool_files']
3069
+ for ignored_setting in ignored_settings:
3070
+ value = configuration.get(ignored_setting)
3071
+ if value:
3072
+ print('Warning: The automatic conversion to MSBuild does not handle '
3073
+ '%s. Ignoring setting of %s' % (ignored_setting, str(value)))
3074
+
3075
+ defines = [_EscapeCppDefineForMSBuild(d) for d in defines]
3076
+ disabled_warnings = _GetDisabledWarnings(configuration)
3077
+ prebuild = configuration.get('msvs_prebuild')
3078
+ postbuild = configuration.get('msvs_postbuild')
3079
+ def_file = _GetModuleDefinition(spec)
3080
+ precompiled_header = configuration.get('msvs_precompiled_header')
3081
+
3082
+ # Add the information to the appropriate tool
3083
+ # TODO(jeanluc) We could optimize and generate these settings only if
3084
+ # the corresponding files are found, e.g. don't generate ResourceCompile
3085
+ # if you don't have any resources.
3086
+ _ToolAppend(msbuild_settings, 'ClCompile',
3087
+ 'AdditionalIncludeDirectories', include_dirs)
3088
+ _ToolAppend(msbuild_settings, 'Midl',
3089
+ 'AdditionalIncludeDirectories', midl_include_dirs)
3090
+ _ToolAppend(msbuild_settings, 'ResourceCompile',
3091
+ 'AdditionalIncludeDirectories', resource_include_dirs)
3092
+ # Add in libraries, note that even for empty libraries, we want this
3093
+ # set, to prevent inheriting default libraries from the enviroment.
3094
+ _ToolSetOrAppend(msbuild_settings, 'Link', 'AdditionalDependencies',
3095
+ libraries)
3096
+ _ToolAppend(msbuild_settings, 'Link', 'AdditionalLibraryDirectories',
3097
+ library_dirs)
3098
+ if out_file:
3099
+ _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file,
3100
+ only_if_unset=True)
3101
+ if target_ext:
3102
+ _ToolAppend(msbuild_settings, msbuild_tool, 'TargetExt', target_ext,
3103
+ only_if_unset=True)
3104
+ # Add defines.
3105
+ _ToolAppend(msbuild_settings, 'ClCompile',
3106
+ 'PreprocessorDefinitions', defines)
3107
+ _ToolAppend(msbuild_settings, 'ResourceCompile',
3108
+ 'PreprocessorDefinitions', defines)
3109
+ # Add disabled warnings.
3110
+ _ToolAppend(msbuild_settings, 'ClCompile',
3111
+ 'DisableSpecificWarnings', disabled_warnings)
3112
+ # Turn on precompiled headers if appropriate.
3113
+ if precompiled_header:
3114
+ precompiled_header = os.path.split(precompiled_header)[1]
3115
+ _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use')
3116
+ _ToolAppend(msbuild_settings, 'ClCompile',
3117
+ 'PrecompiledHeaderFile', precompiled_header)
3118
+ _ToolAppend(msbuild_settings, 'ClCompile',
3119
+ 'ForcedIncludeFiles', [precompiled_header])
3120
+ else:
3121
+ _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'NotUsing')
3122
+ # Turn off WinRT compilation
3123
+ _ToolAppend(msbuild_settings, 'ClCompile', 'CompileAsWinRT', 'false')
3124
+ # Turn on import libraries if appropriate
3125
+ if spec.get('msvs_requires_importlibrary'):
3126
+ _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'false')
3127
+ # Loadable modules don't generate import libraries;
3128
+ # tell dependent projects to not expect one.
3129
+ if spec['type'] == 'loadable_module':
3130
+ _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'true')
3131
+ # Set the module definition file if any.
3132
+ if def_file:
3133
+ _ToolAppend(msbuild_settings, 'Link', 'ModuleDefinitionFile', def_file)
3134
+ configuration['finalized_msbuild_settings'] = msbuild_settings
3135
+ if prebuild:
3136
+ _ToolAppend(msbuild_settings, 'PreBuildEvent', 'Command', prebuild)
3137
+ if postbuild:
3138
+ _ToolAppend(msbuild_settings, 'PostBuildEvent', 'Command', postbuild)
3139
+
3140
+
3141
+ def _GetValueFormattedForMSBuild(tool_name, name, value):
3142
+ if type(value) == list:
3143
+ # For some settings, VS2010 does not automatically extends the settings
3144
+ # TODO(jeanluc) Is this what we want?
3145
+ if name in ['AdditionalIncludeDirectories',
3146
+ 'AdditionalLibraryDirectories',
3147
+ 'AdditionalOptions',
3148
+ 'DelayLoadDLLs',
3149
+ 'DisableSpecificWarnings',
3150
+ 'PreprocessorDefinitions']:
3151
+ value.append('%%(%s)' % name)
3152
+ # For most tools, entries in a list should be separated with ';' but some
3153
+ # settings use a space. Check for those first.
3154
+ exceptions = {
3155
+ 'ClCompile': ['AdditionalOptions'],
3156
+ 'Link': ['AdditionalOptions'],
3157
+ 'Lib': ['AdditionalOptions']}
3158
+ if tool_name in exceptions and name in exceptions[tool_name]:
3159
+ char = ' '
3160
+ else:
3161
+ char = ';'
3162
+ formatted_value = char.join(
3163
+ [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value])
3164
+ else:
3165
+ formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value)
3166
+ return formatted_value
3167
+
3168
+
3169
+ def _VerifySourcesExist(sources, root_dir):
3170
+ """Verifies that all source files exist on disk.
3171
+
3172
+ Checks that all regular source files, i.e. not created at run time,
3173
+ exist on disk. Missing files cause needless recompilation but no otherwise
3174
+ visible errors.
3175
+
3176
+ Arguments:
3177
+ sources: A recursive list of Filter/file names.
3178
+ root_dir: The root directory for the relative path names.
3179
+ Returns:
3180
+ A list of source files that cannot be found on disk.
3181
+ """
3182
+ missing_sources = []
3183
+ for source in sources:
3184
+ if isinstance(source, MSVSProject.Filter):
3185
+ missing_sources.extend(_VerifySourcesExist(source.contents, root_dir))
3186
+ else:
3187
+ if '$' not in source:
3188
+ full_path = os.path.join(root_dir, source)
3189
+ if not os.path.exists(full_path):
3190
+ missing_sources.append(full_path)
3191
+ return missing_sources
3192
+
3193
+
3194
+ def _GetMSBuildSources(spec, sources, exclusions, rule_dependencies,
3195
+ extension_to_rule_name, actions_spec,
3196
+ sources_handled_by_action, list_excluded):
3197
+ groups = ['none', 'masm', 'midl', 'include', 'compile', 'resource', 'rule',
3198
+ 'rule_dependency']
3199
+ grouped_sources = {}
3200
+ for g in groups:
3201
+ grouped_sources[g] = []
3202
+
3203
+ _AddSources2(spec, sources, exclusions, grouped_sources,
3204
+ rule_dependencies, extension_to_rule_name,
3205
+ sources_handled_by_action, list_excluded)
3206
+ sources = []
3207
+ for g in groups:
3208
+ if grouped_sources[g]:
3209
+ sources.append(['ItemGroup'] + grouped_sources[g])
3210
+ if actions_spec:
3211
+ sources.append(['ItemGroup'] + actions_spec)
3212
+ return sources
3213
+
3214
+
3215
+ def _AddSources2(spec, sources, exclusions, grouped_sources,
3216
+ rule_dependencies, extension_to_rule_name,
3217
+ sources_handled_by_action,
3218
+ list_excluded):
3219
+ extensions_excluded_from_precompile = []
3220
+ for source in sources:
3221
+ if isinstance(source, MSVSProject.Filter):
3222
+ _AddSources2(spec, source.contents, exclusions, grouped_sources,
3223
+ rule_dependencies, extension_to_rule_name,
3224
+ sources_handled_by_action,
3225
+ list_excluded)
3226
+ else:
3227
+ if not source in sources_handled_by_action:
3228
+ detail = []
3229
+ excluded_configurations = exclusions.get(source, [])
3230
+ if len(excluded_configurations) == len(spec['configurations']):
3231
+ detail.append(['ExcludedFromBuild', 'true'])
3232
+ else:
3233
+ for config_name, configuration in sorted(excluded_configurations):
3234
+ condition = _GetConfigurationCondition(config_name, configuration)
3235
+ detail.append(['ExcludedFromBuild',
3236
+ {'Condition': condition},
3237
+ 'true'])
3238
+ # Add precompile if needed
3239
+ for config_name, configuration in spec['configurations'].items():
3240
+ precompiled_source = configuration.get('msvs_precompiled_source', '')
3241
+ if precompiled_source != '':
3242
+ precompiled_source = _FixPath(precompiled_source)
3243
+ if not extensions_excluded_from_precompile:
3244
+ # If the precompiled header is generated by a C source, we must
3245
+ # not try to use it for C++ sources, and vice versa.
3246
+ basename, extension = os.path.splitext(precompiled_source)
3247
+ if extension == '.c':
3248
+ extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx']
3249
+ else:
3250
+ extensions_excluded_from_precompile = ['.c']
3251
+
3252
+ if precompiled_source == source:
3253
+ condition = _GetConfigurationCondition(config_name, configuration)
3254
+ detail.append(['PrecompiledHeader',
3255
+ {'Condition': condition},
3256
+ 'Create'
3257
+ ])
3258
+ else:
3259
+ # Turn off precompiled header usage for source files of a
3260
+ # different type than the file that generated the
3261
+ # precompiled header.
3262
+ for extension in extensions_excluded_from_precompile:
3263
+ if source.endswith(extension):
3264
+ detail.append(['PrecompiledHeader', ''])
3265
+ detail.append(['ForcedIncludeFiles', ''])
3266
+
3267
+ group, element = _MapFileToMsBuildSourceType(source, rule_dependencies,
3268
+ extension_to_rule_name)
3269
+ grouped_sources[group].append([element, {'Include': source}] + detail)
3270
+
3271
+
3272
+ def _GetMSBuildProjectReferences(project):
3273
+ references = []
3274
+ if project.dependencies:
3275
+ group = ['ItemGroup']
3276
+ for dependency in project.dependencies:
3277
+ guid = dependency.guid
3278
+ project_dir = os.path.split(project.path)[0]
3279
+ relative_path = gyp.common.RelativePath(dependency.path, project_dir)
3280
+ project_ref = ['ProjectReference',
3281
+ {'Include': relative_path},
3282
+ ['Project', guid],
3283
+ ['ReferenceOutputAssembly', 'false']
3284
+ ]
3285
+ for config in dependency.spec.get('configurations', {}).values():
3286
+ if config.get('msvs_use_library_dependency_inputs', 0):
3287
+ project_ref.append(['UseLibraryDependencyInputs', 'true'])
3288
+ break
3289
+ # If it's disabled in any config, turn it off in the reference.
3290
+ if config.get('msvs_2010_disable_uldi_when_referenced', 0):
3291
+ project_ref.append(['UseLibraryDependencyInputs', 'false'])
3292
+ break
3293
+ group.append(project_ref)
3294
+ references.append(group)
3295
+ return references
3296
+
3297
+
3298
+ def _GenerateMSBuildProject(project, options, version, generator_flags):
3299
+ spec = project.spec
3300
+ configurations = spec['configurations']
3301
+ project_dir, project_file_name = os.path.split(project.path)
3302
+ gyp.common.EnsureDirExists(project.path)
3303
+ # Prepare list of sources and excluded sources.
3304
+ gyp_path = _NormalizedSource(project.build_file)
3305
+ relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
3306
+
3307
+ gyp_file = os.path.split(project.build_file)[1]
3308
+ sources, excluded_sources = _PrepareListOfSources(spec, generator_flags,
3309
+ gyp_file)
3310
+ # Add rules.
3311
+ actions_to_add = {}
3312
+ props_files_of_rules = set()
3313
+ targets_files_of_rules = set()
3314
+ rule_dependencies = set()
3315
+ extension_to_rule_name = {}
3316
+ list_excluded = generator_flags.get('msvs_list_excluded_files', True)
3317
+
3318
+ # Don't generate rules if we are using an external builder like ninja.
3319
+ if not spec.get('msvs_external_builder'):
3320
+ _GenerateRulesForMSBuild(project_dir, options, spec,
3321
+ sources, excluded_sources,
3322
+ props_files_of_rules, targets_files_of_rules,
3323
+ actions_to_add, rule_dependencies,
3324
+ extension_to_rule_name)
3325
+ else:
3326
+ rules = spec.get('rules', [])
3327
+ _AdjustSourcesForRules(rules, sources, excluded_sources, True)
3328
+
3329
+ sources, excluded_sources, excluded_idl = (
3330
+ _AdjustSourcesAndConvertToFilterHierarchy(spec, options,
3331
+ project_dir, sources,
3332
+ excluded_sources,
3333
+ list_excluded, version))
3334
+
3335
+ # Don't add actions if we are using an external builder like ninja.
3336
+ if not spec.get('msvs_external_builder'):
3337
+ _AddActions(actions_to_add, spec, project.build_file)
3338
+ _AddCopies(actions_to_add, spec)
3339
+
3340
+ # NOTE: this stanza must appear after all actions have been decided.
3341
+ # Don't excluded sources with actions attached, or they won't run.
3342
+ excluded_sources = _FilterActionsFromExcluded(
3343
+ excluded_sources, actions_to_add)
3344
+
3345
+ exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
3346
+ actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild(
3347
+ spec, actions_to_add)
3348
+
3349
+ _GenerateMSBuildFiltersFile(project.path + '.filters', sources,
3350
+ rule_dependencies,
3351
+ extension_to_rule_name)
3352
+ missing_sources = _VerifySourcesExist(sources, project_dir)
3353
+
3354
+ for configuration in configurations.values():
3355
+ _FinalizeMSBuildSettings(spec, configuration)
3356
+
3357
+ # Add attributes to root element
3358
+
3359
+ import_default_section = [
3360
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.Default.props'}]]
3361
+ import_cpp_props_section = [
3362
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.props'}]]
3363
+ import_cpp_targets_section = [
3364
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.targets'}]]
3365
+ import_masm_props_section = [
3366
+ ['Import',
3367
+ {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.props'}]]
3368
+ import_masm_targets_section = [
3369
+ ['Import',
3370
+ {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.targets'}]]
3371
+ macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]]
3372
+
3373
+ content = [
3374
+ 'Project',
3375
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003',
3376
+ 'ToolsVersion': version.ProjectVersion(),
3377
+ 'DefaultTargets': 'Build'
3378
+ }]
3379
+
3380
+ content += _GetMSBuildProjectConfigurations(configurations)
3381
+ content += _GetMSBuildGlobalProperties(spec, version, project.guid,
3382
+ project_file_name)
3383
+ content += import_default_section
3384
+ content += _GetMSBuildConfigurationDetails(spec, project.build_file)
3385
+ if spec.get('msvs_enable_winphone'):
3386
+ content += _GetMSBuildLocalProperties('v120_wp81')
3387
+ else:
3388
+ content += _GetMSBuildLocalProperties(project.msbuild_toolset)
3389
+ content += import_cpp_props_section
3390
+ content += import_masm_props_section
3391
+ content += _GetMSBuildExtensions(props_files_of_rules)
3392
+ content += _GetMSBuildPropertySheets(configurations)
3393
+ content += macro_section
3394
+ content += _GetMSBuildConfigurationGlobalProperties(spec, configurations,
3395
+ project.build_file)
3396
+ content += _GetMSBuildToolSettingsSections(spec, configurations)
3397
+ content += _GetMSBuildSources(
3398
+ spec, sources, exclusions, rule_dependencies, extension_to_rule_name,
3399
+ actions_spec, sources_handled_by_action, list_excluded)
3400
+ content += _GetMSBuildProjectReferences(project)
3401
+ content += import_cpp_targets_section
3402
+ content += import_masm_targets_section
3403
+ content += _GetMSBuildExtensionTargets(targets_files_of_rules)
3404
+
3405
+ if spec.get('msvs_external_builder'):
3406
+ content += _GetMSBuildExternalBuilderTargets(spec)
3407
+
3408
+ # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS:
3409
+ # has_run_as = _WriteMSVSUserFile(project.path, version, spec)
3410
+
3411
+ easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True)
3412
+
3413
+ return missing_sources
3414
+
3415
+
3416
+ def _GetMSBuildExternalBuilderTargets(spec):
3417
+ """Return a list of MSBuild targets for external builders.
3418
+
3419
+ The "Build" and "Clean" targets are always generated. If the spec contains
3420
+ 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also
3421
+ be generated, to support building selected C/C++ files.
3422
+
3423
+ Arguments:
3424
+ spec: The gyp target spec.
3425
+ Returns:
3426
+ List of MSBuild 'Target' specs.
3427
+ """
3428
+ build_cmd = _BuildCommandLineForRuleRaw(
3429
+ spec, spec['msvs_external_builder_build_cmd'],
3430
+ False, False, False, False)
3431
+ build_target = ['Target', {'Name': 'Build'}]
3432
+ build_target.append(['Exec', {'Command': build_cmd}])
3433
+
3434
+ clean_cmd = _BuildCommandLineForRuleRaw(
3435
+ spec, spec['msvs_external_builder_clean_cmd'],
3436
+ False, False, False, False)
3437
+ clean_target = ['Target', {'Name': 'Clean'}]
3438
+ clean_target.append(['Exec', {'Command': clean_cmd}])
3439
+
3440
+ targets = [build_target, clean_target]
3441
+
3442
+ if spec.get('msvs_external_builder_clcompile_cmd'):
3443
+ clcompile_cmd = _BuildCommandLineForRuleRaw(
3444
+ spec, spec['msvs_external_builder_clcompile_cmd'],
3445
+ False, False, False, False)
3446
+ clcompile_target = ['Target', {'Name': 'ClCompile'}]
3447
+ clcompile_target.append(['Exec', {'Command': clcompile_cmd}])
3448
+ targets.append(clcompile_target)
3449
+
3450
+ return targets
3451
+
3452
+
3453
+ def _GetMSBuildExtensions(props_files_of_rules):
3454
+ extensions = ['ImportGroup', {'Label': 'ExtensionSettings'}]
3455
+ for props_file in props_files_of_rules:
3456
+ extensions.append(['Import', {'Project': props_file}])
3457
+ return [extensions]
3458
+
3459
+
3460
+ def _GetMSBuildExtensionTargets(targets_files_of_rules):
3461
+ targets_node = ['ImportGroup', {'Label': 'ExtensionTargets'}]
3462
+ for targets_file in sorted(targets_files_of_rules):
3463
+ targets_node.append(['Import', {'Project': targets_file}])
3464
+ return [targets_node]
3465
+
3466
+
3467
+ def _GenerateActionsForMSBuild(spec, actions_to_add):
3468
+ """Add actions accumulated into an actions_to_add, merging as needed.
3469
+
3470
+ Arguments:
3471
+ spec: the target project dict
3472
+ actions_to_add: dictionary keyed on input name, which maps to a list of
3473
+ dicts describing the actions attached to that input file.
3474
+
3475
+ Returns:
3476
+ A pair of (action specification, the sources handled by this action).
3477
+ """
3478
+ sources_handled_by_action = OrderedSet()
3479
+ actions_spec = []
3480
+ for primary_input, actions in actions_to_add.items():
3481
+ inputs = OrderedSet()
3482
+ outputs = OrderedSet()
3483
+ descriptions = []
3484
+ commands = []
3485
+ for action in actions:
3486
+ inputs.update(OrderedSet(action['inputs']))
3487
+ outputs.update(OrderedSet(action['outputs']))
3488
+ descriptions.append(action['description'])
3489
+ cmd = action['command']
3490
+ # For most actions, add 'call' so that actions that invoke batch files
3491
+ # return and continue executing. msbuild_use_call provides a way to
3492
+ # disable this but I have not seen any adverse effect from doing that
3493
+ # for everything.
3494
+ if action.get('msbuild_use_call', True):
3495
+ cmd = 'call ' + cmd
3496
+ commands.append(cmd)
3497
+ # Add the custom build action for one input file.
3498
+ description = ', and also '.join(descriptions)
3499
+
3500
+ # We can't join the commands simply with && because the command line will
3501
+ # get too long. See also _AddActions: cygwin's setup_env mustn't be called
3502
+ # for every invocation or the command that sets the PATH will grow too
3503
+ # long.
3504
+ command = '\r\n'.join([c + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%'
3505
+ for c in commands])
3506
+ _AddMSBuildAction(spec,
3507
+ primary_input,
3508
+ inputs,
3509
+ outputs,
3510
+ command,
3511
+ description,
3512
+ sources_handled_by_action,
3513
+ actions_spec)
3514
+ return actions_spec, sources_handled_by_action
3515
+
3516
+
3517
+ def _AddMSBuildAction(spec, primary_input, inputs, outputs, cmd, description,
3518
+ sources_handled_by_action, actions_spec):
3519
+ command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd)
3520
+ primary_input = _FixPath(primary_input)
3521
+ inputs_array = _FixPaths(inputs)
3522
+ outputs_array = _FixPaths(outputs)
3523
+ additional_inputs = ';'.join([i for i in inputs_array
3524
+ if i != primary_input])
3525
+ outputs = ';'.join(outputs_array)
3526
+ sources_handled_by_action.add(primary_input)
3527
+ action_spec = ['CustomBuild', {'Include': primary_input}]
3528
+ action_spec.extend(
3529
+ # TODO(jeanluc) 'Document' for all or just if as_sources?
3530
+ [['FileType', 'Document'],
3531
+ ['Command', command],
3532
+ ['Message', description],
3533
+ ['Outputs', outputs]
3534
+ ])
3535
+ if additional_inputs:
3536
+ action_spec.append(['AdditionalInputs', additional_inputs])
3537
+ actions_spec.append(action_spec)