Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

gyp: candor_gyp

  • Loading branch information...
commit 7a7a5dca92edc11c7695cb1676f32b6c8e808183 1 parent 4d9d23e
Fedor Indutny authored
Showing with 499 additions and 7,028 deletions.
  1. +1 −0  .gitignore
  2. +9 −10 Makefile
  3. +0 −8 candor.gyp
  4. +48 −0 candor_gyp
  5. 0  common.gyp → common.gypi
  6. +0 −2  test/test.gyp
  7. +1 −3 tools/gyp/gyptest.py
  8. +12 −10 tools/gyp/pylib/gyp/MSVSNew.py
  9. +0 −13 tools/gyp/pylib/gyp/MSVSVersion.py
  10. +10 −22 tools/gyp/pylib/gyp/__init__.py
  11. +6 −18 tools/gyp/pylib/gyp/common.py
  12. +0 −27 tools/gyp/pylib/gyp/common_test.py
  13. +5 −20 tools/gyp/pylib/gyp/generator/android.py
  14. +2 −29 tools/gyp/pylib/gyp/generator/dump_dependency_json.py
  15. +52 −60 tools/gyp/pylib/gyp/generator/make.py
  16. +10 −36 tools/gyp/pylib/gyp/generator/msvs.py
  17. +2 −4 tools/gyp/pylib/gyp/generator/msvs_test.py
  18. +63 −140 tools/gyp/pylib/gyp/generator/ninja.py
  19. +0 −25 tools/gyp/pylib/gyp/generator/scons.py
  20. +0 −19 tools/gyp/pylib/gyp/generator/xcode.py
  21. +139 −317 tools/gyp/pylib/gyp/input.py
  22. +2 −3 tools/gyp/pylib/gyp/mac_tool.py
  23. +0 −18 tools/gyp/pylib/gyp/msvs_emulation.py
  24. +8 −7 tools/gyp/pylib/gyp/ninja_syntax.py
  25. +68 −0 tools/gyp/pylib/gyp/system_test.py
  26. +22 −21 tools/gyp/pylib/gyp/win_tool.py
  27. +0 −21 tools/gyp/pylib/gyp/xcode_emulation.py
  28. +39 −74 tools/gyp/pylib/gyp/xcodeproj_file.py
  29. +0 −23 tools/gyp/test/actions-bare/gyptest-bare.py
  30. +0 −25 tools/gyp/test/actions-bare/src/bare.gyp
  31. +0 −11 tools/gyp/test/actions-bare/src/bare.py
  32. +0 −72 tools/gyp/test/actions-multiple/gyptest-all.py
  33. +0 −226 tools/gyp/test/actions-multiple/src/actions.gyp
  34. +0 −9 tools/gyp/test/actions-multiple/src/copy.py
  35. +0 −12 tools/gyp/test/actions-multiple/src/filter.py
  36. +0 −11 tools/gyp/test/actions-multiple/src/foo.c
  37. +0 −1  tools/gyp/test/actions-multiple/src/input.txt
  38. +0 −22 tools/gyp/test/actions-multiple/src/main.c
  39. +0 −26 tools/gyp/test/actions-none/gyptest-none.py
  40. +0 −12 tools/gyp/test/actions-none/src/fake_cross.py
  41. +0 −1  tools/gyp/test/actions-none/src/foo.cc
  42. +0 −35 tools/gyp/test/actions-none/src/none_with_source_files.gyp
  43. +0 −26 tools/gyp/test/actions-subdir/gyptest-action.py
  44. +0 −11 tools/gyp/test/actions-subdir/src/make-file.py
  45. +0 −31 tools/gyp/test/actions-subdir/src/none.gyp
  46. +0 −11 tools/gyp/test/actions-subdir/src/subdir/make-subdir-file.py
  47. +0 −28 tools/gyp/test/actions-subdir/src/subdir/subdir.gyp
  48. +0 −102 tools/gyp/test/actions/gyptest-all.py
  49. +0 −69 tools/gyp/test/actions/gyptest-default.py
  50. +0 −24 tools/gyp/test/actions/gyptest-errors.py
  51. +0 −24 tools/gyp/test/actions/src/action_missing_name.gyp
  52. +0 −114 tools/gyp/test/actions/src/actions.gyp
  53. +0 −21 tools/gyp/test/actions/src/confirm-dep-files.py
  54. +0 −46 tools/gyp/test/actions/src/subdir1/counter.py
  55. +0 −74 tools/gyp/test/actions/src/subdir1/executable.gyp
  56. +0 −20 tools/gyp/test/actions/src/subdir1/make-prog1.py
  57. +0 −20 tools/gyp/test/actions/src/subdir1/make-prog2.py
  58. +0 −12 tools/gyp/test/actions/src/subdir1/program.c
  59. +0 −11 tools/gyp/test/actions/src/subdir2/make-file.py
  60. +0 −33 tools/gyp/test/actions/src/subdir2/none.gyp
  61. +0 −21 tools/gyp/test/actions/src/subdir3/generate_main.py
  62. +0 −29 tools/gyp/test/actions/src/subdir3/null_input.gyp
  63. +0 −56 tools/gyp/test/additional-targets/gyptest-additional.py
  64. +0 −13 tools/gyp/test/additional-targets/src/all.gyp
  65. +0 −56 tools/gyp/test/additional-targets/src/dir1/actions.gyp
  66. +0 −11 tools/gyp/test/additional-targets/src/dir1/emit.py
  67. +0 −6 tools/gyp/test/additional-targets/src/dir1/lib1.c
  68. +0 −31 tools/gyp/test/assembly/gyptest-assembly.py
  69. +0 −4 tools/gyp/test/assembly/src/as.bat
  70. +0 −62 tools/gyp/test/assembly/src/assembly.gyp
  71. +0 −15 tools/gyp/test/assembly/src/lib1.S
  72. +0 −3  tools/gyp/test/assembly/src/lib1.c
  73. +0 −12 tools/gyp/test/assembly/src/program.c
  74. +0 −22 tools/gyp/test/build-option/gyptest-build.py
  75. +0 −13 tools/gyp/test/build-option/hello.c
  76. +0 −15 tools/gyp/test/build-option/hello.gyp
  77. +0 −85 tools/gyp/test/builddir/gyptest-all.py
  78. +0 −85 tools/gyp/test/builddir/gyptest-default.py
  79. +0 −21 tools/gyp/test/builddir/src/builddir.gypi
  80. +0 −6 tools/gyp/test/builddir/src/func1.c
  81. +0 −6 tools/gyp/test/builddir/src/func2.c
  82. +0 −6 tools/gyp/test/builddir/src/func3.c
  83. +0 −6 tools/gyp/test/builddir/src/func4.c
  84. +0 −6 tools/gyp/test/builddir/src/func5.c
  85. +0 −10 tools/gyp/test/builddir/src/prog1.c
  86. +0 −30 tools/gyp/test/builddir/src/prog1.gyp
  87. +0 −10 tools/gyp/test/builddir/src/subdir2/prog2.c
  88. +0 −19 tools/gyp/test/builddir/src/subdir2/prog2.gyp
  89. +0 −10 tools/gyp/test/builddir/src/subdir2/subdir3/prog3.c
  90. +0 −19 tools/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp
  91. +0 −10 tools/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c
  92. +0 −19 tools/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp
  93. +0 −10 tools/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c
  94. +0 −19 tools/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp
  95. +0 −15 tools/gyp/test/cflags/cflags.c
  96. +0 −16 tools/gyp/test/cflags/cflags.gyp
  97. +0 −65 tools/gyp/test/cflags/gyptest-cflags.py
  98. +0 −29 tools/gyp/test/compilable/gyptest-headers.py
  99. +0 −26 tools/gyp/test/compilable/src/headers.gyp
  100. +0 −7 tools/gyp/test/compilable/src/lib1.cpp
  101. +0 −6 tools/gyp/test/compilable/src/lib1.hpp
  102. +0 −9 tools/gyp/test/compilable/src/program.cpp
  103. +0 −34 tools/gyp/test/compiler-override/compiler-global-settings.gyp.in
  104. +0 −17 tools/gyp/test/compiler-override/compiler-host.gyp
  105. +0 −16 tools/gyp/test/compiler-override/compiler.gyp
  106. +0 −7 tools/gyp/test/compiler-override/cxxtest.cc
  107. +0 −55 tools/gyp/test/compiler-override/gyptest-compiler-env.py
  108. +0 −52 tools/gyp/test/compiler-override/gyptest-compiler-global-settings.py
  109. +0 −6 tools/gyp/test/compiler-override/my_cc.py
  110. +0 −6 tools/gyp/test/compiler-override/my_cxx.py
  111. +0 −6 tools/gyp/test/compiler-override/my_ld.py
  112. +0 −7 tools/gyp/test/compiler-override/test.c
  113. +0 −15 tools/gyp/test/configurations/basics/configurations.c
  114. +0 −32 tools/gyp/test/configurations/basics/configurations.gyp
  115. +0 −29 tools/gyp/test/configurations/basics/gyptest-configurations.py
  116. +0 −21 tools/gyp/test/configurations/inheritance/configurations.c
  117. +0 −40 tools/gyp/test/configurations/inheritance/configurations.gyp
  118. +0 −33 tools/gyp/test/configurations/inheritance/gyptest-inheritance.py
  119. +0 −18 tools/gyp/test/configurations/invalid/actions.gyp
  120. +0 −18 tools/gyp/test/configurations/invalid/all_dependent_settings.gyp
  121. +0 −18 tools/gyp/test/configurations/invalid/configurations.gyp
  122. +0 −18 tools/gyp/test/configurations/invalid/dependencies.gyp
  123. +0 −18 tools/gyp/test/configurations/invalid/direct_dependent_settings.gyp
  124. +0 −39 tools/gyp/test/configurations/invalid/gyptest-configurations.py
  125. +0 −18 tools/gyp/test/configurations/invalid/libraries.gyp
  126. +0 −18 tools/gyp/test/configurations/invalid/link_settings.gyp
  127. +0 −18 tools/gyp/test/configurations/invalid/sources.gyp
  128. +0 −17 tools/gyp/test/configurations/invalid/standalone_static_library.gyp
  129. +0 −18 tools/gyp/test/configurations/invalid/target_name.gyp
  130. +0 −18 tools/gyp/test/configurations/invalid/type.gyp
  131. +0 −58 tools/gyp/test/configurations/target_platform/configurations.gyp
  132. +0 −8 tools/gyp/test/configurations/target_platform/front.c
  133. +0 −40 tools/gyp/test/configurations/target_platform/gyptest-target_platform.py
  134. +0 −3  tools/gyp/test/configurations/target_platform/left.c
  135. +0 −3  tools/gyp/test/configurations/target_platform/right.c
  136. +0 −12 tools/gyp/test/configurations/x64/configurations.c
  137. +0 −38 tools/gyp/test/configurations/x64/configurations.gyp
  138. +0 −31 tools/gyp/test/configurations/x64/gyptest-x86.py
  139. +0 −40 tools/gyp/test/copies/gyptest-all.py
  140. +0 −40 tools/gyp/test/copies/gyptest-default.py
  141. +0 −38 tools/gyp/test/copies/gyptest-slash.py
  142. +0 −23 tools/gyp/test/copies/gyptest-updir.py
  143. +0 −36 tools/gyp/test/copies/src/copies-slash.gyp
  144. +0 −21 tools/gyp/test/copies/src/copies-updir.gyp
  145. +0 −70 tools/gyp/test/copies/src/copies.gyp
  146. +0 −1  tools/gyp/test/copies/src/directory/file3
  147. +0 −1  tools/gyp/test/copies/src/directory/file4
  148. +0 −1  tools/gyp/test/copies/src/directory/subdir/file5
  149. +0 −1  tools/gyp/test/copies/src/file1
  150. +0 −1  tools/gyp/test/copies/src/file2
  151. +0 −1  tools/gyp/test/copies/src/parentdir/subdir/file6
  152. +0 −18 tools/gyp/test/custom-generator/gyptest-custom-generator.py
  153. +0 −14 tools/gyp/test/custom-generator/mygenerator.py
  154. +0 −15 tools/gyp/test/custom-generator/test.gyp
  155. +0 −15 tools/gyp/test/cxxflags/cxxflags.cc
  156. +0 −16 tools/gyp/test/cxxflags/cxxflags.gyp
  157. +0 −65 tools/gyp/test/cxxflags/gyptest-cxxflags.py
  158. +0 −11 tools/gyp/test/defines-escaping/defines-escaping.c
  159. +0 −19 tools/gyp/test/defines-escaping/defines-escaping.gyp
  160. +0 −184 tools/gyp/test/defines-escaping/gyptest-defines-escaping.py
  161. +0 −22 tools/gyp/test/defines/defines-env.gyp
  162. +0 −23 tools/gyp/test/defines/defines.c
  163. +0 −38 tools/gyp/test/defines/defines.gyp
  164. +0 −34 tools/gyp/test/defines/gyptest-define-override.py
  165. +0 −51 tools/gyp/test/defines/gyptest-defines-env-regyp.py
  166. +0 −85 tools/gyp/test/defines/gyptest-defines-env.py
  167. +0 −27 tools/gyp/test/defines/gyptest-defines.py
  168. +0 −9 tools/gyp/test/dependencies/a.c
  169. +0 −3  tools/gyp/test/dependencies/b/b.c
  170. +0 −22 tools/gyp/test/dependencies/b/b.gyp
  171. +0 −9 tools/gyp/test/dependencies/b/b3.c
  172. +0 −4 tools/gyp/test/dependencies/c/c.c
  173. +0 −22 tools/gyp/test/dependencies/c/c.gyp
  174. +0 −3  tools/gyp/test/dependencies/c/d.c
  175. +0 −23 tools/gyp/test/dependencies/double_dependency.gyp
  176. +0 −12 tools/gyp/test/dependencies/double_dependent.gyp
  177. +0 −18 tools/gyp/test/dependencies/extra_targets.gyp
  178. +0 −19 tools/gyp/test/dependencies/gyptest-double-dependency.py
  179. +0 −21 tools/gyp/test/dependencies/gyptest-extra-targets.py
  180. +0 −39 tools/gyp/test/dependencies/gyptest-lib-only.py
  181. +0 −25 tools/gyp/test/dependencies/gyptest-none-traversal.py
  182. +0 −16 tools/gyp/test/dependencies/lib_only.gyp
  183. +0 −14 tools/gyp/test/dependencies/main.c
  184. +0 −46 tools/gyp/test/dependencies/none_traversal.gyp
  185. +0 −26 tools/gyp/test/dependency-copy/gyptest-copy.py
  186. +0 −25 tools/gyp/test/dependency-copy/src/copies.gyp
  187. +0 −7 tools/gyp/test/dependency-copy/src/file1.c
  188. +0 −7 tools/gyp/test/dependency-copy/src/file2.c
  189. +0 −13 tools/gyp/test/errors/duplicate_basenames.gyp
  190. +0 −12 tools/gyp/test/errors/duplicate_node.gyp
  191. +0 −22 tools/gyp/test/errors/duplicate_rule.gyp
  192. +0 −14 tools/gyp/test/errors/duplicate_targets.gyp
  193. +0 −49 tools/gyp/test/errors/gyptest-errors.py
  194. +0 −15 tools/gyp/test/errors/missing_dep.gyp
  195. +0 −8 tools/gyp/test/errors/missing_targets.gyp
  196. +0 −21 tools/gyp/test/escaping/colon/test.gyp
  197. +0 −43 tools/gyp/test/escaping/gyptest-colon.py
  198. +0 −23 tools/gyp/test/exclusion/exclusion.gyp
  199. +0 −22 tools/gyp/test/exclusion/gyptest-exclusion.py
  200. +0 −15 tools/gyp/test/exclusion/hello.c
  201. +0 −35 tools/gyp/test/external-cross-compile/gyptest-cross.py
  202. +0 −1  tools/gyp/test/external-cross-compile/src/bogus1.cc
  203. +0 −1  tools/gyp/test/external-cross-compile/src/bogus2.c
  204. +0 −83 tools/gyp/test/external-cross-compile/src/cross.gyp
  205. +0 −23 tools/gyp/test/external-cross-compile/src/cross_compile.gypi
  206. +0 −18 tools/gyp/test/external-cross-compile/src/fake_cross.py
  207. +0 −16 tools/gyp/test/external-cross-compile/src/program.cc
  208. +0 −1  tools/gyp/test/external-cross-compile/src/test1.cc
  209. +0 −1  tools/gyp/test/external-cross-compile/src/test2.c
  210. +0 −1  tools/gyp/test/external-cross-compile/src/test3.cc
  211. +0 −1  tools/gyp/test/external-cross-compile/src/test4.c
  212. +0 −13 tools/gyp/test/external-cross-compile/src/tochar.py
  213. +0 −16 tools/gyp/test/generator-output/actions/actions.gyp
  214. +0 −4 tools/gyp/test/generator-output/actions/build/README.txt
  215. +0 −4 tools/gyp/test/generator-output/actions/subdir1/actions-out/README.txt
  216. +0 −4 tools/gyp/test/generator-output/actions/subdir1/build/README.txt
  217. +0 −44 tools/gyp/test/generator-output/actions/subdir1/executable.gyp
  218. +0 −20 tools/gyp/test/generator-output/actions/subdir1/make-prog1.py
  219. +0 −20 tools/gyp/test/generator-output/actions/subdir1/make-prog2.py
  220. +0 −12 tools/gyp/test/generator-output/actions/subdir1/program.c
  221. +0 −4 tools/gyp/test/generator-output/actions/subdir2/actions-out/README.txt
  222. +0 −4 tools/gyp/test/generator-output/actions/subdir2/build/README.txt
  223. +0 −11 tools/gyp/test/generator-output/actions/subdir2/make-file.py
  224. +0 −31 tools/gyp/test/generator-output/actions/subdir2/none.gyp
  225. +0 −4 tools/gyp/test/generator-output/copies/build/README.txt
  226. +0 −4 tools/gyp/test/generator-output/copies/copies-out/README.txt
  227. +0 −50 tools/gyp/test/generator-output/copies/copies.gyp
  228. +0 −1  tools/gyp/test/generator-output/copies/file1
  229. +0 −1  tools/gyp/test/generator-output/copies/file2
  230. +0 −4 tools/gyp/test/generator-output/copies/subdir/build/README.txt
  231. +0 −4 tools/gyp/test/generator-output/copies/subdir/copies-out/README.txt
  232. +0 −1  tools/gyp/test/generator-output/copies/subdir/file3
  233. +0 −1  tools/gyp/test/generator-output/copies/subdir/file4
  234. +0 −32 tools/gyp/test/generator-output/copies/subdir/subdir.gyp
  235. +0 −58 tools/gyp/test/generator-output/gyptest-actions.py
  236. +0 −59 tools/gyp/test/generator-output/gyptest-copies.py
  237. +0 −29 tools/gyp/test/generator-output/gyptest-mac-bundle.py
  238. +0 −60 tools/gyp/test/generator-output/gyptest-relocate.py
  239. +0 −59 tools/gyp/test/generator-output/gyptest-rules.py
  240. +0 −37 tools/gyp/test/generator-output/gyptest-subdir2-deep.py
  241. +0 −54 tools/gyp/test/generator-output/gyptest-top-all.py
  242. +0 −32 tools/gyp/test/generator-output/mac-bundle/Info.plist
  243. +0 −1  tools/gyp/test/generator-output/mac-bundle/app.order
  244. +0 −1  tools/gyp/test/generator-output/mac-bundle/header.h
  245. +0 −1  tools/gyp/test/generator-output/mac-bundle/main.c
  246. +0 −1  tools/gyp/test/generator-output/mac-bundle/resource.sb
  247. +0 −25 tools/gyp/test/generator-output/mac-bundle/test.gyp
  248. +0 −4 tools/gyp/test/generator-output/rules/build/README.txt
  249. +0 −12 tools/gyp/test/generator-output/rules/copy-file.py
  250. +0 −16 tools/gyp/test/generator-output/rules/rules.gyp
  251. +0 −4 tools/gyp/test/generator-output/rules/subdir1/build/README.txt
  252. +0 −1  tools/gyp/test/generator-output/rules/subdir1/define3.in0
  253. +0 −1  tools/gyp/test/generator-output/rules/subdir1/define4.in0
  254. +0 −59 tools/gyp/test/generator-output/rules/subdir1/executable.gyp
  255. +0 −6 tools/gyp/test/generator-output/rules/subdir1/function1.in1
  256. +0 −6 tools/gyp/test/generator-output/rules/subdir1/function2.in1
  257. +0 −18 tools/gyp/test/generator-output/rules/subdir1/program.c
  258. +0 −4 tools/gyp/test/generator-output/rules/subdir2/build/README.txt
  259. +0 −1  tools/gyp/test/generator-output/rules/subdir2/file1.in0
  260. +0 −1  tools/gyp/test/generator-output/rules/subdir2/file2.in0
  261. +0 −1  tools/gyp/test/generator-output/rules/subdir2/file3.in1
  262. +0 −1  tools/gyp/test/generator-output/rules/subdir2/file4.in1
  263. +0 −49 tools/gyp/test/generator-output/rules/subdir2/none.gyp
  264. +0 −4 tools/gyp/test/generator-output/rules/subdir2/rules-out/README.txt
  265. +0 −4 tools/gyp/test/generator-output/src/build/README.txt
  266. +0 −1  tools/gyp/test/generator-output/src/inc.h
  267. +0 −1  tools/gyp/test/generator-output/src/inc1/include1.h
  268. +0 −18 tools/gyp/test/generator-output/src/prog1.c
  269. +0 −28 tools/gyp/test/generator-output/src/prog1.gyp
  270. +0 −4 tools/gyp/test/generator-output/src/subdir2/build/README.txt
  271. +0 −4 tools/gyp/test/generator-output/src/subdir2/deeper/build/README.txt
  272. +0 −7 tools/gyp/test/generator-output/src/subdir2/deeper/deeper.c
  273. +0 −18 tools/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp
  274. +0 −1  tools/gyp/test/generator-output/src/subdir2/deeper/deeper.h
  275. +0 −1  tools/gyp/test/generator-output/src/subdir2/inc2/include2.h
  276. +0 −18 tools/gyp/test/generator-output/src/subdir2/prog2.c
  277. +0 −28 tools/gyp/test/generator-output/src/subdir2/prog2.gyp
  278. +0 −4 tools/gyp/test/generator-output/src/subdir3/build/README.txt
  279. +0 −1  tools/gyp/test/generator-output/src/subdir3/inc3/include3.h
  280. +0 −18 tools/gyp/test/generator-output/src/subdir3/prog3.c
  281. +0 −25 tools/gyp/test/generator-output/src/subdir3/prog3.gyp
  282. +0 −16 tools/gyp/test/generator-output/src/symroot.gypi
  283. +0 −26 tools/gyp/test/gyp-defines/defines.gyp
  284. +0 −11 tools/gyp/test/gyp-defines/echo.py
  285. +0 −34 tools/gyp/test/gyp-defines/gyptest-multiple-values.py
  286. +0 −40 tools/gyp/test/gyp-defines/gyptest-regyp.py
  287. +0 −37 tools/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py
  288. +0 −36 tools/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py
  289. +0 −9 tools/gyp/test/hard_dependency/src/a.c
  290. +0 −12 tools/gyp/test/hard_dependency/src/a.h
  291. +0 −9 tools/gyp/test/hard_dependency/src/b.c
  292. +0 −12 tools/gyp/test/hard_dependency/src/b.h
  293. +0 −10 tools/gyp/test/hard_dependency/src/c.c
  294. +0 −10 tools/gyp/test/hard_dependency/src/c.h
  295. +0 −9 tools/gyp/test/hard_dependency/src/d.c
  296. +0 −11 tools/gyp/test/hard_dependency/src/emit.py
  297. +0 −78 tools/gyp/test/hard_dependency/src/hard_dependency.gyp
  298. +0 −24 tools/gyp/test/hello/gyptest-all.py
  299. +0 −24 tools/gyp/test/hello/gyptest-default.py
  300. +0 −32 tools/gyp/test/hello/gyptest-disable-regyp.py
Sorry, we could not display the entire diff because too many files (987) changed.
1  .gitignore
View
@@ -3,4 +3,5 @@
*.dSYM
/can
/build
+/out
/test-runner
19 Makefile
View
@@ -1,24 +1,23 @@
BUILDTYPE ?= Debug
JOBS ?= 1
-ARCH ?=
+ARCH ?= x64
all: libcandor.a can
build:
- tools/gyp/gyp -Dosx_arch=$(ARCH) --generator-output=build --format=make \
- --depth=. candor.gyp test/test.gyp
+ ./candor_gyp -f make -Dosx_arch=$(ARCH)
libcandor.a: build
- $(MAKE) -j $(JOBS) -C build candor
- ln -sf build/out/$(BUILDTYPE)/libcandor.a libcandor.a
+ $(MAKE) -j $(JOBS) -C out candor
+ ln -sf out/$(BUILDTYPE)/libcandor.a libcandor.a
can: build
- $(MAKE) -j $(JOBS) -C build can
- ln -sf build/out/$(BUILDTYPE)/can can
+ $(MAKE) -j $(JOBS) -C out can
+ ln -sf out/$(BUILDTYPE)/can can
test-runner: build
- $(MAKE) -j $(JOBS) -C build test
- ln -sf build/out/$(BUILDTYPE)/test test-runner
+ $(MAKE) -j $(JOBS) -C out test
+ ln -sf out/$(BUILDTYPE)/test test-runner
test: test-runner can
@./test-runner parser
@@ -44,7 +43,7 @@ test: test-runner can
@./can test/functional/regressions/regr-3.can
clean:
- -rm -rf build
+ -rm -rf out
-rm libcandor.a can test-runner
.PHONY: clean all build test libcandor.a can test-runner
8 candor.gyp
View
@@ -1,6 +1,4 @@
{
- 'includes': [ 'common.gyp' ],
-
'targets': [{
'target_name': 'candor',
'type': 'static_library',
@@ -8,9 +6,6 @@
'include',
'src'
],
- 'cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter',
- '-fPIC', '-fno-strict-aliasing', '-fno-exceptions',
- '-pedantic'],
'sources': [
'src/zone.cc',
'src/api.cc',
@@ -61,9 +56,6 @@
'include',
'src'
],
- 'cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter',
- '-fPIC', '-fno-strict-aliasing', '-fno-exceptions',
- '-pedantic'],
'sources': [
'src/can.cc'
]
48 candor_gyp
View
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+import glob
+import os
+import shlex
+import sys
+
+can_root = os.path.dirname(__file__)
+
+sys.path.insert(0, os.path.join(can_root, 'tools', 'gyp', 'pylib'))
+import gyp
+
+# Directory within which we want all generated files (including Makefiles)
+# to be written.
+output_dir = os.path.join(os.path.abspath(can_root), 'out')
+
+def run_gyp(args):
+ rc = gyp.main(args)
+ if rc != 0:
+ print 'Error running GYP'
+ sys.exit(rc)
+
+if __name__ == '__main__':
+ args = sys.argv[1:]
+
+ args.append(os.path.join(os.path.abspath(can_root), 'candor.gyp'))
+ args.append(os.path.join(os.path.abspath(can_root), 'test/test.gyp'))
+ common_fn = os.path.join(os.path.abspath(can_root), 'common.gypi')
+ options_fn = os.path.join(os.path.abspath(can_root), 'config.gypi')
+
+ if os.path.exists(common_fn):
+ args.extend(['-I', common_fn])
+
+ if os.path.exists(options_fn):
+ args.extend(['-I', options_fn])
+
+ args.append('--depth=' + can_root)
+
+ if 'ninja' not in args:
+ # Tell gyp to write the Makefiles into output_dir
+ args.extend(['--generator-output', output_dir])
+
+ # Tell make to write its output into the same dir
+ args.extend(['-Goutput_dir=' + output_dir])
+
+ args.append('-Dcomponent=static_library')
+ args.append('-Dlibrary=static_library')
+ gyp_args = list(args)
+ run_gyp(gyp_args)
0  common.gyp → common.gypi
View
File renamed without changes
2  test/test.gyp
View
@@ -1,6 +1,4 @@
{
- 'includes': [ '../common.gyp' ],
-
'variables': {
'variables': {
'host_arch%':
4 tools/gyp/gyptest.py
View
@@ -171,9 +171,7 @@ def main(argv=None):
os.chdir(opts.chdir)
if opts.path:
- extra_path = [os.path.abspath(p) for p in opts.path]
- extra_path = os.pathsep.join(extra_path)
- os.environ['PATH'] += os.pathsep + extra_path
+ os.environ['PATH'] += ':' + ':'.join(opts.path)
if not args:
if not opts.all:
22 tools/gyp/pylib/gyp/MSVSNew.py
View
@@ -59,13 +59,7 @@ def MakeGuid(name, seed='msvs_new'):
#------------------------------------------------------------------------------
-class MSVSSolutionEntry(object):
- def __cmp__(self, other):
- # Sort by name then guid (so things are in order on vs2008).
- return cmp((self.name, self.get_guid()), (other.name, other.get_guid()))
-
-
-class MSVSFolder(MSVSSolutionEntry):
+class MSVSFolder(object):
"""Folder in a Visual Studio project or solution."""
def __init__(self, path, name = None, entries = None,
@@ -91,7 +85,7 @@ def __init__(self, path, name = None, entries = None,
self.guid = guid
# Copy passed lists (or set to empty lists)
- self.entries = sorted(list(entries or []))
+ self.entries = list(entries or [])
self.items = list(items or [])
self.entry_type_guid = ENTRY_TYPE_GUIDS['folder']
@@ -106,7 +100,7 @@ def get_guid(self):
#------------------------------------------------------------------------------
-class MSVSProject(MSVSSolutionEntry):
+class MSVSProject(object):
"""Visual Studio project."""
def __init__(self, path, name = None, dependencies = None, guid = None,
@@ -235,7 +229,15 @@ def Write(self, writer=gyp.common.WriteOnDiff):
if isinstance(e, MSVSFolder):
entries_to_check += e.entries
- all_entries = sorted(all_entries)
+ # Sort by name then guid (so things are in order on vs2008).
+ def NameThenGuid(a, b):
+ if a.name < b.name: return -1
+ if a.name > b.name: return 1
+ if a.get_guid() < b.get_guid(): return -1
+ if a.get_guid() > b.get_guid(): return 1
+ return 0
+
+ all_entries = sorted(all_entries, NameThenGuid)
# Open file and print header
f = writer(self.path)
13 tools/gyp/pylib/gyp/MSVSVersion.py
View
@@ -9,7 +9,6 @@
import re
import subprocess
import sys
-import gyp
class VisualStudioVersion(object):
@@ -194,8 +193,6 @@ def _CreateVersion(name, path, sdk_based=False):
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a error.
"""
- if path:
- path = os.path.normpath(path)
versions = {
'2012': VisualStudioVersion('2012',
'Visual Studio 2012',
@@ -267,14 +264,6 @@ def _CreateVersion(name, path, sdk_based=False):
return versions[str(name)]
-def _ConvertToCygpath(path):
- """Convert to cygwin path if we are using cygwin."""
- if sys.platform == 'cygwin':
- p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE)
- path = p.communicate()[0].strip()
- return path
-
-
def _DetectVisualStudioVersions(versions_to_check, force_express):
"""Collect the list of installed visual studio versions.
@@ -305,7 +294,6 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
path = _RegistryGetValue(keys[index], 'InstallDir')
if not path:
continue
- path = _ConvertToCygpath(path)
# Check for full.
full_path = os.path.join(path, 'devenv.exe')
express_path = os.path.join(path, 'vcexpress.exe')
@@ -326,7 +314,6 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
path = _RegistryGetValue(keys[index], version)
if not path:
continue
- path = _ConvertToCygpath(path)
versions.append(_CreateVersion(version_to_year[version] + 'e',
os.path.join(path, '..'), sdk_based=True))
32 tools/gyp/pylib/gyp/__init__.py
View
@@ -12,7 +12,6 @@
import shlex
import sys
import traceback
-from gyp.common import GypError
# Default debug modes for GYP
debug = {}
@@ -45,9 +44,15 @@ def FindBuildFiles():
return build_files
+class GypError(Exception):
+ """Error class representing an error, which is to be presented
+ to the user. The main entry point will catch and display this.
+ """
+ pass
+
+
def Load(build_files, format, default_variables={},
- includes=[], depth='.', params=None, check=False,
- circular_check=True):
+ includes=[], depth='.', params=None, check=False, circular_check=True):
"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
@@ -125,8 +130,7 @@ def Load(build_files, format, default_variables={},
# Process the input specific to this generator.
result = gyp.input.Load(build_files, default_variables, includes[:],
- depth, generator_input_info, check, circular_check,
- params['parallel'])
+ depth, generator_input_info, check, circular_check)
return [generator] + result
def NameValueListToDict(name_value_list):
@@ -313,14 +317,9 @@ def gyp_main(args):
help='do not read options from environment variables')
parser.add_option('--check', dest='check', action='store_true',
help='check format of gyp files')
- parser.add_option('--parallel', action='store_true',
- env_name='GYP_PARALLEL',
- help='Use multiprocessing for speed (experimental)')
parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store',
default=None, metavar='DIR', type='path',
help='directory to use as the root of the source tree')
- parser.add_option('--build', dest='configs', action='append',
- help='configuration for build after project generation')
# --no-circular-check disables the check for circular relationships between
# .gyp files. These relationships should not exist, but they've only been
# observed to be harmful with the Xcode generator. Chromium's .gyp files
@@ -375,9 +374,6 @@ def gyp_main(args):
if g_o:
options.generator_output = g_o
- if not options.parallel and options.use_environment:
- options.parallel = bool(os.environ.get('GYP_PARALLEL'))
-
for mode in options.debug:
gyp.debug[mode] = 1
@@ -488,8 +484,7 @@ def gyp_main(args):
'cwd': os.getcwd(),
'build_files_arg': build_files_arg,
'gyp_binary': sys.argv[0],
- 'home_dot_gyp': home_dot_gyp,
- 'parallel': options.parallel}
+ 'home_dot_gyp': home_dot_gyp}
# Start with the default variables from the command line.
[generator, flat_list, targets, data] = Load(build_files, format,
@@ -507,13 +502,6 @@ def gyp_main(args):
# generate targets in the order specified in flat_list.
generator.GenerateOutput(flat_list, targets, data, params)
- if options.configs:
- valid_configs = targets[flat_list[0]]['configurations'].keys()
- for conf in options.configs:
- if conf not in valid_configs:
- raise GypError('Invalid config specified via --build: %s' % conf)
- generator.PerformBuild(data, options.configs, params)
-
# Done
return 0
24 tools/gyp/pylib/gyp/common.py
View
@@ -27,13 +27,6 @@ def __call__(self, *args):
return result
-class GypError(Exception):
- """Error class representing an error, which is to be presented
- to the user. The main entry point will catch and display this.
- """
- pass
-
-
def ExceptionAppend(e, msg):
"""Append a message to the given exception's message."""
if not e.args:
@@ -368,18 +361,13 @@ def GetFlavor(params):
'cygwin': 'win',
'win32': 'win',
'darwin': 'mac',
+ 'sunos5': 'solaris',
+ 'freebsd7': 'freebsd',
+ 'freebsd8': 'freebsd',
+ 'freebsd9': 'freebsd',
}
-
- if 'flavor' in params:
- return params['flavor']
- if sys.platform in flavors:
- return flavors[sys.platform]
- if sys.platform.startswith('sunos'):
- return 'solaris'
- if sys.platform.startswith('freebsd'):
- return 'freebsd'
-
- return 'linux'
+ flavor = flavors.get(sys.platform, 'linux')
+ return params.get('flavor', flavor)
def CopyTool(flavor, out_path):
27 tools/gyp/pylib/gyp/common_test.py
View
@@ -8,7 +8,6 @@
import gyp.common
import unittest
-import sys
class TestTopologicallySorted(unittest.TestCase):
@@ -41,31 +40,5 @@ def GetEdge(node):
graph.keys(), GetEdge)
-class TestGetFlavor(unittest.TestCase):
- """Test that gyp.common.GetFlavor works as intended"""
- original_platform = ''
-
- def setUp(self):
- self.original_platform = sys.platform
-
- def tearDown(self):
- sys.platform = self.original_platform
-
- def assertFlavor(self, expected, argument, param):
- sys.platform = argument
- self.assertEqual(expected, gyp.common.GetFlavor(param))
-
- def test_platform_default(self):
- self.assertFlavor('freebsd', 'freebsd9' , {})
- self.assertFlavor('freebsd', 'freebsd10', {})
- self.assertFlavor('solaris', 'sunos5' , {});
- self.assertFlavor('solaris', 'sunos' , {});
- self.assertFlavor('linux' , 'linux2' , {});
- self.assertFlavor('linux' , 'linux3' , {});
-
- def test_param(self):
- self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'})
-
-
if __name__ == '__main__':
unittest.main()
25 tools/gyp/pylib/gyp/generator/android.py
View
@@ -38,22 +38,12 @@
'RULE_INPUT_PATH': '$(RULE_SOURCES)',
'RULE_INPUT_EXT': '$(suffix $<)',
'RULE_INPUT_NAME': '$(notdir $<)',
- 'CONFIGURATION_NAME': 'NOT_USED_ON_ANDROID',
}
# Make supports multiple toolsets
generator_supports_multiple_toolsets = True
-# Generator-specific gyp specs.
-generator_additional_non_configuration_keys = [
- # Boolean to declare that this target does not want its name mangled.
- 'android_unmangled_name',
-]
-generator_additional_path_sections = []
-generator_extra_sources_for_rules = []
-
-
SHARED_FOOTER = """\
# "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from
# all the included sub-makefiles. This is just here to clarify.
@@ -163,7 +153,7 @@ def Write(self, qualified_target, base_path, output_filename, spec, configs,
extra_outputs = []
extra_sources = []
- self.android_class = MODULE_CLASSES.get(self.type, 'GYP')
+ self.android_class = MODULE_CLASSES.get(self.type, 'NONE')
self.android_module = self.ComputeAndroidModule(spec)
(self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec)
self.output = self.output_binary = self.ComputeOutput(spec)
@@ -586,10 +576,6 @@ def ComputeAndroidModule(self, spec):
distinguish gyp-generated module names.
"""
- if int(spec.get('android_unmangled_name', 0)):
- assert self.type != 'shared_library' or self.target.startswith('lib')
- return self.target
-
if self.type == 'shared_library':
# For reasons of convention, the Android build system requires that all
# shared library modules are named 'libfoo' when generating -l flags.
@@ -852,11 +838,10 @@ def WriteTarget(self, spec, configs, deps, link_deps, part_of_all):
# Add an alias from the gyp target name to the Android module name. This
# simplifies manual builds of the target, and is required by the test
# framework.
- if self.target != self.android_module:
- self.WriteLn('# Alias gyp target name.')
- self.WriteLn('.PHONY: %s' % self.target)
- self.WriteLn('%s: %s' % (self.target, self.android_module))
- self.WriteLn('')
+ self.WriteLn('# Alias gyp target name.')
+ self.WriteLn('.PHONY: %s' % self.target)
+ self.WriteLn('%s: %s' % (self.target, self.android_module))
+ self.WriteLn('')
# Add the command to trigger build of the target type depending
# on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY
31 tools/gyp/pylib/gyp/generator/dump_dependency_json.py
View
@@ -1,12 +1,10 @@
-# Copyright (c) 2012 Google Inc. All rights reserved.
+# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
-import os
import gyp
import gyp.common
-import gyp.msvs_emulation
import json
import sys
@@ -24,8 +22,7 @@
'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',
'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',
'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',
- 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',
- 'CONFIGURATION_NAME']:
+ 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX']:
generator_default_variables[unused] = ''
@@ -35,30 +32,6 @@ def CalculateVariables(default_variables, params):
default_variables.setdefault(key, val)
default_variables.setdefault('OS', gyp.common.GetFlavor(params))
- flavor = gyp.common.GetFlavor(params)
- if flavor =='win':
- # Copy additional generator configuration data from VS, which is shared
- # by the Windows Ninja generator.
- import gyp.generator.msvs as msvs_generator
- generator_additional_non_configuration_keys = getattr(msvs_generator,
- 'generator_additional_non_configuration_keys', [])
- generator_additional_path_sections = getattr(msvs_generator,
- 'generator_additional_path_sections', [])
-
- # Set a variable so conditions can be based on msvs_version.
- msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)
- default_variables['MSVS_VERSION'] = msvs_version.ShortName()
-
- # To determine processor word size on Windows, in addition to checking
- # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
- # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which
- # contains the actual word size of the system when running thru WOW64).
- if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or
- '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')):
- default_variables['MSVS_OS_BITS'] = 64
- else:
- default_variables['MSVS_OS_BITS'] = 32
-
def CalculateGeneratorInputInfo(params):
"""Calculate the generator specific info that gets fed to input (called by
112 tools/gyp/pylib/gyp/generator/make.py
View
@@ -24,9 +24,9 @@
import os
import re
import sys
-import subprocess
import gyp
import gyp.common
+import gyp.system_test
import gyp.xcode_emulation
from gyp.common import GetEnvironFallback
@@ -125,10 +125,7 @@ def ensure_directory_exists(path):
LINK_COMMANDS_LINUX = """\
quiet_cmd_alink = AR($(TOOLSET)) $@
-cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
-
-quiet_cmd_alink_thin = AR($(TOOLSET)) $@
-cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$^)
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
@@ -161,7 +158,7 @@ def ensure_directory_exists(path):
LINK_COMMANDS_MAC = """\
quiet_cmd_alink = LIBTOOL-STATIC $@
-cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
+cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool -static -o $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
@@ -179,10 +176,7 @@ def ensure_directory_exists(path):
LINK_COMMANDS_ANDROID = """\
quiet_cmd_alink = AR($(TOOLSET)) $@
-cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
-
-quiet_cmd_alink_thin = AR($(TOOLSET)) $@
-cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$^)
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
@@ -268,7 +262,10 @@ def ensure_directory_exists(path):
LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
+ARFLAGS.target ?= %(ARFLAGS.target)s
+# N.B.: the logic of which commands to run should match the computation done
+# in gyp's make.py where ARFLAGS.host etc. is computed.
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= %(CC.host)s
@@ -278,6 +275,7 @@ def ensure_directory_exists(path):
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?=
AR.host ?= %(AR.host)s
+ARFLAGS.host := %(ARFLAGS.host)s
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
@@ -723,12 +721,9 @@ def Write(self, qualified_target, base_path, output_filename, spec, configs,
else:
self.output = self.output_binary = self.ComputeOutput(spec)
- self.is_standalone_static_library = bool(
- spec.get('standalone_static_library', 0))
self._INSTALLABLE_TARGETS = ('executable', 'loadable_module',
'shared_library')
- if (self.is_standalone_static_library or
- self.type in self._INSTALLABLE_TARGETS):
+ if self.type in self._INSTALLABLE_TARGETS:
self.alias = os.path.basename(self.output)
install_path = self._InstallableTargetInstallPath()
else:
@@ -843,7 +838,6 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
actions)
part_of_all: flag indicating this target is part of 'all'
"""
- env = self.GetSortedXcodeEnv()
for action in actions:
name = StringToMakefileVariable('%s_%s' % (self.qualified_target,
action['action_name']))
@@ -864,11 +858,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
extra_mac_bundle_resources += outputs
# Write the actual command.
- action_commands = action['action']
- if self.flavor == 'mac':
- action_commands = [gyp.xcode_emulation.ExpandEnvVars(command, env)
- for command in action_commands]
- command = gyp.common.EncodePOSIXShellList(action_commands)
+ command = gyp.common.EncodePOSIXShellList(action['action'])
if 'message' in action:
self.WriteLn('quiet_cmd_%s = ACTION %s $@' % (name, action['message']))
else:
@@ -917,6 +907,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
"Spaces in action output filenames not supported (%s)" % output)
# See the comment in WriteCopies about expanding env vars.
+ env = self.GetSortedXcodeEnv()
outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs]
inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs]
@@ -942,7 +933,6 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
rules (used to make other pieces dependent on these rules)
part_of_all: flag indicating this target is part of 'all'
"""
- env = self.GetSortedXcodeEnv()
for rule in rules:
name = StringToMakefileVariable('%s_%s' % (self.qualified_target,
rule['rule_name']))
@@ -982,10 +972,6 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
# amount of pain.
actions += ['@touch --no-create $@']
- # See the comment in WriteCopies about expanding env vars.
- outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs]
- inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs]
-
outputs = map(self.Absolutify, outputs)
all_outputs += outputs
# Only write the 'obj' and 'builddir' rules for the "primary" output
@@ -1010,9 +996,6 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
# action, cd_action, and mkdirs get written to a toplevel variable
# called cmd_foo. Toplevel variables can't handle things that change
# per makefile like $(TARGET), so hardcode the target.
- if self.flavor == 'mac':
- action = [gyp.xcode_emulation.ExpandEnvVars(command, env)
- for command in action]
action = gyp.common.EncodePOSIXShellList(action)
action = action.replace('$(TARGET)', self.target)
cd_action = cd_action.replace('$(TARGET)', self.target)
@@ -1066,7 +1049,7 @@ def WriteCopies(self, copies, extra_outputs, part_of_all):
outputs = []
for copy in copies:
for path in copy['files']:
- # Absolutify() may call normpath, and will strip trailing slashes.
+ # Absolutify() calls normpath, stripping trailing slashes.
path = Sourceify(self.Absolutify(path))
filename = os.path.split(path)[1]
output = Sourceify(self.Absolutify(os.path.join(copy['destination'],
@@ -1436,9 +1419,6 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' %
self.toolset)
self.WriteList(ldflags, 'LDFLAGS_%s' % configname)
- if self.flavor == 'mac':
- self.WriteList(self.xcode_settings.GetLibtoolflags(configname),
- 'LIBTOOLFLAGS_%s' % configname)
libraries = spec.get('libraries')
if libraries:
# Remove duplicate entries
@@ -1450,10 +1430,6 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
QuoteSpaces(self.output_binary))
self.WriteLn('%s: LIBS := $(LIBS)' % QuoteSpaces(self.output_binary))
- if self.flavor == 'mac':
- self.WriteLn('%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))' %
- QuoteSpaces(self.output_binary))
-
# Postbuild actions. Like actions, but implicitly depend on the target's
# output.
postbuilds = []
@@ -1541,13 +1517,8 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
for link_dep in link_deps:
assert ' ' not in link_dep, (
"Spaces in alink input filenames not supported (%s)" % link_dep)
- if (self.flavor not in ('mac', 'win') and not
- self.is_standalone_static_library):
- self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
- part_of_all, postbuilds=postbuilds)
- else:
- self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
- postbuilds=postbuilds)
+ self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
+ postbuilds=postbuilds)
elif self.type == 'shared_library':
self.WriteLn('%s: LD_INPUTS := %s' % (
QuoteSpaces(self.output_binary),
@@ -1587,12 +1558,9 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
# 1) They need to install to the build dir or "product" dir.
# 2) They get shortcuts for building (e.g. "make chrome").
# 3) They are part of "make all".
- if (self.type in self._INSTALLABLE_TARGETS or
- self.is_standalone_static_library):
+ if self.type in self._INSTALLABLE_TARGETS:
if self.type == 'shared_library':
file_desc = 'shared library'
- elif self.type == 'static_library':
- file_desc = 'static library'
else:
file_desc = 'executable'
install_path = self._InstallableTargetInstallPath()
@@ -1862,10 +1830,9 @@ def Absolutify(self, path):
"""Convert a subdirectory-relative path into a base-relative path.
Skips over paths that contain variables."""
if '$(' in path:
- # Don't call normpath in this case, as it might collapse the
- # path too aggressively if it features '..'. However it's still
- # important to strip trailing slashes.
- return path.rstrip('/')
+ # path is no existing file in this case, but calling normpath is still
+ # important for trimming trailing slashes.
+ return os.path.normpath(path)
return os.path.normpath(os.path.join(self.path, path))
@@ -1914,15 +1881,39 @@ def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
build_files_args)})
-def PerformBuild(data, configurations, params):
- options = params['options']
- for config in configurations:
- arguments = ['make']
- if options.toplevel_dir and options.toplevel_dir != '.':
- arguments += '-C', options.toplevel_dir
- arguments.append('BUILDTYPE=' + config)
- print 'Building [%s]: %s' % (config, arguments)
- subprocess.check_call(arguments)
+def RunSystemTests(flavor):
+ """Run tests against the system to compute default settings for commands.
+
+ Returns:
+ dictionary of settings matching the block of command-lines used in
+ SHARED_HEADER. E.g. the dictionary will contain a ARFLAGS.target
+ key for the default ARFLAGS for the target ar command.
+ """
+ # Compute flags used for building static archives.
+ # N.B.: this fallback logic should match the logic in SHARED_HEADER.
+ # See comment there for more details.
+ ar_target = GetEnvironFallback(('AR_target', 'AR'), 'ar')
+ cc_target = GetEnvironFallback(('CC_target', 'CC'), 'cc')
+ arflags_target = 'crs'
+ # ar -T enables thin archives on Linux. OS X's ar supports a -T flag, but it
+ # does something useless (it limits filenames in the archive to 15 chars).
+ if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_target,
+ cc_command=cc_target):
+ arflags_target = 'crsT'
+
+ ar_host = os.environ.get('AR_host', 'ar')
+ cc_host = os.environ.get('CC_host', 'gcc')
+ arflags_host = 'crs'
+ # It feels redundant to compute this again given that most builds aren't
+ # cross-compiles, but due to quirks of history CC_host defaults to 'gcc'
+ # while CC_target defaults to 'cc', so the commands really are different
+ # even though they're nearly guaranteed to run the same code underneath.
+ if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_host,
+ cc_command=cc_host):
+ arflags_host = 'crsT'
+
+ return { 'ARFLAGS.target': arflags_target,
+ 'ARFLAGS.host': arflags_host }
def GenerateOutput(target_list, target_dicts, data, params):
@@ -2005,6 +1996,7 @@ def CalculateMakefilePath(build_file, base_name):
'flock': 'lockf',
})
+ header_params.update(RunSystemTests(flavor))
header_params.update({
'CC.target': GetEnvironFallback(('CC_target', 'CC'), '$(CC)'),
'AR.target': GetEnvironFallback(('AR_target', 'AR'), '$(AR)'),
46 tools/gyp/pylib/gyp/generator/msvs.py
View
@@ -18,7 +18,6 @@
import gyp.MSVSToolFile as MSVSToolFile
import gyp.MSVSUserFile as MSVSUserFile
import gyp.MSVSVersion as MSVSVersion
-from gyp.common import GypError
# Regular expression for validating Visual Studio GUIDs. If the GUID
@@ -1027,7 +1026,7 @@ def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
# Get the information for this configuration
include_dirs, resource_include_dirs = _GetIncludeDirs(config)
libraries = _GetLibraries(spec)
- out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False)
+ out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec)
defines = _GetDefines(config)
defines = [_EscapeCppDefineForMSVS(d) for d in defines]
disabled_warnings = _GetDisabledWarnings(config)
@@ -1124,8 +1123,6 @@ def _GetLibraries(spec):
unique_libraries_list = []
for entry in reversed(libraries):
library = re.sub('^\-l', '', entry)
- if not os.path.splitext(library)[1]:
- library += '.lib'
if library not in found:
found.add(library)
unique_libraries_list.append(library)
@@ -1133,7 +1130,7 @@ def _GetLibraries(spec):
return unique_libraries_list
-def _GetOutputFilePathAndTool(spec, msbuild):
+def _GetOutputFilePathAndTool(spec):
"""Returns the path and tool to use for this target.
Figures out the path of the file this spec will create and the name of
@@ -1157,14 +1154,10 @@ def _GetOutputFilePathAndTool(spec, msbuild):
output_file_props = output_file_map.get(spec['type'])
if output_file_props and int(spec.get('msvs_auto_output_file', 1)):
vc_tool, msbuild_tool, out_dir, suffix = output_file_props
- if spec.get('standalone_static_library', 0):
- out_dir = '$(OutDir)'
out_dir = spec.get('product_dir', out_dir)
product_extension = spec.get('product_extension')
if product_extension:
suffix = '.' + product_extension
- elif msbuild:
- suffix = '$(TargetExt)'
prefix = spec.get('product_prefix', '')
product_name = spec.get('product_name', '$(ProjectName)')
out_file = ntpath.join(out_dir, prefix + product_name + suffix)
@@ -1673,7 +1666,7 @@ def _CreateProjectObjects(target_list, target_dicts, options, msvs_version):
build_file = gyp.common.BuildFile(qualified_target)
# Create object for this project.
obj = MSVSNew.MSVSProject(
- proj_path,
+ _FixPath(proj_path),
name=spec['target_name'],
guid=guid,
spec=spec,
@@ -1786,25 +1779,6 @@ def _ShardTargets(target_list, target_dicts):
return (new_target_list, new_target_dicts)
-def PerformBuild(data, configurations, params):
- options = params['options']
- msvs_version = params['msvs_version']
- devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com')
-
- for build_file, build_file_dict in data.iteritems():
- (build_file_root, build_file_ext) = os.path.splitext(build_file)
- if build_file_ext != '.gyp':
- continue
- sln_path = build_file_root + options.suffix + '.sln'
- if options.generator_output:
- sln_path = os.path.join(options.generator_output, sln_path)
-
- for config in configurations:
- arguments = [devenv, sln_path, '/Build', config]
- print 'Building [%s]: %s' % (config, arguments)
- rtn = subprocess.check_call(arguments)
-
-
def GenerateOutput(target_list, target_dicts, data, params):
"""Generate .sln and .vcproj files.
@@ -2597,13 +2571,13 @@ def _GetMSBuildAttributes(spec, config, build_file):
config_type = _GetMSVSConfigurationType(spec, build_file)
config_type = _ConvertMSVSConfigurationType(config_type)
msbuild_attributes = config.get('msbuild_configuration_attributes', {})
- msbuild_attributes.setdefault('ConfigurationType', config_type)
+ msbuild_attributes['ConfigurationType'] = config_type
output_dir = msbuild_attributes.get('OutputDirectory',
- '$(SolutionDir)$(Configuration)')
- msbuild_attributes['OutputDirectory'] = _FixPath(output_dir) + '\\'
+ '$(SolutionDir)$(Configuration)\\')
+ msbuild_attributes['OutputDirectory'] = _FixPath(output_dir)
if 'IntermediateDirectory' not in msbuild_attributes:
- intermediate = _FixPath('$(Configuration)') + '\\'
- msbuild_attributes['IntermediateDirectory'] = intermediate
+ intermediate = '$(Configuration)\\'
+ msbuild_attributes['IntermediateDirectory'] = _FixPath(intermediate)
if 'CharacterSet' in msbuild_attributes:
msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet(
msbuild_attributes['CharacterSet'])
@@ -2780,7 +2754,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings)
include_dirs, resource_include_dirs = _GetIncludeDirs(configuration)
libraries = _GetLibraries(spec)
- out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True)
+ out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec)
defines = _GetDefines(configuration)
if converted:
# Visual Studio 2010 has TR1
@@ -3035,7 +3009,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
extension_to_rule_name)
missing_sources = _VerifySourcesExist(sources, project_dir)
- for configuration in configurations.itervalues():
+ for (_, configuration) in configurations.iteritems():
_FinalizeMSBuildSettings(spec, configuration)
# Add attributes to root element
6 tools/gyp/pylib/gyp/generator/msvs_test.py
View
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-# Copyright (c) 2012 Google Inc. All rights reserved.
+
+# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -26,9 +27,6 @@ def test_GetLibraries(self):
msvs._GetLibraries({'other':'foo', 'libraries': ['a.lib']}),
['a.lib'])
self.assertEqual(
- msvs._GetLibraries({'libraries': ['-la']}),
- ['a.lib'])
- self.assertEqual(
msvs._GetLibraries({'libraries': ['a.lib', 'b.lib', 'c.lib', '-lb.lib',
'-lb.lib', 'd.lib', 'a.lib']}),
['c.lib', 'b.lib', 'd.lib', 'a.lib'])
203 tools/gyp/pylib/gyp/generator/ninja.py
View
@@ -4,16 +4,15 @@
import copy
import hashlib
-import multiprocessing
import os.path
import re
-import signal
import subprocess
import sys
import gyp
import gyp.common
import gyp.msvs_emulation
import gyp.MSVSVersion
+import gyp.system_test
import gyp.xcode_emulation
from gyp.common import GetEnvironFallback
@@ -355,8 +354,7 @@ def WriteCollapsedDependencies(self, name, targets):
self.ninja.newline()
return targets[0]
- def WriteSpec(self, spec, config_name, generator_flags,
- case_sensitive_filesystem):
+ def WriteSpec(self, spec, config_name, generator_flags):
"""The main entry point for NinjaWriter: write the build rules for a spec.
Returns a Target object, which represents the output paths for this spec.
@@ -368,8 +366,6 @@ def WriteSpec(self, spec, config_name, generator_flags,
self.toolset = spec['toolset']
config = spec['configurations'][config_name]
self.target = Target(spec['type'])
- self.is_standalone_static_library = bool(
- spec.get('standalone_static_library', 0))
self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec)
self.xcode_settings = self.msvs_settings = None
@@ -425,8 +421,6 @@ def WriteSpec(self, spec, config_name, generator_flags,
if sources:
pch = None
if self.flavor == 'win':
- gyp.msvs_emulation.VerifyMissingSources(
- sources, self.abs_build_dir, generator_flags, self.GypPathToNinja)
pch = gyp.msvs_emulation.PrecompiledHeader(
self.msvs_settings, config_name, self.GypPathToNinja)
else:
@@ -434,8 +428,7 @@ def WriteSpec(self, spec, config_name, generator_flags,
self.xcode_settings, self.GypPathToNinja,
lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang))
link_deps = self.WriteSources(
- config_name, config, sources, compile_depends_stamp, pch,
- case_sensitive_filesystem)
+ config_name, config, sources, compile_depends_stamp, pch)
# Some actions/rules output 'sources' that are already object files.
link_deps += [self.GypPathToNinja(f)
for f in sources if f.endswith(self.obj_ext)]
@@ -556,8 +549,11 @@ def WriteActions(self, actions, extra_sources, prebuild,
is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action)
if self.flavor == 'win' else False)
args = action['action']
- rule_name, _ = self.WriteNewNinjaRule(name, args, description,
- is_cygwin, env=env)
+ args = [self.msvs_settings.ConvertVSMacros(
+ arg, self.base_to_build, config=self.config_name)
+ for arg in args] if self.flavor == 'win' else args
+ rule_name = self.WriteNewNinjaRule(name, args, description,
+ is_cygwin, env=env)
inputs = [self.GypPathToNinja(i, env) for i in action['inputs']]
if int(action.get('process_outputs_as_sources', False)):
@@ -577,7 +573,6 @@ def WriteActions(self, actions, extra_sources, prebuild,
def WriteRules(self, rules, extra_sources, prebuild,
extra_mac_bundle_resources):
- env = self.GetSortedXcodeEnv()
all_outputs = []
for rule in rules:
# First write out a rule for the rule action.
@@ -593,8 +588,10 @@ def WriteRules(self, rules, extra_sources, prebuild,
('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name)
is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule)
if self.flavor == 'win' else False)
- rule_name, args = self.WriteNewNinjaRule(
- name, args, description, is_cygwin, env=env)
+ args = [self.msvs_settings.ConvertVSMacros(
+ arg, self.base_to_build, config=self.config_name)
+ for arg in args] if self.flavor == 'win' else args
+ rule_name = self.WriteNewNinjaRule(name, args, description, is_cygwin)
# TODO: if the command references the outputs directly, we should
# simplify it to just use $out.
@@ -651,10 +648,10 @@ def cygwin_munge(path):
else:
assert var == None, repr(var)
- inputs = [self.GypPathToNinja(i, env) for i in inputs]
- outputs = [self.GypPathToNinja(o, env) for o in outputs]
+ inputs = map(self.GypPathToNinja, inputs)
+ outputs = map(self.GypPathToNinja, outputs)
extra_bindings.append(('unique_name',
- hashlib.md5(outputs[0]).hexdigest()))
+ re.sub('[^a-zA-Z0-9_]', '_', outputs[0])))
self.ninja.build(outputs, rule_name, self.GypPathToNinja(source),
implicit=inputs,
order_only=prebuild,
@@ -712,7 +709,7 @@ def WriteMacInfoPlist(self, bundle_depends):
bundle_depends.append(out)
def WriteSources(self, config_name, config, sources, predepends,
- precompiled_header, case_sensitive_filesystem):
+ precompiled_header):
"""Write build rules to compile all of |sources|."""
if self.toolset == 'host':
self.ninja.variable('ar', '$ar_host')
@@ -784,10 +781,8 @@ def WriteSources(self, config_name, config, sources, predepends,
obj_ext = self.obj_ext
if ext in ('cc', 'cpp', 'cxx'):
command = 'cxx'
- elif ext == 'c' or (ext == 'S' and self.flavor != 'win'):
+ elif ext == 'c' or (ext in ('s', 'S') and self.flavor != 'win'):
command = 'cc'
- elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files.
- command = 'cc_s'
elif (self.flavor == 'win' and ext == 'asm' and
self.msvs_settings.GetTargetPlatform(config_name) == 'Win32'):
# Asm files only get auto assembled for x86 (not x64).
@@ -807,12 +802,6 @@ def WriteSources(self, config_name, config, sources, predepends,
continue
input = self.GypPathToNinja(source)
output = self.GypPathToUniqueOutput(filename + obj_ext)
- # Ninja's depfile handling gets confused when the case of a filename
- # changes on a case-insensitive file system. To work around that, always
- # convert .o filenames to lowercase on such file systems. See
- # https://github.com/martine/ninja/issues/402 for details.
- if not case_sensitive_filesystem:
- output = output.lower()
implicit = precompiled_header.GetObjDependencies([input], [output])
self.ninja.build(output, command, input,
implicit=[gch for _, _, gch in implicit],
@@ -929,12 +918,10 @@ def WriteLink(self, spec, config_name, config, link_deps):
extra_bindings.append(('lib',
gyp.common.EncodePOSIXShellArgument(output)))
if self.flavor == 'win':
+ self.target.import_lib = output + '.lib'
extra_bindings.append(('dll', output))
- if '/NOENTRY' not in ldflags:
- self.target.import_lib = output + '.lib'
- extra_bindings.append(('implibflag',
- '/IMPLIB:%s' % self.target.import_lib))
- output = [output, self.target.import_lib]
+ extra_bindings.append(('implib', self.target.import_lib))
+ output = [output, self.target.import_lib]
else:
output = [output, output + '.TOC']
@@ -952,21 +939,10 @@ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
self.target.binary = compile_deps
elif spec['type'] == 'static_library':
self.target.binary = self.ComputeOutput(spec)
- variables = []
- postbuild = self.GetPostbuildCommand(
- spec, self.target.binary, self.target.binary)
- if postbuild:
- variables.append(('postbuilds', postbuild))
- if self.xcode_settings:
- variables.append(('libtool_flags',
- self.xcode_settings.GetLibtoolflags(config_name)))
- if (self.flavor not in ('mac', 'win') and not
- self.is_standalone_static_library):
- self.ninja.build(self.target.binary, 'alink_thin', link_deps,
- order_only=compile_deps, variables=variables)
- else:
- self.ninja.build(self.target.binary, 'alink', link_deps,
- order_only=compile_deps, variables=variables)
+ self.ninja.build(self.target.binary, 'alink', link_deps,
+ order_only=compile_deps,
+ variables=[('postbuilds', self.GetPostbuildCommand(
+ spec, self.target.binary, self.target.binary))])
else:
self.WriteLink(spec, config_name, config, link_deps)
return self.target.binary
@@ -1150,7 +1126,7 @@ def ComputeOutput(self, spec, type=None):
elif self.flavor == 'win' and self.toolset == 'target':
type_in_output_root += ['shared_library']
- if type in type_in_output_root or self.is_standalone_static_library:
+ if type in type_in_output_root:
return filename
elif type == 'shared_library':
libdir = 'lib'
@@ -1166,22 +1142,10 @@ def WriteVariableList(self, var, values):
values = []
self.ninja.variable(var, ' '.join(values))
- def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
+ def WriteNewNinjaRule(self, name, args, description, is_cygwin, env={}):
"""Write out a new ninja "rule" statement for a given command.
- Returns the name of the new rule, and a copy of |args| with variables
- expanded."""
-
- if self.flavor == 'win':
- args = [self.msvs_settings.ConvertVSMacros(
- arg, self.base_to_build, config=self.config_name)
- for arg in args]
- description = self.msvs_settings.ConvertVSMacros(
- description, config=self.config_name)
- elif self.flavor == 'mac':
- # |env| is an empty list on non-mac.
- args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args]
- description = gyp.xcode_emulation.ExpandEnvVars(description, env)
+ Returns the name of the new rule."""
# TODO: we shouldn't need to qualify names; we do it because
# currently the ninja rule namespace is global, but it really
@@ -1192,12 +1156,11 @@ def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
rule_name += '.' + name
rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name)
- # Remove variable references, but not if they refer to the magic rule
- # variables. This is not quite right, as it also protects these for
- # actions, not just for rules where they are valid. Good enough.
- protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}' ]
- protect = '(?!' + '|'.join(map(re.escape, protect)) + ')'
- description = re.sub(protect + r'\$', '_', description)
+ args = args[:]
+
+ if self.flavor == 'win':
+ description = self.msvs_settings.ConvertVSMacros(
+ description, config=self.config_name)
# gyp dictates that commands are run from the base directory.
# cd into the directory before running, and adjust paths in
@@ -1219,6 +1182,10 @@ def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
else:
env = self.ComputeExportEnvString(env)
command = gyp.common.EncodePOSIXShellList(args)
+ if env:
+ # If an environment is passed in, variables in the command should be
+ # read from it, instead of from ninja's internal variables.
+ command = ninja_syntax.escape(command)
command = 'cd %s; ' % self.build_to_base + env + command
# GYP rules/actions express being no-ops by not touching their outputs.
@@ -1228,7 +1195,7 @@ def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
rspfile=rspfile, rspfile_content=rspfile_content)
self.ninja.newline()
- return rule_name, args
+ return rule_name
def CalculateVariables(default_variables, params):
@@ -1311,26 +1278,16 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
flavor = gyp.common.GetFlavor(params)
generator_flags = params.get('generator_flags', {})
- # generator_dir: relative path from pwd to where make puts build files.
- # Makes migrating from make to ninja easier, ninja doesn't put anything here.
- generator_dir = os.path.relpath(params['options'].generator_output or '.')
-
- # output_dir: relative path from generator_dir to the build directory.
- output_dir = generator_flags.get('output_dir', 'out')
-
# build_dir: relative path from source root to our output files.
# e.g. "out/Debug"
- build_dir = os.path.normpath(os.path.join(generator_dir,
- output_dir,
- config_name))
+ build_dir = os.path.join(generator_flags.get('output_dir', 'out'),
+ config_name)
toplevel_build = os.path.join(options.toplevel_dir, build_dir)
master_ninja = ninja_syntax.Writer(
OpenOutput(os.path.join(toplevel_build, 'build.ninja')),
width=120)
- case_sensitive_filesystem = not os.path.exists(
- os.path.join(toplevel_build, 'BUILD.NINJA'))
# Put build-time support tools in out/{config_name}.
gyp.common.CopyTool(flavor, toplevel_build)
@@ -1423,6 +1380,8 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
else:
master_ninja.variable('ld_host', flock + ' linker.lock ' + ld_host)
+ if flavor == 'mac':
+ master_ninja.variable('mac_tool', os.path.join('.', 'gyp-mac-tool'))
master_ninja.newline()
if flavor != 'win':
@@ -1433,28 +1392,25 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
'$cflags_pch_c -c $in -o $out'),
depfile='$out.d')
master_ninja.rule(
- 'cc_s',
- description='CC $out',
- command=('$cc $defines $includes $cflags $cflags_c '
- '$cflags_pch_c -c $in -o $out'))
- master_ninja.rule(
'cxx',
description='CXX $out',
command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc '
'$cflags_pch_cc -c $in -o $out'),
depfile='$out.d')
else:
+ # TODO(scottmg): Requires fork of ninja for dependency and linking
+ # support: https://github.com/sgraham/ninja
# Template for compile commands mostly shared between compiling files
# and generating PCH. In the case of PCH, the "output" is specified by /Fp
# rather than /Fo (for object files), but we still need to specify an /Fo
# when compiling PCH.
- cc_template = ('ninja -t msvc -r . -o $out -e $arch '
- '-- '
+ cc_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch '
+ '--command '
'$cc /nologo /showIncludes /FC '
'@$out.rsp '
'$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ')
- cxx_template = ('ninja -t msvc -r . -o $out -e $arch '
- '-- '
+ cxx_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch '
+ '--command '
'$cxx /nologo /showIncludes /FC '
'@$out.rsp '
'$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ')
@@ -1462,28 +1418,28 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
'cc',
description='CC $out',
command=cc_template % {'outspec': '/Fo$out'},
- depfile='$out.d',
+ depfile='$out.dl',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_c')
master_ninja.rule(
'cc_pch',
description='CC PCH $out',
command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'},
- depfile='$out.d',
+ depfile='$out.dl',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_c')
master_ninja.rule(
'cxx',
description='CXX $out',
command=cxx_template % {'outspec': '/Fo$out'},
- depfile='$out.d',
+ depfile='$out.dl',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_cc')
master_ninja.rule(
'cxx_pch',
description='CXX PCH $out',
command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'},
- depfile='$out.d',
+ depfile='$out.dl',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_cc')
master_ninja.rule(
@@ -1510,10 +1466,6 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
master_ninja.rule(
'alink',
description='AR $out',
- command='rm -f $out && $ar rcs $out $in')
- master_ninja.rule(
- 'alink_thin',
- description='AR $out',
command='rm -f $out && $ar rcsT $out $in')
# This allows targets that only need to depend on $lib's API to declare an
@@ -1562,7 +1514,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
rspfile_content='$in_newline $libflags')
dlldesc = 'LINK(DLL) $dll'
dllcmd = ('%s gyp-win-tool link-wrapper $arch '
- '$ld /nologo $implibflag /DLL /OUT:$dll '
+ '$ld /nologo /IMPLIB:$implib /DLL /OUT:$dll '
'/PDB:$dll.pdb @$dll.rsp' % sys.executable)
dllcmd += (' && %s gyp-win-tool manifest-wrapper $arch '
'$mt -nologo -manifest $manifests -out:$dll.manifest' %
@@ -1604,8 +1556,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
'alink',
description='LIBTOOL-STATIC $out, POSTBUILDS',
command='rm -f $out && '
- './gyp-mac-tool filter-libtool libtool $libtool_flags '
- '-static -o $out $in'
+ './gyp-mac-tool filter-libtool libtool -static -o $out $in'
'$postbuilds')
# Record the public interface of $lib in $lib.TOC. See the corresponding
@@ -1656,11 +1607,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
master_ninja.rule(
'mac_tool',
description='MACTOOL $mactool_cmd $in',
- command='$env ./gyp-mac-tool $mactool_cmd $in $out')
+ command='$env $mac_tool $mactool_cmd $in $out')
master_ninja.rule(
'package_framework',
description='PACKAGE FRAMEWORK $out, POSTBUILDS',
- command='./gyp-mac-tool package-framework $out $version$postbuilds '
+ command='$mac_tool package-framework $out $version$postbuilds '
'&& touch $out')
if flavor == 'win':
master_ninja.rule(
@@ -1722,8 +1673,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
flavor, abs_build_dir=abs_build_dir)
master_ninja.subninja(output_file)
- target = writer.WriteSpec(
- spec, config_name, generator_flags, case_sensitive_filesystem)
+ target = writer.WriteSpec(spec, config_name, generator_flags)
if target:
if name != target.FinalOutput() and spec['toolset'] == 'target':
target_short_names.setdefault(name, []).append(target)
@@ -1744,46 +1694,19 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
if all_outputs:
master_ninja.newline()
master_ninja.build('all', 'phony', list(all_outputs))
- master_ninja.default(generator_flags.get('default_target', 'all'))
-
-
-def PerformBuild(data, configurations, params):
- options = params['options']
- for config in configurations:
- builddir = os.path.join(options.toplevel_dir, 'out', config)
- arguments = ['ninja', '-C', builddir]
- print 'Building [%s]: %s' % (config, arguments)
- subprocess.check_call(arguments)
-
-
-def CallGenerateOutputForConfig(arglist):
- # Ignore the interrupt signal so that the parent process catches it and
- # kills all multiprocessing children.
- signal.signal(signal.SIGINT, signal.SIG_IGN)
-
- (target_list, target_dicts, data, params, config_name) = arglist
- GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)
+ master_ninja.default('all')
def GenerateOutput(target_list, target_dicts, data, params):
+ if params['options'].generator_output:
+ raise NotImplementedError, "--generator_output not implemented for ninja"
+
user_config = params.get('generator_flags', {}).get('config', None)
if user_config:
GenerateOutputForConfig(target_list, target_dicts, data, params,
user_config)
else:
config_names = target_dicts[target_list[0]]['configurations'].keys()
- if params['parallel']:
- try:
- pool = multiprocessing.Pool(len(config_names))
- arglists = []
- for config_name in config_names:
- arglists.append(
- (target_list, target_dicts, data, params, config_name))
- pool.map(CallGenerateOutputForConfig, arglists)
- except KeyboardInterrupt, e:
- pool.terminate()
- raise e
- else:
- for config_name in config_names:
- GenerateOutputForConfig(target_list, target_dicts, data, params,
- config_name)
+ for config_name in config_names:
+ GenerateOutputForConfig(target_list, target_dicts, data, params,
+ config_name)
25 tools/gyp/pylib/gyp/generator/scons.py
View
@@ -8,7 +8,6 @@
import os.path
import pprint
import re
-import subprocess
# TODO: remove when we delete the last WriteList() call in this module
@@ -961,30 +960,6 @@ def TargetFilename(target, build_file=None, output_suffix=''):
return output_file
-def PerformBuild(data, configurations, params):
- options = params['options']
-
- # Due to the way we test gyp on the chromium typbots
- # we need to look for 'scons.py' as well as the more common 'scons'
- # TODO(sbc): update the trybots to have a more normal install
- # of scons.
- scons = 'scons'
- paths = os.environ['PATH'].split(os.pathsep)
- for scons_name in ['scons', 'scons.py']:
- for path in paths:
- test_scons = os.path.join(path, scons_name)
- print 'looking for: %s' % test_scons
- if os.path.exists(test_scons):
- print "found scons: %s" % scons
- scons = test_scons
- break
-
- for config in configurations:
- arguments = [scons, '-C', options.toplevel_dir, '--mode=%s' % config]
- print "Building [%s]: %s" % (config, arguments)
- subprocess.check_call(arguments)
-
-
def GenerateOutput(target_list, target_dicts, data, params):
"""
Generates all the output files for the specified targets.
19 tools/gyp/pylib/gyp/generator/xcode.py
View
@@ -587,25 +587,6 @@ def EscapeXCodeArgument(s):
return '"' + s + '"'
-
-def PerformBuild(data, configurations, params):
- options = params['options']
-
- for build_file, build_file_dict in data.iteritems():
- (build_file_root, build_file_ext) = os.path.splitext(build_file)
- if build_file_ext != '.gyp':
- continue
- xcodeproj_path = build_file_root + options.suffix + '.xcodeproj'
- if options.generator_output:
- xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path)
-
- for config in configurations:
- arguments = ['xcodebuild', '-project', xcodeproj_path]
- arguments += ['-configuration', config]
- print "Building [%s]: %s" % (config, arguments)
- subprocess.check_call(arguments)
-
-
def GenerateOutput(target_list, target_dicts, data, params):
options = params['options']
generator_flags = params.get('generator_flags', {})
456 tools/gyp/pylib/gyp/input.py
View
@@ -12,17 +12,12 @@
import compiler
import copy
import gyp.common
-import multiprocessing
import optparse
import os.path
import re
import shlex
-import signal
import subprocess
import sys
-import threading
-import time
-from gyp.common import GypError
# A list of types that are treated as linkable.
@@ -84,7 +79,6 @@ def IsPathSection(section):
'rules',
'run_as',
'sources',
- 'standalone_static_library',
'suppress_wildcard',
'target_name',
'toolset',
@@ -108,7 +102,6 @@ def IsPathSection(section):
'libraries',
'link_settings',
'sources',
- 'standalone_static_library',
'target_name',
'type',
]
@@ -182,9 +175,9 @@ def CheckNode(node, keypath):
assert isinstance(c[n], Const)
key = c[n].getChildren()[0]
if key in dict:
- raise GypError("Key '" + key + "' repeated at level " +
- repr(len(keypath) + 1) + " with key path '" +
- '.'.join(keypath) + "'")
+ raise KeyError, "Key '" + key + "' repeated at level " + \
+ repr(len(keypath) + 1) + " with key path '" + \
+ '.'.join(keypath) + "'"
kp = list(keypath) # Make a copy of the list for descending this node.
kp.append(key)
dict[key] = CheckNode(c[n + 1], kp)
@@ -212,7 +205,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, variables, includes,
if os.path.exists(build_file_path):
build_file_contents = open(build_file_path).read()
else:
- raise GypError("%s not found (cwd: %s)" % (build_file_path, os.getcwd()))
+ raise Exception("%s not found (cwd: %s)" % (build_file_path, os.getcwd()))
build_file_data = None
try:
@@ -336,7 +329,7 @@ def ProcessToolsetsInDict(data):
# a build file that contains targets and is expected to provide a targets dict
# that contains the targets...
def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes,
- depth, check, load_dependencies):
+ depth, check):
# If depth is set, predefine the DEPTH variable to be a relative path from
# this build file's directory to the directory identified by depth.
if depth: