Nuitka-winsvc 2.7.7__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (995) hide show
  1. nuitka/Builtins.py +259 -0
  2. nuitka/BytecodeCaching.py +184 -0
  3. nuitka/Bytecodes.py +109 -0
  4. nuitka/CacheCleanup.py +54 -0
  5. nuitka/Constants.py +425 -0
  6. nuitka/Errors.py +93 -0
  7. nuitka/HardImportRegistry.py +408 -0
  8. nuitka/MainControl.py +1201 -0
  9. nuitka/ModuleRegistry.py +364 -0
  10. nuitka/OptionParsing.py +2473 -0
  11. nuitka/Options.py +2948 -0
  12. nuitka/OutputDirectories.py +201 -0
  13. nuitka/PostProcessing.py +551 -0
  14. nuitka/Progress.py +252 -0
  15. nuitka/PythonFlavors.py +426 -0
  16. nuitka/PythonOperators.py +146 -0
  17. nuitka/PythonVersions.py +513 -0
  18. nuitka/Serialization.py +291 -0
  19. nuitka/SourceCodeReferences.py +176 -0
  20. nuitka/Tracing.py +579 -0
  21. nuitka/TreeXML.py +141 -0
  22. nuitka/Variables.py +515 -0
  23. nuitka/Version.py +88 -0
  24. nuitka/__init__.py +19 -0
  25. nuitka/__main__.py +224 -0
  26. nuitka/__past__.py +217 -0
  27. nuitka/build/Backend.scons +1111 -0
  28. nuitka/build/CCompilerVersion.scons +281 -0
  29. nuitka/build/DataComposerInterface.py +116 -0
  30. nuitka/build/Offsets.scons +626 -0
  31. nuitka/build/Onefile.scons +564 -0
  32. nuitka/build/SconsCaching.py +451 -0
  33. nuitka/build/SconsCompilerSettings.py +1133 -0
  34. nuitka/build/SconsHacks.py +215 -0
  35. nuitka/build/SconsInterface.py +664 -0
  36. nuitka/build/SconsProgress.py +100 -0
  37. nuitka/build/SconsSpawn.py +436 -0
  38. nuitka/build/SconsUtils.py +939 -0
  39. nuitka/build/__init__.py +19 -0
  40. nuitka/build/include/nuitka/allocator.h +450 -0
  41. nuitka/build/include/nuitka/builtins.h +97 -0
  42. nuitka/build/include/nuitka/calling.h +123 -0
  43. nuitka/build/include/nuitka/checkers.h +39 -0
  44. nuitka/build/include/nuitka/checksum_tools.h +28 -0
  45. nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
  46. nuitka/build/include/nuitka/compiled_cell.h +64 -0
  47. nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
  48. nuitka/build/include/nuitka/compiled_frame.h +502 -0
  49. nuitka/build/include/nuitka/compiled_function.h +170 -0
  50. nuitka/build/include/nuitka/compiled_generator.h +287 -0
  51. nuitka/build/include/nuitka/compiled_method.h +54 -0
  52. nuitka/build/include/nuitka/constants.h +251 -0
  53. nuitka/build/include/nuitka/constants_blob.h +34 -0
  54. nuitka/build/include/nuitka/debug_settings.h +60 -0
  55. nuitka/build/include/nuitka/environment_variables.h +30 -0
  56. nuitka/build/include/nuitka/environment_variables_system.h +51 -0
  57. nuitka/build/include/nuitka/exception_groups.h +167 -0
  58. nuitka/build/include/nuitka/exceptions.h +1458 -0
  59. nuitka/build/include/nuitka/filesystem_paths.h +117 -0
  60. nuitka/build/include/nuitka/freelists.h +92 -0
  61. nuitka/build/include/nuitka/hedley.h +1774 -0
  62. nuitka/build/include/nuitka/helper/attributes.h +90 -0
  63. nuitka/build/include/nuitka/helper/boolean.h +86 -0
  64. nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
  65. nuitka/build/include/nuitka/helper/bytes.h +28 -0
  66. nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
  67. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  68. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  69. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  70. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  71. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  72. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  73. nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
  74. nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
  75. nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
  76. nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
  77. nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
  78. nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
  79. nuitka/build/include/nuitka/helper/complex.h +46 -0
  80. nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
  81. nuitka/build/include/nuitka/helper/floats.h +32 -0
  82. nuitka/build/include/nuitka/helper/import_hard.h +121 -0
  83. nuitka/build/include/nuitka/helper/indexes.h +47 -0
  84. nuitka/build/include/nuitka/helper/ints.h +165 -0
  85. nuitka/build/include/nuitka/helper/iterators.h +376 -0
  86. nuitka/build/include/nuitka/helper/lists.h +94 -0
  87. nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
  88. nuitka/build/include/nuitka/helper/mappings.h +39 -0
  89. nuitka/build/include/nuitka/helper/operations.h +114 -0
  90. nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
  91. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
  92. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
  93. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
  94. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
  95. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  96. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
  97. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
  98. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
  99. nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
  100. nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
  101. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
  102. nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
  103. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
  104. nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
  105. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
  106. nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
  107. nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
  108. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
  109. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
  110. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
  111. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
  112. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
  113. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
  114. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
  115. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
  116. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
  117. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
  118. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
  119. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
  120. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
  121. nuitka/build/include/nuitka/helper/raising.h +114 -0
  122. nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
  123. nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
  124. nuitka/build/include/nuitka/helper/sequences.h +33 -0
  125. nuitka/build/include/nuitka/helper/sets.h +25 -0
  126. nuitka/build/include/nuitka/helper/slices.h +314 -0
  127. nuitka/build/include/nuitka/helper/strings.h +30 -0
  128. nuitka/build/include/nuitka/helper/subscripts.h +390 -0
  129. nuitka/build/include/nuitka/helper/tuples.h +187 -0
  130. nuitka/build/include/nuitka/helpers.h +417 -0
  131. nuitka/build/include/nuitka/importing.h +149 -0
  132. nuitka/build/include/nuitka/incbin.h +402 -0
  133. nuitka/build/include/nuitka/jit_sources.h +25 -0
  134. nuitka/build/include/nuitka/prelude.h +626 -0
  135. nuitka/build/include/nuitka/printing.h +84 -0
  136. nuitka/build/include/nuitka/python_pgo.h +57 -0
  137. nuitka/build/include/nuitka/safe_string_ops.h +57 -0
  138. nuitka/build/include/nuitka/threading.h +142 -0
  139. nuitka/build/include/nuitka/tracing.h +82 -0
  140. nuitka/build/include/nuitka/type_aliases.h +30 -0
  141. nuitka/build/include/nuitka/unfreezing.h +91 -0
  142. nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
  143. nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
  144. nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
  145. nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
  146. nuitka/build/inline_copy/bin/scons.py +58 -0
  147. nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
  148. nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
  149. nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
  150. nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
  151. nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
  152. nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
  153. nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
  154. nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
  155. nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
  156. nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
  157. nuitka/build/inline_copy/glob2/LICENSE +27 -0
  158. nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
  159. nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
  160. nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
  161. nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
  162. nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
  163. nuitka/build/inline_copy/jinja2/README.rst +2 -0
  164. nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
  165. nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
  166. nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
  167. nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
  168. nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
  169. nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
  170. nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
  171. nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
  172. nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
  173. nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
  174. nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
  175. nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
  176. nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
  177. nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
  178. nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
  179. nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
  180. nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
  181. nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
  182. nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
  183. nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
  184. nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
  185. nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
  186. nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
  187. nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
  188. nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
  189. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
  190. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
  191. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
  192. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
  193. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
  194. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
  195. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
  196. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
  197. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
  198. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
  199. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
  200. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
  201. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
  202. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
  203. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
  204. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
  205. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
  206. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
  207. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
  208. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
  209. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
  210. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
  211. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
  212. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
  213. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
  214. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
  215. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
  216. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
  217. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
  218. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
  219. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
  220. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
  221. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
  222. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
  223. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
  224. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
  225. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
  226. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
  227. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
  228. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
  229. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
  230. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
  231. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
  232. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
  233. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
  234. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
  235. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
  236. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
  237. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
  238. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
  239. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
  240. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
  241. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
  242. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
  243. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
  244. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
  245. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
  246. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
  247. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
  248. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
  249. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
  250. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
  251. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
  252. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
  253. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
  254. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
  255. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
  256. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
  257. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
  258. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
  259. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
  260. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
  261. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
  262. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
  263. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
  264. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
  265. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
  266. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
  267. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
  268. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
  269. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
  270. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
  271. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
  272. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
  273. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
  274. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
  275. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
  276. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
  277. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
  278. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
  279. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
  280. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
  281. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
  282. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
  283. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
  284. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
  285. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
  286. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
  287. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
  288. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
  289. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
  290. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
  291. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
  292. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
  293. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
  294. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
  295. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
  296. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
  297. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
  298. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
  299. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
  300. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
  301. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
  302. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
  303. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
  304. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
  305. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
  306. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
  307. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
  308. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
  309. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
  310. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
  311. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
  312. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
  313. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
  314. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
  315. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
  316. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
  317. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
  318. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
  319. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
  320. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
  321. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
  322. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
  323. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
  324. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
  325. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
  326. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
  327. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
  328. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
  329. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
  330. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
  331. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
  332. nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
  333. nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
  334. nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
  335. nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
  336. nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
  337. nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
  338. nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
  339. nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
  340. nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
  341. nuitka/build/inline_copy/pefile/pefile.py +8034 -0
  342. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
  343. nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
  344. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  345. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  346. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  347. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  348. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  349. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  350. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  351. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  352. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  353. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  354. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  355. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  356. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  357. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  358. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  359. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  360. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  361. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  362. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  363. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  364. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  365. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  366. nuitka/build/inline_copy/stubgen/six.py +998 -0
  367. nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
  368. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
  369. nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
  370. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
  371. nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
  372. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
  373. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
  374. nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
  375. nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
  376. nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
  377. nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
  378. nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
  379. nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
  380. nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
  381. nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
  382. nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
  383. nuitka/build/inline_copy/yaml/LICENSE +20 -0
  384. nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
  385. nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
  386. nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
  387. nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
  388. nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
  389. nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
  390. nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
  391. nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
  392. nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
  393. nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
  394. nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
  395. nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
  396. nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
  397. nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
  398. nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
  399. nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
  400. nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
  401. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  402. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  403. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  404. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  405. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  406. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  407. nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
  408. nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
  409. nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
  410. nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
  411. nuitka/build/inline_copy/zstd/common/debug.h +107 -0
  412. nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
  413. nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
  414. nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
  415. nuitka/build/inline_copy/zstd/common/fse.h +715 -0
  416. nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
  417. nuitka/build/inline_copy/zstd/common/huf.h +361 -0
  418. nuitka/build/inline_copy/zstd/common/mem.h +426 -0
  419. nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
  420. nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
  421. nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
  422. nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
  423. nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
  424. nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
  425. nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
  426. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
  427. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
  428. nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
  429. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
  430. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
  431. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
  432. nuitka/build/inline_copy/zstd/zstd.h +2391 -0
  433. nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
  434. nuitka/build/static_src/CompiledCellType.c +300 -0
  435. nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
  436. nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
  437. nuitka/build/static_src/CompiledFrameType.c +1337 -0
  438. nuitka/build/static_src/CompiledFunctionType.c +3320 -0
  439. nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
  440. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
  441. nuitka/build/static_src/CompiledMethodType.c +614 -0
  442. nuitka/build/static_src/GenerateHeadersMain.c +30 -0
  443. nuitka/build/static_src/HelpersAllocator.c +939 -0
  444. nuitka/build/static_src/HelpersAttributes.c +1241 -0
  445. nuitka/build/static_src/HelpersBuiltin.c +901 -0
  446. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
  447. nuitka/build/static_src/HelpersBytes.c +107 -0
  448. nuitka/build/static_src/HelpersCalling.c +397 -0
  449. nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
  450. nuitka/build/static_src/HelpersChecksumTools.c +59 -0
  451. nuitka/build/static_src/HelpersClasses.c +91 -0
  452. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  453. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  454. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  455. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  456. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  457. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  458. nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
  459. nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
  460. nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
  461. nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
  462. nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
  463. nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
  464. nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
  465. nuitka/build/static_src/HelpersConsole.c +124 -0
  466. nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
  467. nuitka/build/static_src/HelpersDeepcopy.c +636 -0
  468. nuitka/build/static_src/HelpersDictionaries.c +1739 -0
  469. nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
  470. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  471. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  472. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
  473. nuitka/build/static_src/HelpersExceptions.c +298 -0
  474. nuitka/build/static_src/HelpersFiles.c +353 -0
  475. nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
  476. nuitka/build/static_src/HelpersFloats.c +92 -0
  477. nuitka/build/static_src/HelpersHeapStorage.c +68 -0
  478. nuitka/build/static_src/HelpersImport.c +506 -0
  479. nuitka/build/static_src/HelpersImportHard.c +526 -0
  480. nuitka/build/static_src/HelpersJitSources.c +48 -0
  481. nuitka/build/static_src/HelpersLists.c +899 -0
  482. nuitka/build/static_src/HelpersListsGenerated.c +564 -0
  483. nuitka/build/static_src/HelpersMappings.c +46 -0
  484. nuitka/build/static_src/HelpersMatching.c +192 -0
  485. nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
  486. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
  487. nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
  488. nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
  489. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
  490. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
  491. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
  492. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  493. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
  494. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
  495. nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
  496. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
  497. nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
  498. nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
  499. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
  500. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
  501. nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
  502. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
  503. nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
  504. nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
  505. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
  506. nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
  507. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
  508. nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
  509. nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
  510. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
  511. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
  512. nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
  513. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
  514. nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
  515. nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
  516. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
  517. nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
  518. nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
  519. nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
  520. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
  521. nuitka/build/static_src/HelpersProfiling.c +104 -0
  522. nuitka/build/static_src/HelpersPythonPgo.c +113 -0
  523. nuitka/build/static_src/HelpersRaising.c +447 -0
  524. nuitka/build/static_src/HelpersSafeStrings.c +185 -0
  525. nuitka/build/static_src/HelpersSequences.c +134 -0
  526. nuitka/build/static_src/HelpersSlices.c +73 -0
  527. nuitka/build/static_src/HelpersStrings.c +998 -0
  528. nuitka/build/static_src/HelpersTuples.c +148 -0
  529. nuitka/build/static_src/HelpersTypes.c +329 -0
  530. nuitka/build/static_src/InspectPatcher.c +439 -0
  531. nuitka/build/static_src/MainProgram.c +2060 -0
  532. nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
  533. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
  534. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
  535. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
  536. nuitka/build/static_src/OnefileBootstrap.c +1580 -0
  537. nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
  538. nuitka/code_generation/AsyncgenCodes.py +186 -0
  539. nuitka/code_generation/AttributeCodes.py +357 -0
  540. nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
  541. nuitka/code_generation/BranchCodes.py +67 -0
  542. nuitka/code_generation/BuiltinCodes.py +529 -0
  543. nuitka/code_generation/CallCodes.py +1186 -0
  544. nuitka/code_generation/ClassCodes.py +156 -0
  545. nuitka/code_generation/CodeGeneration.py +1078 -0
  546. nuitka/code_generation/CodeHelperSelection.py +81 -0
  547. nuitka/code_generation/CodeHelpers.py +455 -0
  548. nuitka/code_generation/CodeObjectCodes.py +165 -0
  549. nuitka/code_generation/ComparisonCodes.py +569 -0
  550. nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
  551. nuitka/code_generation/ConditionalCodes.py +236 -0
  552. nuitka/code_generation/ConstantCodes.py +243 -0
  553. nuitka/code_generation/Contexts.py +1248 -0
  554. nuitka/code_generation/CoroutineCodes.py +253 -0
  555. nuitka/code_generation/CtypesCodes.py +46 -0
  556. nuitka/code_generation/DictCodes.py +918 -0
  557. nuitka/code_generation/Emission.py +75 -0
  558. nuitka/code_generation/ErrorCodes.py +281 -0
  559. nuitka/code_generation/EvalCodes.py +444 -0
  560. nuitka/code_generation/ExceptionCodes.py +337 -0
  561. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
  562. nuitka/code_generation/ExpressionCodes.py +61 -0
  563. nuitka/code_generation/FrameCodes.py +518 -0
  564. nuitka/code_generation/FunctionCodes.py +858 -0
  565. nuitka/code_generation/GeneratorCodes.py +218 -0
  566. nuitka/code_generation/GlobalConstants.py +249 -0
  567. nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
  568. nuitka/code_generation/IdCodes.py +53 -0
  569. nuitka/code_generation/ImportCodes.py +468 -0
  570. nuitka/code_generation/Indentation.py +45 -0
  571. nuitka/code_generation/IndexCodes.py +50 -0
  572. nuitka/code_generation/InjectCCodes.py +28 -0
  573. nuitka/code_generation/IntegerCodes.py +110 -0
  574. nuitka/code_generation/IteratorCodes.py +378 -0
  575. nuitka/code_generation/JitCodes.py +44 -0
  576. nuitka/code_generation/LabelCodes.py +68 -0
  577. nuitka/code_generation/LineNumberCodes.py +91 -0
  578. nuitka/code_generation/ListCodes.py +502 -0
  579. nuitka/code_generation/LoaderCodes.py +193 -0
  580. nuitka/code_generation/LocalsDictCodes.py +359 -0
  581. nuitka/code_generation/LoopCodes.py +88 -0
  582. nuitka/code_generation/MatchCodes.py +67 -0
  583. nuitka/code_generation/ModuleCodes.py +247 -0
  584. nuitka/code_generation/Namify.py +260 -0
  585. nuitka/code_generation/NetworkxCodes.py +51 -0
  586. nuitka/code_generation/OperationCodes.py +398 -0
  587. nuitka/code_generation/PackageResourceCodes.py +986 -0
  588. nuitka/code_generation/PrintCodes.py +93 -0
  589. nuitka/code_generation/PythonAPICodes.py +215 -0
  590. nuitka/code_generation/RaisingCodes.py +481 -0
  591. nuitka/code_generation/Reports.py +115 -0
  592. nuitka/code_generation/ReturnCodes.py +143 -0
  593. nuitka/code_generation/SetCodes.py +196 -0
  594. nuitka/code_generation/SliceCodes.py +465 -0
  595. nuitka/code_generation/StringCodes.py +303 -0
  596. nuitka/code_generation/SubscriptCodes.py +263 -0
  597. nuitka/code_generation/TensorflowCodes.py +54 -0
  598. nuitka/code_generation/TryCodes.py +326 -0
  599. nuitka/code_generation/TupleCodes.py +115 -0
  600. nuitka/code_generation/TypeAliasCodes.py +120 -0
  601. nuitka/code_generation/VariableCodes.py +519 -0
  602. nuitka/code_generation/VariableDeclarations.py +279 -0
  603. nuitka/code_generation/YieldCodes.py +253 -0
  604. nuitka/code_generation/__init__.py +19 -0
  605. nuitka/code_generation/c_types/CTypeBases.py +177 -0
  606. nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
  607. nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
  608. nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
  609. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
  610. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
  611. nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
  612. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
  613. nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
  614. nuitka/code_generation/c_types/CTypeVoids.py +92 -0
  615. nuitka/code_generation/c_types/__init__.py +19 -0
  616. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
  617. nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
  618. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
  619. nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
  620. nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
  621. nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
  622. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
  623. nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
  624. nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
  625. nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
  626. nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
  627. nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
  628. nuitka/code_generation/templates/__init__.py +19 -0
  629. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
  630. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
  631. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
  632. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
  633. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
  634. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
  635. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
  636. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
  637. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
  638. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
  639. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
  640. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
  641. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  642. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
  643. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
  644. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  645. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
  646. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
  647. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
  648. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
  649. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
  650. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
  651. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
  652. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
  653. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
  654. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
  655. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
  656. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
  657. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
  658. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
  659. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
  660. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
  661. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
  662. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
  663. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
  664. nuitka/containers/Namedtuples.py +51 -0
  665. nuitka/containers/OrderedDicts.py +191 -0
  666. nuitka/containers/OrderedSets.py +123 -0
  667. nuitka/containers/OrderedSetsFallback.py +139 -0
  668. nuitka/containers/__init__.py +19 -0
  669. nuitka/distutils/Build.py +76 -0
  670. nuitka/distutils/DistutilCommands.py +438 -0
  671. nuitka/distutils/__init__.py +19 -0
  672. nuitka/finalizations/Finalization.py +35 -0
  673. nuitka/finalizations/FinalizeMarkups.py +136 -0
  674. nuitka/finalizations/__init__.py +19 -0
  675. nuitka/freezer/DependsExe.py +257 -0
  676. nuitka/freezer/DllDependenciesCommon.py +97 -0
  677. nuitka/freezer/DllDependenciesMacOS.py +444 -0
  678. nuitka/freezer/DllDependenciesPosix.py +242 -0
  679. nuitka/freezer/DllDependenciesWin32.py +315 -0
  680. nuitka/freezer/ImportDetection.py +359 -0
  681. nuitka/freezer/IncludedDataFiles.py +689 -0
  682. nuitka/freezer/IncludedEntryPoints.py +376 -0
  683. nuitka/freezer/Onefile.py +296 -0
  684. nuitka/freezer/Standalone.py +520 -0
  685. nuitka/freezer/__init__.py +19 -0
  686. nuitka/importing/IgnoreListing.py +449 -0
  687. nuitka/importing/ImportCache.py +95 -0
  688. nuitka/importing/ImportResolving.py +186 -0
  689. nuitka/importing/Importing.py +1200 -0
  690. nuitka/importing/PreloadedPackages.py +164 -0
  691. nuitka/importing/Recursion.py +611 -0
  692. nuitka/importing/StandardLibrary.py +429 -0
  693. nuitka/importing/__init__.py +19 -0
  694. nuitka/nodes/AsyncgenNodes.py +107 -0
  695. nuitka/nodes/AttributeLookupNodes.py +124 -0
  696. nuitka/nodes/AttributeNodes.py +386 -0
  697. nuitka/nodes/AttributeNodesGenerated.py +10734 -0
  698. nuitka/nodes/BuiltinAllNodes.py +115 -0
  699. nuitka/nodes/BuiltinAnyNodes.py +124 -0
  700. nuitka/nodes/BuiltinComplexNodes.py +83 -0
  701. nuitka/nodes/BuiltinDecodingNodes.py +52 -0
  702. nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
  703. nuitka/nodes/BuiltinDictNodes.py +140 -0
  704. nuitka/nodes/BuiltinFormatNodes.py +159 -0
  705. nuitka/nodes/BuiltinHashNodes.py +63 -0
  706. nuitka/nodes/BuiltinInputNodes.py +39 -0
  707. nuitka/nodes/BuiltinIntegerNodes.py +170 -0
  708. nuitka/nodes/BuiltinIteratorNodes.py +391 -0
  709. nuitka/nodes/BuiltinLenNodes.py +61 -0
  710. nuitka/nodes/BuiltinNextNodes.py +111 -0
  711. nuitka/nodes/BuiltinOpenNodes.py +148 -0
  712. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
  713. nuitka/nodes/BuiltinRangeNodes.py +690 -0
  714. nuitka/nodes/BuiltinRefNodes.py +314 -0
  715. nuitka/nodes/BuiltinSumNodes.py +104 -0
  716. nuitka/nodes/BuiltinTypeNodes.py +454 -0
  717. nuitka/nodes/BuiltinVarsNodes.py +44 -0
  718. nuitka/nodes/BytesNodes.py +829 -0
  719. nuitka/nodes/CallNodes.py +217 -0
  720. nuitka/nodes/Checkers.py +55 -0
  721. nuitka/nodes/ChildrenHavingMixins.py +21576 -0
  722. nuitka/nodes/ClassNodes.py +286 -0
  723. nuitka/nodes/CodeObjectSpecs.py +230 -0
  724. nuitka/nodes/ComparisonNodes.py +687 -0
  725. nuitka/nodes/ConditionalNodes.py +884 -0
  726. nuitka/nodes/ConstantRefNodes.py +1717 -0
  727. nuitka/nodes/ContainerMakingNodes.py +408 -0
  728. nuitka/nodes/ContainerOperationNodes.py +87 -0
  729. nuitka/nodes/CoroutineNodes.py +144 -0
  730. nuitka/nodes/CtypesNodes.py +51 -0
  731. nuitka/nodes/DictionaryNodes.py +1513 -0
  732. nuitka/nodes/ExceptionNodes.py +393 -0
  733. nuitka/nodes/ExecEvalNodes.py +229 -0
  734. nuitka/nodes/ExpressionBases.py +1301 -0
  735. nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
  736. nuitka/nodes/ExpressionShapeMixins.py +886 -0
  737. nuitka/nodes/FrameNodes.py +413 -0
  738. nuitka/nodes/FunctionAttributeNodes.py +102 -0
  739. nuitka/nodes/FunctionNodes.py +1303 -0
  740. nuitka/nodes/FutureSpecs.py +224 -0
  741. nuitka/nodes/GeneratorNodes.py +201 -0
  742. nuitka/nodes/GlobalsLocalsNodes.py +209 -0
  743. nuitka/nodes/HardImportNodesGenerated.py +3599 -0
  744. nuitka/nodes/ImportHardNodes.py +185 -0
  745. nuitka/nodes/ImportNodes.py +1366 -0
  746. nuitka/nodes/IndicatorMixins.py +79 -0
  747. nuitka/nodes/InjectCNodes.py +51 -0
  748. nuitka/nodes/IterationHandles.py +407 -0
  749. nuitka/nodes/KeyValuePairNodes.py +378 -0
  750. nuitka/nodes/ListOperationNodes.py +525 -0
  751. nuitka/nodes/LocalsDictNodes.py +717 -0
  752. nuitka/nodes/LocalsScopes.py +505 -0
  753. nuitka/nodes/LoopNodes.py +445 -0
  754. nuitka/nodes/MatchNodes.py +60 -0
  755. nuitka/nodes/ModuleAttributeNodes.py +180 -0
  756. nuitka/nodes/ModuleNodes.py +1137 -0
  757. nuitka/nodes/NetworkxNodes.py +45 -0
  758. nuitka/nodes/NodeBases.py +890 -0
  759. nuitka/nodes/NodeMakingHelpers.py +481 -0
  760. nuitka/nodes/NodeMetaClasses.py +172 -0
  761. nuitka/nodes/OperatorNodes.py +944 -0
  762. nuitka/nodes/OperatorNodesUnary.py +403 -0
  763. nuitka/nodes/OsSysNodes.py +215 -0
  764. nuitka/nodes/OutlineNodes.py +372 -0
  765. nuitka/nodes/PackageMetadataNodes.py +982 -0
  766. nuitka/nodes/PackageResourceNodes.py +424 -0
  767. nuitka/nodes/PrintNodes.py +105 -0
  768. nuitka/nodes/ReturnNodes.py +255 -0
  769. nuitka/nodes/SideEffectNodes.py +139 -0
  770. nuitka/nodes/SliceNodes.py +386 -0
  771. nuitka/nodes/StatementBasesGenerated.py +3419 -0
  772. nuitka/nodes/StatementNodes.py +316 -0
  773. nuitka/nodes/StrNodes.py +919 -0
  774. nuitka/nodes/StringConcatenationNodes.py +103 -0
  775. nuitka/nodes/SubscriptNodes.py +245 -0
  776. nuitka/nodes/TensorflowNodes.py +38 -0
  777. nuitka/nodes/TryNodes.py +519 -0
  778. nuitka/nodes/TypeMatchNodes.py +65 -0
  779. nuitka/nodes/TypeNodes.py +390 -0
  780. nuitka/nodes/VariableAssignNodes.py +1177 -0
  781. nuitka/nodes/VariableDelNodes.py +320 -0
  782. nuitka/nodes/VariableNameNodes.py +153 -0
  783. nuitka/nodes/VariableRefNodes.py +895 -0
  784. nuitka/nodes/VariableReleaseNodes.py +153 -0
  785. nuitka/nodes/YieldNodes.py +121 -0
  786. nuitka/nodes/__init__.py +19 -0
  787. nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
  788. nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
  789. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  790. nuitka/nodes/shapes/ShapeMixins.py +255 -0
  791. nuitka/nodes/shapes/StandardShapes.py +1384 -0
  792. nuitka/nodes/shapes/__init__.py +19 -0
  793. nuitka/optimizations/BytecodeDemotion.py +105 -0
  794. nuitka/optimizations/FunctionInlining.py +110 -0
  795. nuitka/optimizations/Graphs.py +70 -0
  796. nuitka/optimizations/Optimization.py +363 -0
  797. nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
  798. nuitka/optimizations/Tags.py +76 -0
  799. nuitka/optimizations/TraceCollections.py +1257 -0
  800. nuitka/optimizations/ValueTraces.py +980 -0
  801. nuitka/optimizations/__init__.py +19 -0
  802. nuitka/pgo/PGO.py +160 -0
  803. nuitka/pgo/__init__.py +19 -0
  804. nuitka/plugins/PluginBase.py +1924 -0
  805. nuitka/plugins/Plugins.py +2007 -0
  806. nuitka/plugins/YamlPluginBase.py +121 -0
  807. nuitka/plugins/__init__.py +19 -0
  808. nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
  809. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
  810. nuitka/plugins/standard/DataFilesPlugin.py +311 -0
  811. nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
  812. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  813. nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
  814. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
  815. nuitka/plugins/standard/DillPlugin.py +137 -0
  816. nuitka/plugins/standard/DllFilesPlugin.py +527 -0
  817. nuitka/plugins/standard/EnumPlugin.py +64 -0
  818. nuitka/plugins/standard/EventletPlugin.py +57 -0
  819. nuitka/plugins/standard/GeventPlugin.py +64 -0
  820. nuitka/plugins/standard/GiPlugin.py +118 -0
  821. nuitka/plugins/standard/GlfwPlugin.py +138 -0
  822. nuitka/plugins/standard/ImplicitImports.py +845 -0
  823. nuitka/plugins/standard/KivyPlugin.py +141 -0
  824. nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
  825. nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
  826. nuitka/plugins/standard/NumpyPlugin.py +35 -0
  827. nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
  828. nuitka/plugins/standard/PbrPlugin.py +62 -0
  829. nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
  830. nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
  831. nuitka/plugins/standard/PmwPlugin.py +248 -0
  832. nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
  833. nuitka/plugins/standard/PywebViewPlugin.py +81 -0
  834. nuitka/plugins/standard/SpacyPlugin.py +137 -0
  835. nuitka/plugins/standard/TensorflowPlugin.py +35 -0
  836. nuitka/plugins/standard/TkinterPlugin.py +416 -0
  837. nuitka/plugins/standard/TorchPlugin.py +35 -0
  838. nuitka/plugins/standard/TransformersPlugin.py +121 -0
  839. nuitka/plugins/standard/TrioPlugin.py +33 -0
  840. nuitka/plugins/standard/UpxPlugin.py +174 -0
  841. nuitka/plugins/standard/__init__.py +19 -0
  842. nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
  843. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
  844. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
  845. nuitka/reports/CompilationReportReader.py +83 -0
  846. nuitka/reports/LicenseReport.rst.j2 +41 -0
  847. nuitka/reports/Reports.py +961 -0
  848. nuitka/reports/__init__.py +19 -0
  849. nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
  850. nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
  851. nuitka/specs/BuiltinListOperationSpecs.py +80 -0
  852. nuitka/specs/BuiltinParameterSpecs.py +831 -0
  853. nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
  854. nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
  855. nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
  856. nuitka/specs/HardImportSpecs.py +236 -0
  857. nuitka/specs/ParameterSpecs.py +630 -0
  858. nuitka/specs/__init__.py +19 -0
  859. nuitka/tools/Basics.py +55 -0
  860. nuitka/tools/__init__.py +19 -0
  861. nuitka/tools/commercial/__init__.py +21 -0
  862. nuitka/tools/data_composer/DataComposer.py +593 -0
  863. nuitka/tools/data_composer/__init__.py +19 -0
  864. nuitka/tools/data_composer/__main__.py +41 -0
  865. nuitka/tools/environments/CreateEnvironment.py +69 -0
  866. nuitka/tools/environments/Virtualenv.py +158 -0
  867. nuitka/tools/environments/__init__.py +19 -0
  868. nuitka/tools/general/__init__.py +19 -0
  869. nuitka/tools/general/dll_report/__init__.py +19 -0
  870. nuitka/tools/general/dll_report/__main__.py +83 -0
  871. nuitka/tools/general/find_module/FindModuleCode.py +127 -0
  872. nuitka/tools/general/find_module/__init__.py +19 -0
  873. nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
  874. nuitka/tools/general/generate_header/__init__.py +19 -0
  875. nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
  876. nuitka/tools/onefile_compressor/__init__.py +19 -0
  877. nuitka/tools/onefile_compressor/__main__.py +41 -0
  878. nuitka/tools/podman/Podman.py +55 -0
  879. nuitka/tools/podman/__init__.py +19 -0
  880. nuitka/tools/podman/__main__.py +425 -0
  881. nuitka/tools/profiler/__init__.py +19 -0
  882. nuitka/tools/profiler/__main__.py +93 -0
  883. nuitka/tools/scanning/DisplayDistributions.py +39 -0
  884. nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
  885. nuitka/tools/scanning/DisplayPackageData.py +73 -0
  886. nuitka/tools/scanning/__init__.py +19 -0
  887. nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
  888. nuitka/tools/specialize/Common.py +380 -0
  889. nuitka/tools/specialize/SpecializeC.py +1483 -0
  890. nuitka/tools/specialize/SpecializePython.py +1151 -0
  891. nuitka/tools/specialize/__init__.py +19 -0
  892. nuitka/tools/testing/Common.py +2007 -0
  893. nuitka/tools/testing/Constructs.py +53 -0
  894. nuitka/tools/testing/DocTests.py +156 -0
  895. nuitka/tools/testing/OutputComparison.py +313 -0
  896. nuitka/tools/testing/Pythons.py +34 -0
  897. nuitka/tools/testing/RuntimeTracing.py +260 -0
  898. nuitka/tools/testing/SearchModes.py +208 -0
  899. nuitka/tools/testing/Valgrind.py +103 -0
  900. nuitka/tools/testing/__init__.py +19 -0
  901. nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
  902. nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
  903. nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
  904. nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
  905. nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
  906. nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
  907. nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
  908. nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
  909. nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
  910. nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
  911. nuitka/tools/watch/AutoStage.py +145 -0
  912. nuitka/tools/watch/Common.py +55 -0
  913. nuitka/tools/watch/Conda.py +125 -0
  914. nuitka/tools/watch/GitHub.py +113 -0
  915. nuitka/tools/watch/Pacman.py +73 -0
  916. nuitka/tools/watch/Pipenv.py +145 -0
  917. nuitka/tools/watch/__init__.py +19 -0
  918. nuitka/tools/watch/__main__.py +615 -0
  919. nuitka/tree/Building.py +1459 -0
  920. nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
  921. nuitka/tree/Extractions.py +48 -0
  922. nuitka/tree/FutureSpecState.py +71 -0
  923. nuitka/tree/InternalModule.py +96 -0
  924. nuitka/tree/Operations.py +45 -0
  925. nuitka/tree/ReformulationAssertStatements.py +97 -0
  926. nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
  927. nuitka/tree/ReformulationBooleanExpressions.py +97 -0
  928. nuitka/tree/ReformulationCallExpressions.py +314 -0
  929. nuitka/tree/ReformulationClasses.py +407 -0
  930. nuitka/tree/ReformulationClasses3.py +1149 -0
  931. nuitka/tree/ReformulationComparisonExpressions.py +174 -0
  932. nuitka/tree/ReformulationContractionExpressions.py +676 -0
  933. nuitka/tree/ReformulationDictionaryCreation.py +304 -0
  934. nuitka/tree/ReformulationExecStatements.py +386 -0
  935. nuitka/tree/ReformulationForLoopStatements.py +215 -0
  936. nuitka/tree/ReformulationFunctionStatements.py +931 -0
  937. nuitka/tree/ReformulationImportStatements.py +333 -0
  938. nuitka/tree/ReformulationLambdaExpressions.py +185 -0
  939. nuitka/tree/ReformulationMatchStatements.py +797 -0
  940. nuitka/tree/ReformulationMultidist.py +80 -0
  941. nuitka/tree/ReformulationNamespacePackages.py +239 -0
  942. nuitka/tree/ReformulationPrintStatements.py +127 -0
  943. nuitka/tree/ReformulationSequenceCreation.py +438 -0
  944. nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
  945. nuitka/tree/ReformulationTryExceptStatements.py +418 -0
  946. nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
  947. nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
  948. nuitka/tree/ReformulationWithStatements.py +382 -0
  949. nuitka/tree/ReformulationYieldExpressions.py +133 -0
  950. nuitka/tree/SourceHandling.py +476 -0
  951. nuitka/tree/SyntaxErrors.py +143 -0
  952. nuitka/tree/TreeHelpers.py +720 -0
  953. nuitka/tree/VariableClosure.py +483 -0
  954. nuitka/tree/__init__.py +19 -0
  955. nuitka/utils/AppDirs.py +104 -0
  956. nuitka/utils/CStrings.py +208 -0
  957. nuitka/utils/CommandLineOptions.py +207 -0
  958. nuitka/utils/Distributions.py +728 -0
  959. nuitka/utils/Download.py +217 -0
  960. nuitka/utils/Execution.py +517 -0
  961. nuitka/utils/FileOperations.py +1587 -0
  962. nuitka/utils/Hashing.py +137 -0
  963. nuitka/utils/Images.py +79 -0
  964. nuitka/utils/Importing.py +335 -0
  965. nuitka/utils/InlineCopies.py +52 -0
  966. nuitka/utils/InstalledPythons.py +254 -0
  967. nuitka/utils/InstanceCounters.py +86 -0
  968. nuitka/utils/Jinja2.py +158 -0
  969. nuitka/utils/Json.py +40 -0
  970. nuitka/utils/MacOSApp.py +134 -0
  971. nuitka/utils/MemoryUsage.py +165 -0
  972. nuitka/utils/ModuleNames.py +317 -0
  973. nuitka/utils/PackageResources.py +44 -0
  974. nuitka/utils/ReExecute.py +152 -0
  975. nuitka/utils/Rest.py +60 -0
  976. nuitka/utils/SharedLibraries.py +1014 -0
  977. nuitka/utils/Shebang.py +113 -0
  978. nuitka/utils/Signing.py +144 -0
  979. nuitka/utils/SlotMetaClasses.py +57 -0
  980. nuitka/utils/StaticLibraries.py +260 -0
  981. nuitka/utils/ThreadedExecutor.py +87 -0
  982. nuitka/utils/Timing.py +102 -0
  983. nuitka/utils/Utils.py +483 -0
  984. nuitka/utils/WindowsFileUsage.py +337 -0
  985. nuitka/utils/WindowsResources.py +652 -0
  986. nuitka/utils/Yaml.py +247 -0
  987. nuitka/utils/__init__.py +19 -0
  988. nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
  989. nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
  990. nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
  991. nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
  992. nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
  993. nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
  994. nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
  995. nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2116 @@
1
+ # MIT License
2
+ #
3
+ # Copyright The SCons Foundation
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included
14
+ # in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ """ Tool-specific initialization for Microsoft Visual Studio project files.
25
+
26
+ There normally shouldn't be any need to import this module directly.
27
+ It will usually be imported through the generic SCons.Tool.Tool()
28
+ selection method.
29
+ """
30
+
31
+ import base64
32
+ import uuid
33
+ import ntpath
34
+ import os
35
+ import pickle
36
+ import re
37
+ import sys
38
+
39
+ import SCons.Builder
40
+ import SCons.Node.FS
41
+ import SCons.Platform.win32
42
+ import SCons.Script.SConscript
43
+ import SCons.PathList
44
+ import SCons.Util
45
+ import SCons.Warnings
46
+ from SCons.Defaults import processDefines
47
+ from SCons.compat import PICKLE_PROTOCOL
48
+ from .MSCommon import msvc_exists, msvc_setup_env_once
49
+
50
+ ##############################################################################
51
+ # Below here are the classes and functions for generation of
52
+ # DSP/DSW/SLN/VCPROJ files.
53
+ ##############################################################################
54
+
55
+ def xmlify(s):
56
+ s = s.replace("&", "&") # do this first
57
+ s = s.replace("'", "'")
58
+ s = s.replace('"', """)
59
+ s = s.replace('<', "&lt;")
60
+ s = s.replace('>', "&gt;")
61
+ s = s.replace('\n', '&#x0A;')
62
+ return s
63
+
64
+
65
+ def processIncludes(includes, env, target, source):
66
+ """
67
+ Process a CPPPATH list in includes, given the env, target and source.
68
+ Returns a list of directory paths. These paths are absolute so we avoid
69
+ putting pound-prefixed paths in a Visual Studio project file.
70
+ """
71
+ return [env.Dir(i).abspath for i in
72
+ SCons.PathList.PathList(includes).subst_path(env, target, source)]
73
+
74
+ # Work-in-progress
75
+ # individual elements each get a globally unique identifier.
76
+ # however, there also are some "well known" guids that either
77
+ # represent something, or are used as a namespace to base
78
+ # generating guids that should be "in" the namespace
79
+ #NAMESPACE_PROJECT = uuid.UUID("{D9BD5916-F055-4D77-8C69-9448E02BF433}")
80
+ #NAMESPACE_SLN_GROUP = uuid.UUID("{2D0C29E0-512F-47BE-9AC4-F4CAE74AE16E}")
81
+ #NAMESPACE_INTERNAL = uuid.UUID("{BAA4019E-6D67-4EF1-B3CB-AE6CD82E4060}")
82
+
83
+ # Kinds of projects, as used in solution files
84
+ #PROJECT_KIND_C = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
85
+ #PROJECT_KIND_PCL = "{786C830F-07A1-408B-BD7F-6EE04809D6DB}"
86
+ #NAMESPACE_PRJ_FOLDER = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}"
87
+ #NAMESPACE_SLN_FOLDER = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}"
88
+ #NAMESPACE_TEST = "{3AC096D0-A1C2-E12C-1390-A8335801FDAB}"
89
+
90
+ def processFlags(flags, env):
91
+ """
92
+ If /std:c++XX is in flags then we need to ensure /Zc:__cplusplus is in
93
+ flags to tell intellisense to respect our specified standard
94
+ """
95
+ if any(f.startswith('/std:c++') for f in flags) and \
96
+ not any(f == '/Zc:__cplusplus' for f in flags):
97
+ flags.append('/Zc:__cplusplus')
98
+ return [env.subst(f) for f in flags]
99
+
100
+
101
+ external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'
102
+
103
+ def _generateGUID(slnfile, name, namespace=external_makefile_guid):
104
+ """Generates a GUID for the sln file to use.
105
+
106
+ The uuid5 function is used to combine an existing namespace uuid -
107
+ the one VS uses for C projects (external_makedile_guid) -
108
+ and a combination of the solution file name (slnfile) and the
109
+ project name (name). We just need uniqueness/repeatability.
110
+
111
+ Returns (str) "displayable" GUID, already wrapped in braces
112
+ """
113
+
114
+ # Normalize the slnfile path to a Windows path (\ separators) so
115
+ # the generated file has a consistent GUID even if we generate
116
+ # it on a non-Windows platform.
117
+ slnfile = ntpath.normpath(str(slnfile))
118
+ solution = uuid.uuid5(uuid.UUID(namespace), "%s-%s" %(slnfile, name))
119
+ return '{' + str(solution).upper() + '}'
120
+
121
+
122
+ version_re = re.compile(r'(\d+\.\d+)(.*)')
123
+
124
+
125
+ def msvs_parse_version(s):
126
+ """
127
+ Split a Visual Studio version, which may in fact be something like
128
+ '7.0Exp', into is version number (returned as a float) and trailing
129
+ "suite" portion.
130
+ """
131
+ num, suite = version_re.match(s).groups()
132
+ return float(num), suite
133
+
134
+ # This is how we re-invoke SCons from inside MSVS Project files.
135
+ # The problem is that we might have been invoked as either scons.bat
136
+ # or scons.py. If we were invoked directly as scons.py, then we could
137
+ # use sys.argv[0] to find the SCons "executable," but that doesn't work
138
+ # if we were invoked as scons.bat, which uses "python -c" to execute
139
+ # things and ends up with "-c" as sys.argv[0]. Consequently, we have
140
+ # the MSVS Project file invoke SCons the same way that scons.bat does,
141
+ # which works regardless of how we were invoked.
142
+ def getExecScriptMain(env, xml=None):
143
+ scons_home = env.get('SCONS_HOME')
144
+ if not scons_home and 'SCONS_LIB_DIR' in os.environ:
145
+ scons_home = os.environ['SCONS_LIB_DIR']
146
+ if scons_home:
147
+ exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % scons_home
148
+ else:
149
+ version = SCons.__version__
150
+ exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % locals()
151
+ if xml:
152
+ exec_script_main = xmlify(exec_script_main)
153
+ return exec_script_main
154
+
155
+ # The string for the Python executable we tell the Project file to use
156
+ # is either sys.executable or, if an external PYTHON_ROOT environment
157
+ # variable exists, $(PYTHON)ROOT\\python.exe (generalized a little to
158
+ # pluck the actual executable name from sys.executable).
159
+ try:
160
+ python_root = os.environ['PYTHON_ROOT']
161
+ except KeyError:
162
+ python_executable = sys.executable
163
+ else:
164
+ python_executable = os.path.join('$$(PYTHON_ROOT)',
165
+ os.path.split(sys.executable)[1])
166
+
167
+ class Config:
168
+ pass
169
+
170
+ def splitFully(path):
171
+ dir, base = os.path.split(path)
172
+ if dir and dir != '' and dir != path:
173
+ return splitFully(dir)+[base]
174
+ if base == '':
175
+ return []
176
+ return [base]
177
+
178
+ def makeHierarchy(sources):
179
+ """Break a list of files into a hierarchy; for each value, if it is a string,
180
+ then it is a file. If it is a dictionary, it is a folder. The string is
181
+ the original path of the file."""
182
+
183
+ hierarchy = {}
184
+ for file in sources:
185
+ path = splitFully(file)
186
+ if len(path):
187
+ dict = hierarchy
188
+ for part in path[:-1]:
189
+ if part not in dict:
190
+ dict[part] = {}
191
+ dict = dict[part]
192
+ dict[path[-1]] = file
193
+ #else:
194
+ # print 'Warning: failed to decompose path for '+str(file)
195
+ return hierarchy
196
+
197
+ class _UserGenerator:
198
+ """
199
+ Base class for .dsp.user file generator
200
+ """
201
+ # Default instance values.
202
+ # Ok ... a bit defensive, but it does not seem reasonable to crash the
203
+ # build for a workspace user file. :-)
204
+ usrhead = None
205
+ usrdebg = None
206
+ usrconf = None
207
+ createfile = False
208
+ def __init__(self, dspfile, source, env):
209
+ # DebugSettings should be a list of debug dictionary sorted in the same order
210
+ # as the target list and variants
211
+ if 'variant' not in env:
212
+ raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
213
+ "'Release') to create an MSVSProject.")
214
+ elif SCons.Util.is_String(env['variant']):
215
+ variants = [env['variant']]
216
+ elif SCons.Util.is_List(env['variant']):
217
+ variants = env['variant']
218
+
219
+ if 'DebugSettings' not in env or env['DebugSettings'] is None:
220
+ dbg_settings = []
221
+ elif SCons.Util.is_Dict(env['DebugSettings']):
222
+ dbg_settings = [env['DebugSettings']]
223
+ elif SCons.Util.is_List(env['DebugSettings']):
224
+ if len(env['DebugSettings']) != len(variants):
225
+ raise SCons.Errors.InternalError("Sizes of 'DebugSettings' and 'variant' lists must be the same.")
226
+ dbg_settings = []
227
+ for ds in env['DebugSettings']:
228
+ if SCons.Util.is_Dict(ds):
229
+ dbg_settings.append(ds)
230
+ else:
231
+ dbg_settings.append({})
232
+ else:
233
+ dbg_settings = []
234
+
235
+ if len(dbg_settings) == 1:
236
+ dbg_settings = dbg_settings * len(variants)
237
+
238
+ self.createfile = self.usrhead and self.usrdebg and self.usrconf and \
239
+ dbg_settings and bool([ds for ds in dbg_settings if ds])
240
+
241
+ if self.createfile:
242
+ dbg_settings = dict(list(zip(variants, dbg_settings)))
243
+ for var, src in dbg_settings.items():
244
+ # Update only expected keys
245
+ trg = {}
246
+ for key in [k for k in self.usrdebg.keys() if k in src]:
247
+ trg[key] = str(src[key])
248
+ self.configs[var].debug = trg
249
+
250
+ def UserHeader(self):
251
+ encoding = self.env.subst('$MSVSENCODING')
252
+ versionstr = self.versionstr
253
+ self.usrfile.write(self.usrhead % locals())
254
+
255
+ def UserProject(self):
256
+ pass
257
+
258
+ def Build(self):
259
+ if not self.createfile:
260
+ return
261
+ try:
262
+ filename = self.dspabs +'.user'
263
+ self.usrfile = open(filename, 'w')
264
+ except IOError as detail:
265
+ raise SCons.Errors.InternalError('Unable to open "' + filename + '" for writing:' + str(detail))
266
+ else:
267
+ self.UserHeader()
268
+ self.UserProject()
269
+ self.usrfile.close()
270
+
271
+ V9UserHeader = """\
272
+ <?xml version="1.0" encoding="%(encoding)s"?>
273
+ <VisualStudioUserFile
274
+ \tProjectType="Visual C++"
275
+ \tVersion="%(versionstr)s"
276
+ \tShowAllFiles="false"
277
+ \t>
278
+ \t<Configurations>
279
+ """
280
+
281
+ V9UserConfiguration = """\
282
+ \t\t<Configuration
283
+ \t\t\tName="%(variant)s|%(platform)s"
284
+ \t\t\t>
285
+ \t\t\t<DebugSettings
286
+ %(debug_settings)s
287
+ \t\t\t/>
288
+ \t\t</Configuration>
289
+ """
290
+
291
+ V9DebugSettings = {
292
+ 'Command':'$(TargetPath)',
293
+ 'WorkingDirectory': None,
294
+ 'CommandArguments': None,
295
+ 'Attach':'false',
296
+ 'DebuggerType':'3',
297
+ 'Remote':'1',
298
+ 'RemoteMachine': None,
299
+ 'RemoteCommand': None,
300
+ 'HttpUrl': None,
301
+ 'PDBPath': None,
302
+ 'SQLDebugging': None,
303
+ 'Environment': None,
304
+ 'EnvironmentMerge':'true',
305
+ 'DebuggerFlavor': None,
306
+ 'MPIRunCommand': None,
307
+ 'MPIRunArguments': None,
308
+ 'MPIRunWorkingDirectory': None,
309
+ 'ApplicationCommand': None,
310
+ 'ApplicationArguments': None,
311
+ 'ShimCommand': None,
312
+ 'MPIAcceptMode': None,
313
+ 'MPIAcceptFilter': None,
314
+ }
315
+
316
+ class _GenerateV7User(_UserGenerator):
317
+ """Generates a Project file for MSVS .NET"""
318
+ def __init__(self, dspfile, source, env):
319
+ if self.version_num >= 9.0:
320
+ self.usrhead = V9UserHeader
321
+ self.usrconf = V9UserConfiguration
322
+ self.usrdebg = V9DebugSettings
323
+ _UserGenerator.__init__(self, dspfile, source, env)
324
+
325
+ def UserProject(self):
326
+ confkeys = sorted(self.configs.keys())
327
+ for kind in confkeys:
328
+ variant = self.configs[kind].variant
329
+ platform = self.configs[kind].platform
330
+ debug = self.configs[kind].debug
331
+ if debug:
332
+ debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
333
+ for key, value in debug.items()
334
+ if value is not None])
335
+ self.usrfile.write(self.usrconf % locals())
336
+ self.usrfile.write('\t</Configurations>\n</VisualStudioUserFile>')
337
+
338
+ V10UserHeader = """\
339
+ <?xml version="1.0" encoding="%(encoding)s"?>
340
+ <Project ToolsVersion="%(versionstr)s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
341
+ """
342
+
343
+ V10UserConfiguration = """\
344
+ \t<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">
345
+ %(debug_settings)s
346
+ \t</PropertyGroup>
347
+ """
348
+
349
+ V10DebugSettings = {
350
+ 'LocalDebuggerCommand': None,
351
+ 'LocalDebuggerCommandArguments': None,
352
+ 'LocalDebuggerEnvironment': None,
353
+ 'DebuggerFlavor': 'WindowsLocalDebugger',
354
+ 'LocalDebuggerWorkingDirectory': None,
355
+ 'LocalDebuggerAttach': None,
356
+ 'LocalDebuggerDebuggerType': None,
357
+ 'LocalDebuggerMergeEnvironment': None,
358
+ 'LocalDebuggerSQLDebugging': None,
359
+ 'RemoteDebuggerCommand': None,
360
+ 'RemoteDebuggerCommandArguments': None,
361
+ 'RemoteDebuggerWorkingDirectory': None,
362
+ 'RemoteDebuggerServerName': None,
363
+ 'RemoteDebuggerConnection': None,
364
+ 'RemoteDebuggerDebuggerType': None,
365
+ 'RemoteDebuggerAttach': None,
366
+ 'RemoteDebuggerSQLDebugging': None,
367
+ 'DeploymentDirectory': None,
368
+ 'AdditionalFiles': None,
369
+ 'RemoteDebuggerDeployDebugCppRuntime': None,
370
+ 'WebBrowserDebuggerHttpUrl': None,
371
+ 'WebBrowserDebuggerDebuggerType': None,
372
+ 'WebServiceDebuggerHttpUrl': None,
373
+ 'WebServiceDebuggerDebuggerType': None,
374
+ 'WebServiceDebuggerSQLDebugging': None,
375
+ }
376
+
377
+ class _GenerateV10User(_UserGenerator):
378
+ """Generates a Project'user file for MSVS 2010 or later"""
379
+
380
+ def __init__(self, dspfile, source, env):
381
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
382
+ if version_num >= 14.3:
383
+ # Visual Studio 2022 is considered to be version 17.
384
+ self.versionstr = '17.0'
385
+ elif version_num >= 14.2:
386
+ # Visual Studio 2019 is considered to be version 16.
387
+ self.versionstr = '16.0'
388
+ elif version_num >= 14.1:
389
+ # Visual Studio 2017 is considered to be version 15.
390
+ self.versionstr = '15.0'
391
+ elif version_num == 14.0:
392
+ self.versionstr = '14.0'
393
+ else:
394
+ self.versionstr = '4.0'
395
+ self.usrhead = V10UserHeader
396
+ self.usrconf = V10UserConfiguration
397
+ self.usrdebg = V10DebugSettings
398
+ _UserGenerator.__init__(self, dspfile, source, env)
399
+
400
+ def UserProject(self):
401
+ confkeys = sorted(self.configs.keys())
402
+ for kind in confkeys:
403
+ variant = self.configs[kind].variant
404
+ platform = self.configs[kind].platform
405
+ debug = self.configs[kind].debug
406
+ if debug:
407
+ debug_settings = '\n'.join(['\t\t<%s>%s</%s>' % (key, xmlify(value), key)
408
+ for key, value in debug.items()
409
+ if value is not None])
410
+ self.usrfile.write(self.usrconf % locals())
411
+ self.usrfile.write('</Project>')
412
+
413
+ class _DSPGenerator:
414
+ """ Base class for DSP generators """
415
+
416
+ srcargs = [
417
+ 'srcs',
418
+ 'incs',
419
+ 'localincs',
420
+ 'resources',
421
+ 'misc']
422
+
423
+ def __init__(self, dspfile, source, env):
424
+ self.dspfile = str(dspfile)
425
+ try:
426
+ get_abspath = dspfile.get_abspath
427
+ except AttributeError:
428
+ self.dspabs = os.path.abspath(dspfile)
429
+ else:
430
+ self.dspabs = get_abspath()
431
+
432
+ if 'variant' not in env:
433
+ raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
434
+ "'Release') to create an MSVSProject.")
435
+ elif SCons.Util.is_String(env['variant']):
436
+ variants = [env['variant']]
437
+ elif SCons.Util.is_List(env['variant']):
438
+ variants = env['variant']
439
+
440
+ if 'buildtarget' not in env or env['buildtarget'] is None:
441
+ buildtarget = ['']
442
+ elif SCons.Util.is_String(env['buildtarget']):
443
+ buildtarget = [env['buildtarget']]
444
+ elif SCons.Util.is_List(env['buildtarget']):
445
+ if len(env['buildtarget']) != len(variants):
446
+ raise SCons.Errors.InternalError("Sizes of 'buildtarget' and 'variant' lists must be the same.")
447
+ buildtarget = []
448
+ for bt in env['buildtarget']:
449
+ if SCons.Util.is_String(bt):
450
+ buildtarget.append(bt)
451
+ else:
452
+ buildtarget.append(bt.get_abspath())
453
+ else:
454
+ buildtarget = [env['buildtarget'].get_abspath()]
455
+ if len(buildtarget) == 1:
456
+ bt = buildtarget[0]
457
+ buildtarget = []
458
+ for _ in variants:
459
+ buildtarget.append(bt)
460
+
461
+ if 'outdir' not in env or env['outdir'] is None:
462
+ outdir = ['']
463
+ elif SCons.Util.is_String(env['outdir']):
464
+ outdir = [env['outdir']]
465
+ elif SCons.Util.is_List(env['outdir']):
466
+ if len(env['outdir']) != len(variants):
467
+ raise SCons.Errors.InternalError("Sizes of 'outdir' and 'variant' lists must be the same.")
468
+ outdir = []
469
+ for s in env['outdir']:
470
+ if SCons.Util.is_String(s):
471
+ outdir.append(s)
472
+ else:
473
+ outdir.append(s.get_abspath())
474
+ else:
475
+ outdir = [env['outdir'].get_abspath()]
476
+ if len(outdir) == 1:
477
+ s = outdir[0]
478
+ outdir = []
479
+ for v in variants:
480
+ outdir.append(s)
481
+
482
+ if 'runfile' not in env or env['runfile'] is None:
483
+ runfile = buildtarget[-1:]
484
+ elif SCons.Util.is_String(env['runfile']):
485
+ runfile = [env['runfile']]
486
+ elif SCons.Util.is_List(env['runfile']):
487
+ if len(env['runfile']) != len(variants):
488
+ raise SCons.Errors.InternalError("Sizes of 'runfile' and 'variant' lists must be the same.")
489
+ runfile = []
490
+ for s in env['runfile']:
491
+ if SCons.Util.is_String(s):
492
+ runfile.append(s)
493
+ else:
494
+ runfile.append(s.get_abspath())
495
+ else:
496
+ runfile = [env['runfile'].get_abspath()]
497
+ if len(runfile) == 1:
498
+ s = runfile[0]
499
+ runfile = []
500
+ for v in variants:
501
+ runfile.append(s)
502
+
503
+ self.sconscript = env['MSVSSCONSCRIPT']
504
+
505
+ def GetKeyFromEnv(env, key, variants):
506
+ """
507
+ Retrieves a specific key from the environment. If the key is
508
+ present, it is expected to either be a string or a list with length
509
+ equal to the number of variants. The function returns a list of
510
+ the desired value (e.g. cpp include paths) guaranteed to be of
511
+ length equal to the length of the variants list.
512
+ """
513
+ if key not in env or env[key] is None:
514
+ return [''] * len(variants)
515
+ elif SCons.Util.is_String(env[key]):
516
+ return [env[key]] * len(variants)
517
+ elif SCons.Util.is_List(env[key]):
518
+ if len(env[key]) != len(variants):
519
+ raise SCons.Errors.InternalError("Sizes of '%s' and 'variant' lists must be the same." % key)
520
+ else:
521
+ return env[key]
522
+ else:
523
+ raise SCons.Errors.InternalError("Unsupported type for key '%s' in environment: %s" %
524
+ (key, type(env[key])))
525
+
526
+ cmdargs = GetKeyFromEnv(env, 'cmdargs', variants)
527
+
528
+ # The caller is allowed to put 'cppdefines' and/or 'cpppaths' in the
529
+ # environment, which is useful if they want to provide per-variant
530
+ # values for these. Otherwise, we fall back to using the global
531
+ # 'CPPDEFINES' and 'CPPPATH' functions.
532
+ if 'cppdefines' in env:
533
+ cppdefines = GetKeyFromEnv(env, 'cppdefines', variants)
534
+ else:
535
+ cppdefines = [env.get('CPPDEFINES', [])] * len(variants)
536
+ if 'cpppaths' in env:
537
+ cpppaths = GetKeyFromEnv(env, 'cpppaths', variants)
538
+ else:
539
+ cpppaths = [env.get('CPPPATH', [])] * len(variants)
540
+ if 'cppflags' in env:
541
+ cppflags = GetKeyFromEnv(env, 'cppflags', variants)
542
+ else:
543
+ cppflags = [env.get('CCFLAGS', []) + env.get('CXXFLAGS', []) + env.get('CPPFLAGS', [])] * len(variants)
544
+
545
+ self.env = env
546
+
547
+ if 'name' in self.env:
548
+ self.name = self.env['name']
549
+ else:
550
+ self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0])
551
+ self.name = self.env.subst(self.name)
552
+
553
+ sourcenames = [
554
+ 'Source Files',
555
+ 'Header Files',
556
+ 'Local Headers',
557
+ 'Resource Files',
558
+ 'Other Files']
559
+
560
+ self.sources = {}
561
+ for n in sourcenames:
562
+ self.sources[n] = []
563
+
564
+ self.configs = {}
565
+
566
+ self.nokeep = 0
567
+ if 'nokeep' in env and env['variant'] != 0:
568
+ self.nokeep = 1
569
+
570
+ if self.nokeep == 0 and os.path.exists(self.dspabs):
571
+ self.Parse()
572
+
573
+ for t in zip(sourcenames,self.srcargs):
574
+ if t[1] in self.env:
575
+ if SCons.Util.is_List(self.env[t[1]]):
576
+ for i in self.env[t[1]]:
577
+ if i not in self.sources[t[0]]:
578
+ self.sources[t[0]].append(i)
579
+ else:
580
+ if not self.env[t[1]] in self.sources[t[0]]:
581
+ self.sources[t[0]].append(self.env[t[1]])
582
+
583
+ for n in sourcenames:
584
+ self.sources[n].sort(key=lambda a: a.lower())
585
+
586
+ def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines, cpppaths, cppflags, dspfile=dspfile, env=env):
587
+ config = Config()
588
+ config.buildtarget = buildtarget
589
+ config.outdir = outdir
590
+ config.cmdargs = cmdargs
591
+ config.cppdefines = cppdefines
592
+ config.cppflags = cppflags
593
+ config.runfile = runfile
594
+
595
+ # Dir objects can't be pickled, so we need an absolute path here.
596
+ config.cpppaths = processIncludes(cpppaths, env, None, None)
597
+
598
+ match = re.match(r'(.*)\|(.*)', variant)
599
+ if match:
600
+ config.variant = match.group(1)
601
+ config.platform = match.group(2)
602
+ else:
603
+ config.variant = variant
604
+ config.platform = 'Win32'
605
+
606
+ self.configs[variant] = config
607
+ # DEBUG: leave enabled, test/MSVS/CPPPATH-dirs.py expects this
608
+ print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'")
609
+
610
+ for i in range(len(variants)):
611
+ AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i], cppdefines[i], cpppaths[i], cppflags[i])
612
+
613
+ seen = set()
614
+ self.platforms = [p.platform for p in self.configs.values()
615
+ if not (p.platform in seen or seen.add(p.platform))]
616
+
617
+
618
+ def Build(self):
619
+ pass
620
+
621
+ V6DSPHeader = """\
622
+ # Microsoft Developer Studio Project File - Name="%(name)s" - Package Owner=<4>
623
+ # Microsoft Developer Studio Generated Build File, Format Version 6.00
624
+ # ** DO NOT EDIT **
625
+
626
+ # TARGTYPE "Win32 (x86) External Target" 0x0106
627
+
628
+ CFG=%(name)s - Win32 %(confkey)s
629
+ !MESSAGE This is not a valid makefile. To build this project using NMAKE,
630
+ !MESSAGE use the Export Makefile command and run
631
+ !MESSAGE
632
+ !MESSAGE NMAKE /f "%(name)s.mak".
633
+ !MESSAGE
634
+ !MESSAGE You can specify a configuration when running NMAKE
635
+ !MESSAGE by defining the macro CFG on the command line. For example:
636
+ !MESSAGE
637
+ !MESSAGE NMAKE /f "%(name)s.mak" CFG="%(name)s - Win32 %(confkey)s"
638
+ !MESSAGE
639
+ !MESSAGE Possible choices for configuration are:
640
+ !MESSAGE
641
+ """
642
+
643
+ class _GenerateV6DSP(_DSPGenerator):
644
+ """Generates a Project file for MSVS 6.0"""
645
+
646
+ def PrintHeader(self):
647
+ # pick a default config
648
+ confkeys = sorted(self.configs.keys())
649
+
650
+ name = self.name
651
+ confkey = confkeys[0]
652
+
653
+ self.file.write(V6DSPHeader % locals())
654
+
655
+ for kind in confkeys:
656
+ self.file.write('!MESSAGE "%s - Win32 %s" (based on "Win32 (x86) External Target")\n' % (name, kind))
657
+
658
+ self.file.write('!MESSAGE\n\n')
659
+
660
+ def PrintProject(self):
661
+ name = self.name
662
+ self.file.write('# Begin Project\n'
663
+ '# PROP AllowPerConfigDependencies 0\n'
664
+ '# PROP Scc_ProjName ""\n'
665
+ '# PROP Scc_LocalPath ""\n\n')
666
+
667
+ first = 1
668
+ confkeys = sorted(self.configs.keys())
669
+ for kind in confkeys:
670
+ outdir = self.configs[kind].outdir
671
+ buildtarget = self.configs[kind].buildtarget
672
+ if first == 1:
673
+ self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind))
674
+ first = 0
675
+ else:
676
+ self.file.write('\n!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind))
677
+
678
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
679
+ if not env_has_buildtarget:
680
+ self.env['MSVSBUILDTARGET'] = buildtarget
681
+
682
+ # have to write this twice, once with the BASE settings, and once without
683
+ for base in ("BASE ",""):
684
+ self.file.write('# PROP %sUse_MFC 0\n'
685
+ '# PROP %sUse_Debug_Libraries ' % (base, base))
686
+ if 'debug' not in kind.lower():
687
+ self.file.write('0\n')
688
+ else:
689
+ self.file.write('1\n')
690
+ self.file.write('# PROP %sOutput_Dir "%s"\n'
691
+ '# PROP %sIntermediate_Dir "%s"\n' % (base,outdir,base,outdir))
692
+ cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1)
693
+ self.file.write('# PROP %sCmd_Line "%s"\n'
694
+ '# PROP %sRebuild_Opt "-c && %s"\n'
695
+ '# PROP %sTarget_File "%s"\n'
696
+ '# PROP %sBsc_Name ""\n'
697
+ '# PROP %sTarget_Dir ""\n'\
698
+ %(base,cmd,base,cmd,base,buildtarget,base,base))
699
+
700
+ if not env_has_buildtarget:
701
+ del self.env['MSVSBUILDTARGET']
702
+
703
+ self.file.write('\n!ENDIF\n\n'
704
+ '# Begin Target\n\n')
705
+ for kind in confkeys:
706
+ self.file.write('# Name "%s - Win32 %s"\n' % (name,kind))
707
+ self.file.write('\n')
708
+ first = 0
709
+ for kind in confkeys:
710
+ if first == 0:
711
+ self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind))
712
+ first = 1
713
+ else:
714
+ self.file.write('!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind))
715
+ self.file.write('!ENDIF\n\n')
716
+ self.PrintSourceFiles()
717
+ self.file.write('# End Target\n'
718
+ '# End Project\n')
719
+
720
+ if self.nokeep == 0:
721
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
722
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
723
+ pdata = base64.b64encode(pdata).decode()
724
+ self.file.write(pdata + '\n')
725
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
726
+ pdata = base64.b64encode(pdata).decode()
727
+ self.file.write(pdata + '\n')
728
+
729
+ def PrintSourceFiles(self):
730
+ categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat',
731
+ 'Header Files': 'h|hpp|hxx|hm|inl',
732
+ 'Local Headers': 'h|hpp|hxx|hm|inl',
733
+ 'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',
734
+ 'Other Files': ''}
735
+
736
+ for kind in sorted(categories.keys(), key=lambda a: a.lower()):
737
+ if not self.sources[kind]:
738
+ continue # skip empty groups
739
+
740
+ self.file.write('# Begin Group "' + kind + '"\n\n')
741
+ typelist = categories[kind].replace('|', ';')
742
+ self.file.write('# PROP Default_Filter "' + typelist + '"\n')
743
+
744
+ for file in self.sources[kind]:
745
+ file = os.path.normpath(file)
746
+ self.file.write('# Begin Source File\n\n'
747
+ 'SOURCE="' + file + '"\n'
748
+ '# End Source File\n')
749
+ self.file.write('# End Group\n')
750
+
751
+ # add the SConscript file outside of the groups
752
+ self.file.write('# Begin Source File\n\n'
753
+ 'SOURCE="' + str(self.sconscript) + '"\n'
754
+ '# End Source File\n')
755
+
756
+ def Parse(self):
757
+ try:
758
+ dspfile = open(self.dspabs,'r')
759
+ except IOError:
760
+ return # doesn't exist yet, so can't add anything to configs.
761
+
762
+ line = dspfile.readline()
763
+ # skip until marker
764
+ while line:
765
+ if "# End Project" in line:
766
+ break
767
+ line = dspfile.readline()
768
+
769
+ # read to get configs
770
+ line = dspfile.readline()
771
+ datas = line
772
+ while line and line != '\n':
773
+ line = dspfile.readline()
774
+ datas = datas + line
775
+
776
+ # OK, we've found our little pickled cache of data.
777
+ try:
778
+ datas = base64.decodestring(datas)
779
+ data = pickle.loads(datas)
780
+ except KeyboardInterrupt:
781
+ raise
782
+ except Exception:
783
+ return # unable to unpickle any data for some reason
784
+
785
+ self.configs.update(data)
786
+
787
+ # keep reading to get sources
788
+ data = None
789
+ line = dspfile.readline()
790
+ datas = line
791
+ while line and line != '\n':
792
+ line = dspfile.readline()
793
+ datas = datas + line
794
+ dspfile.close()
795
+
796
+ # OK, we've found our little pickled cache of data.
797
+ # it has a "# " in front of it, so we strip that.
798
+ try:
799
+ datas = base64.decodestring(datas)
800
+ data = pickle.loads(datas)
801
+ except KeyboardInterrupt:
802
+ raise
803
+ except:
804
+ return # unable to unpickle any data for some reason
805
+
806
+ self.sources.update(data)
807
+
808
+ def Build(self):
809
+ try:
810
+ self.file = open(self.dspabs,'w')
811
+ except IOError as detail:
812
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
813
+ else:
814
+ self.PrintHeader()
815
+ self.PrintProject()
816
+ self.file.close()
817
+
818
+ V7DSPHeader = """\
819
+ <?xml version="1.0" encoding="%(encoding)s"?>
820
+ <VisualStudioProject
821
+ \tProjectType="Visual C++"
822
+ \tVersion="%(versionstr)s"
823
+ \tName="%(name)s"
824
+ \tProjectGUID="%(project_guid)s"
825
+ %(scc_attrs)s
826
+ \tKeyword="MakeFileProj">
827
+ """
828
+
829
+ V7DSPConfiguration = """\
830
+ \t\t<Configuration
831
+ \t\t\tName="%(variant)s|%(platform)s"
832
+ \t\t\tOutputDirectory="%(outdir)s"
833
+ \t\t\tIntermediateDirectory="%(outdir)s"
834
+ \t\t\tConfigurationType="0"
835
+ \t\t\tUseOfMFC="0"
836
+ \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
837
+ \t\t\t<Tool
838
+ \t\t\t\tName="VCNMakeTool"
839
+ \t\t\t\tBuildCommandLine="%(buildcmd)s"
840
+ \t\t\t\tReBuildCommandLine="%(rebuildcmd)s"
841
+ \t\t\t\tCleanCommandLine="%(cleancmd)s"
842
+ \t\t\t\tOutput="%(runfile)s"/>
843
+ \t\t</Configuration>
844
+ """
845
+
846
+ V8DSPHeader = """\
847
+ <?xml version="1.0" encoding="%(encoding)s"?>
848
+ <VisualStudioProject
849
+ \tProjectType="Visual C++"
850
+ \tVersion="%(versionstr)s"
851
+ \tName="%(name)s"
852
+ \tProjectGUID="%(project_guid)s"
853
+ \tRootNamespace="%(name)s"
854
+ %(scc_attrs)s
855
+ \tKeyword="MakeFileProj">
856
+ """
857
+
858
+ V8DSPConfiguration = """\
859
+ \t\t<Configuration
860
+ \t\t\tName="%(variant)s|%(platform)s"
861
+ \t\t\tConfigurationType="0"
862
+ \t\t\tUseOfMFC="0"
863
+ \t\t\tATLMinimizesCRunTimeLibraryUsage="false"
864
+ \t\t\t>
865
+ \t\t\t<Tool
866
+ \t\t\t\tName="VCNMakeTool"
867
+ \t\t\t\tBuildCommandLine="%(buildcmd)s"
868
+ \t\t\t\tReBuildCommandLine="%(rebuildcmd)s"
869
+ \t\t\t\tCleanCommandLine="%(cleancmd)s"
870
+ \t\t\t\tOutput="%(runfile)s"
871
+ \t\t\t\tPreprocessorDefinitions="%(preprocdefs)s"
872
+ \t\t\t\tIncludeSearchPath="%(includepath)s"
873
+ \t\t\t\tForcedIncludes=""
874
+ \t\t\t\tAssemblySearchPath=""
875
+ \t\t\t\tForcedUsingAssemblies=""
876
+ \t\t\t\tCompileAsManaged=""
877
+ \t\t\t/>
878
+ \t\t</Configuration>
879
+ """
880
+ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
881
+ """Generates a Project file for MSVS .NET"""
882
+
883
+ def __init__(self, dspfile, source, env):
884
+ _DSPGenerator.__init__(self, dspfile, source, env)
885
+ self.version = env['MSVS_VERSION']
886
+ self.version_num, self.suite = msvs_parse_version(self.version)
887
+ if self.version_num >= 9.0:
888
+ self.versionstr = '9.00'
889
+ self.dspheader = V8DSPHeader
890
+ self.dspconfiguration = V8DSPConfiguration
891
+ elif self.version_num >= 8.0:
892
+ self.versionstr = '8.00'
893
+ self.dspheader = V8DSPHeader
894
+ self.dspconfiguration = V8DSPConfiguration
895
+ else:
896
+ if self.version_num >= 7.1:
897
+ self.versionstr = '7.10'
898
+ else:
899
+ self.versionstr = '7.00'
900
+ self.dspheader = V7DSPHeader
901
+ self.dspconfiguration = V7DSPConfiguration
902
+ self.file = None
903
+
904
+ _GenerateV7User.__init__(self, dspfile, source, env)
905
+
906
+ def PrintHeader(self):
907
+ env = self.env
908
+ versionstr = self.versionstr
909
+ name = self.name
910
+ encoding = self.env.subst('$MSVSENCODING')
911
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '')
912
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
913
+ scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
914
+ # MSVS_SCC_LOCAL_PATH is kept for backwards compatibility purpose and should
915
+ # be deprecated as soon as possible.
916
+ scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')
917
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
918
+ scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))
919
+ project_guid = env.get('MSVS_PROJECT_GUID', '')
920
+ if not project_guid:
921
+ project_guid = _generateGUID(self.dspfile, '')
922
+ if scc_provider != '':
923
+ scc_attrs = '\tSccProjectName="%s"\n' % scc_project_name
924
+ if scc_aux_path != '':
925
+ scc_attrs += '\tSccAuxPath="%s"\n' % scc_aux_path
926
+ scc_attrs += ('\tSccLocalPath="%s"\n'
927
+ '\tSccProvider="%s"' % (scc_local_path, scc_provider))
928
+ elif scc_local_path_legacy != '':
929
+ # This case is kept for backwards compatibility purpose and should
930
+ # be deprecated as soon as possible.
931
+ scc_attrs = ('\tSccProjectName="%s"\n'
932
+ '\tSccLocalPath="%s"' % (scc_project_name, scc_local_path_legacy))
933
+ else:
934
+ self.dspheader = self.dspheader.replace('%(scc_attrs)s\n', '')
935
+
936
+ self.file.write(self.dspheader % locals())
937
+
938
+ self.file.write('\t<Platforms>\n')
939
+ for platform in self.platforms:
940
+ self.file.write(
941
+ '\t\t<Platform\n'
942
+ '\t\t\tName="%s"/>\n' % platform)
943
+ self.file.write('\t</Platforms>\n')
944
+
945
+ if self.version_num >= 8.0:
946
+ self.file.write('\t<ToolFiles>\n'
947
+ '\t</ToolFiles>\n')
948
+
949
+ def PrintProject(self):
950
+ self.file.write('\t<Configurations>\n')
951
+
952
+ confkeys = sorted(self.configs.keys())
953
+ for kind in confkeys:
954
+ variant = self.configs[kind].variant
955
+ platform = self.configs[kind].platform
956
+ outdir = self.configs[kind].outdir
957
+ buildtarget = self.configs[kind].buildtarget
958
+ runfile = self.configs[kind].runfile
959
+ cmdargs = self.configs[kind].cmdargs
960
+ cpppaths = self.configs[kind].cpppaths
961
+ cppdefines = self.configs[kind].cppdefines
962
+
963
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
964
+ if not env_has_buildtarget:
965
+ self.env['MSVSBUILDTARGET'] = buildtarget
966
+
967
+ starting = 'echo Starting SCons && '
968
+ if cmdargs:
969
+ cmdargs = ' ' + cmdargs
970
+ else:
971
+ cmdargs = ''
972
+ buildcmd = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)
973
+ rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)
974
+ cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)
975
+
976
+ # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,
977
+ # so they could vary depending on the command being generated. This code
978
+ # assumes they don't.
979
+ preprocdefs = xmlify(';'.join(processDefines(cppdefines)))
980
+ includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))
981
+
982
+ if not env_has_buildtarget:
983
+ del self.env['MSVSBUILDTARGET']
984
+
985
+ self.file.write(self.dspconfiguration % locals())
986
+
987
+ self.file.write('\t</Configurations>\n')
988
+
989
+ if self.version_num >= 7.1:
990
+ self.file.write('\t<References>\n'
991
+ '\t</References>\n')
992
+
993
+ self.PrintSourceFiles()
994
+
995
+ self.file.write('</VisualStudioProject>\n')
996
+
997
+ if self.nokeep == 0:
998
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
999
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
1000
+ pdata = base64.b64encode(pdata).decode()
1001
+ self.file.write('<!-- SCons Data:\n' + pdata + '\n')
1002
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
1003
+ pdata = base64.b64encode(pdata).decode()
1004
+ self.file.write(pdata + '-->\n')
1005
+
1006
+ def printSources(self, hierarchy, commonprefix):
1007
+ sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower())
1008
+
1009
+ # First folders, then files
1010
+ for key, value in sorteditems:
1011
+ if SCons.Util.is_Dict(value):
1012
+ self.file.write('\t\t\t<Filter\n'
1013
+ '\t\t\t\tName="%s"\n'
1014
+ '\t\t\t\tFilter="">\n' % key)
1015
+ self.printSources(value, commonprefix)
1016
+ self.file.write('\t\t\t</Filter>\n')
1017
+
1018
+ for key, value in sorteditems:
1019
+ if SCons.Util.is_String(value):
1020
+ file = value
1021
+ if commonprefix:
1022
+ file = os.path.join(commonprefix, value)
1023
+ file = os.path.normpath(file)
1024
+ self.file.write('\t\t\t<File\n'
1025
+ '\t\t\t\tRelativePath="%s">\n'
1026
+ '\t\t\t</File>\n' % file)
1027
+
1028
+ def PrintSourceFiles(self):
1029
+ categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',
1030
+ 'Header Files': 'h;hpp;hxx;hm;inl',
1031
+ 'Local Headers': 'h;hpp;hxx;hm;inl',
1032
+ 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
1033
+ 'Other Files': ''}
1034
+
1035
+ self.file.write('\t<Files>\n')
1036
+
1037
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
1038
+ key=lambda a: a.lower())
1039
+ for kind in cats:
1040
+ if len(cats) > 1:
1041
+ self.file.write('\t\t<Filter\n'
1042
+ '\t\t\tName="%s"\n'
1043
+ '\t\t\tFilter="%s">\n' % (kind, categories[kind]))
1044
+
1045
+ sources = self.sources[kind]
1046
+
1047
+ # First remove any common prefix
1048
+ commonprefix = None
1049
+ s = list(map(os.path.normpath, sources))
1050
+ # take the dirname because the prefix may include parts
1051
+ # of the filenames (e.g. if you have 'dir\abcd' and
1052
+ # 'dir\acde' then the cp will be 'dir\a' )
1053
+ cp = os.path.dirname( os.path.commonprefix(s) )
1054
+ if cp and s[0][len(cp)] == os.sep:
1055
+ # +1 because the filename starts after the separator
1056
+ sources = [s[len(cp)+1:] for s in sources]
1057
+ commonprefix = cp
1058
+
1059
+ hierarchy = makeHierarchy(sources)
1060
+ self.printSources(hierarchy, commonprefix=commonprefix)
1061
+
1062
+ if len(cats)>1:
1063
+ self.file.write('\t\t</Filter>\n')
1064
+
1065
+ # add the SConscript file outside of the groups
1066
+ self.file.write('\t\t<File\n'
1067
+ '\t\t\tRelativePath="%s">\n'
1068
+ '\t\t</File>\n' % str(self.sconscript))
1069
+
1070
+ self.file.write('\t</Files>\n'
1071
+ '\t<Globals>\n'
1072
+ '\t</Globals>\n')
1073
+
1074
+ def Parse(self):
1075
+ try:
1076
+ dspfile = open(self.dspabs,'r')
1077
+ except IOError:
1078
+ return # doesn't exist yet, so can't add anything to configs.
1079
+
1080
+ line = dspfile.readline()
1081
+ # skip until marker
1082
+ while line:
1083
+ if '<!-- SCons Data:' in line:
1084
+ break
1085
+ line = dspfile.readline()
1086
+
1087
+ # read to get configs
1088
+ line = dspfile.readline()
1089
+ datas = line
1090
+ while line and line != '\n':
1091
+ line = dspfile.readline()
1092
+ datas = datas + line
1093
+
1094
+ # OK, we've found our little pickled cache of data.
1095
+ try:
1096
+ datas = base64.decodestring(datas)
1097
+ data = pickle.loads(datas)
1098
+ except KeyboardInterrupt:
1099
+ raise
1100
+ except:
1101
+ return # unable to unpickle any data for some reason
1102
+
1103
+ self.configs.update(data)
1104
+
1105
+ # keep reading to get sources
1106
+ data = None
1107
+ line = dspfile.readline()
1108
+ datas = line
1109
+ while line and line != '\n':
1110
+ line = dspfile.readline()
1111
+ datas = datas + line
1112
+ dspfile.close()
1113
+
1114
+ # OK, we've found our little pickled cache of data.
1115
+ try:
1116
+ datas = base64.decodestring(datas)
1117
+ data = pickle.loads(datas)
1118
+ except KeyboardInterrupt:
1119
+ raise
1120
+ except:
1121
+ return # unable to unpickle any data for some reason
1122
+
1123
+ self.sources.update(data)
1124
+
1125
+ def Build(self):
1126
+ try:
1127
+ self.file = open(self.dspabs,'w')
1128
+ except IOError as detail:
1129
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
1130
+ else:
1131
+ self.PrintHeader()
1132
+ self.PrintProject()
1133
+ self.file.close()
1134
+
1135
+ _GenerateV7User.Build(self)
1136
+
1137
+ V10DSPHeader = """\
1138
+ <?xml version="1.0" encoding="%(encoding)s"?>
1139
+ <Project DefaultTargets="Build" ToolsVersion="%(versionstr)s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1140
+ """
1141
+
1142
+ V10DSPProjectConfiguration = """\
1143
+ \t\t<ProjectConfiguration Include="%(variant)s|%(platform)s">
1144
+ \t\t\t<Configuration>%(variant)s</Configuration>
1145
+ \t\t\t<Platform>%(platform)s</Platform>
1146
+ \t\t</ProjectConfiguration>
1147
+ """
1148
+
1149
+ V10DSPGlobals = """\
1150
+ \t<PropertyGroup Label="Globals">
1151
+ \t\t<ProjectGuid>%(project_guid)s</ProjectGuid>
1152
+ %(scc_attrs)s\t\t<RootNamespace>%(name)s</RootNamespace>
1153
+ \t\t<Keyword>MakeFileProj</Keyword>
1154
+ \t\t<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
1155
+ \t</PropertyGroup>
1156
+ """
1157
+
1158
+ V10DSPPropertyGroupCondition = """\
1159
+ \t<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">
1160
+ \t\t<ConfigurationType>Makefile</ConfigurationType>
1161
+ \t\t<UseOfMfc>false</UseOfMfc>
1162
+ \t\t<PlatformToolset>%(toolset)s</PlatformToolset>
1163
+ \t</PropertyGroup>
1164
+ """
1165
+
1166
+ V10DSPImportGroupCondition = """\
1167
+ \t<ImportGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="PropertySheets">
1168
+ \t\t<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
1169
+ \t</ImportGroup>
1170
+ """
1171
+
1172
+ V10DSPCommandLine = """\
1173
+ \t\t<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(buildcmd)s</NMakeBuildCommandLine>
1174
+ \t\t<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(rebuildcmd)s</NMakeReBuildCommandLine>
1175
+ \t\t<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(cleancmd)s</NMakeCleanCommandLine>
1176
+ \t\t<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(runfile)s</NMakeOutput>
1177
+ \t\t<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(preprocdefs)s</NMakePreprocessorDefinitions>
1178
+ \t\t<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(includepath)s</NMakeIncludeSearchPath>
1179
+ \t\t<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
1180
+ \t\t<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
1181
+ \t\t<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
1182
+ \t\t<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(additionaloptions)s</AdditionalOptions>
1183
+ """
1184
+
1185
+ V15DSPHeader = """\
1186
+ <?xml version="1.0" encoding="%(encoding)s"?>
1187
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1188
+ """
1189
+
1190
+ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
1191
+ """Generates a Project file for MSVS 2010"""
1192
+
1193
+ def __init__(self, dspfile, source, env):
1194
+ _DSPGenerator.__init__(self, dspfile, source, env)
1195
+ self.dspheader = V10DSPHeader
1196
+ self.dspconfiguration = V10DSPProjectConfiguration
1197
+ self.dspglobals = V10DSPGlobals
1198
+
1199
+ _GenerateV10User.__init__(self, dspfile, source, env)
1200
+
1201
+ def PrintHeader(self):
1202
+ env = self.env
1203
+ name = self.name
1204
+ versionstr = self.versionstr
1205
+ encoding = env.subst('$MSVSENCODING')
1206
+ project_guid = env.get('MSVS_PROJECT_GUID', '')
1207
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '')
1208
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
1209
+ scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
1210
+ # MSVS_SCC_LOCAL_PATH is kept for backwards compatibility purpose and should
1211
+ # be deprecated as soon as possible.
1212
+ scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')
1213
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
1214
+ scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))
1215
+ if not project_guid:
1216
+ project_guid = _generateGUID(self.dspfile, '')
1217
+ if scc_provider != '':
1218
+ scc_attrs = '\t\t<SccProjectName>%s</SccProjectName>\n' % scc_project_name
1219
+ if scc_aux_path != '':
1220
+ scc_attrs += '\t\t<SccAuxPath>%s</SccAuxPath>\n' % scc_aux_path
1221
+ scc_attrs += ('\t\t<SccLocalPath>%s</SccLocalPath>\n'
1222
+ '\t\t<SccProvider>%s</SccProvider>\n' % (scc_local_path, scc_provider))
1223
+ elif scc_local_path_legacy != '':
1224
+ # This case is kept for backwards compatibility purpose and should
1225
+ # be deprecated as soon as possible.
1226
+ scc_attrs = ('\t\t<SccProjectName>%s</SccProjectName>\n'
1227
+ '\t\t<SccLocalPath>%s</SccLocalPath>\n' % (scc_project_name, scc_local_path_legacy))
1228
+ else:
1229
+ self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')
1230
+
1231
+ self.file.write(self.dspheader % locals())
1232
+
1233
+ self.file.write('\t<ItemGroup Label="ProjectConfigurations">\n')
1234
+
1235
+ confkeys = sorted(self.configs.keys())
1236
+ for kind in confkeys:
1237
+ variant = self.configs[kind].variant
1238
+ platform = self.configs[kind].platform
1239
+ self.file.write(self.dspconfiguration % locals())
1240
+
1241
+ self.file.write('\t</ItemGroup>\n')
1242
+
1243
+ self.file.write(self.dspglobals % locals())
1244
+
1245
+ def PrintProject(self):
1246
+ name = self.name
1247
+ confkeys = sorted(self.configs.keys())
1248
+
1249
+ self.file.write('\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.Default.props" />\n')
1250
+
1251
+ toolset = ''
1252
+ if 'MSVC_VERSION' in self.env:
1253
+ version_num, suite = msvs_parse_version(self.env['MSVC_VERSION'])
1254
+ toolset = 'v%d' % (version_num * 10)
1255
+ for kind in confkeys:
1256
+ variant = self.configs[kind].variant
1257
+ platform = self.configs[kind].platform
1258
+ self.file.write(V10DSPPropertyGroupCondition % locals())
1259
+
1260
+ self.file.write('\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />\n')
1261
+ self.file.write('\t<ImportGroup Label="ExtensionSettings">\n')
1262
+ self.file.write('\t</ImportGroup>\n')
1263
+
1264
+ for kind in confkeys:
1265
+ variant = self.configs[kind].variant
1266
+ platform = self.configs[kind].platform
1267
+ self.file.write(V10DSPImportGroupCondition % locals())
1268
+
1269
+ self.file.write('\t<PropertyGroup Label="UserMacros" />\n')
1270
+ self.file.write('\t<PropertyGroup>\n')
1271
+ self.file.write('\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n')
1272
+
1273
+ for kind in confkeys:
1274
+ variant = self.configs[kind].variant
1275
+ platform = self.configs[kind].platform
1276
+ outdir = self.configs[kind].outdir
1277
+ buildtarget = self.configs[kind].buildtarget
1278
+ runfile = self.configs[kind].runfile
1279
+ cmdargs = self.configs[kind].cmdargs
1280
+ cpppaths = self.configs[kind].cpppaths
1281
+ cppdefines = self.configs[kind].cppdefines
1282
+ cppflags = self.configs[kind].cppflags
1283
+
1284
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
1285
+ if not env_has_buildtarget:
1286
+ self.env['MSVSBUILDTARGET'] = buildtarget
1287
+
1288
+ starting = 'echo Starting SCons && '
1289
+ if cmdargs:
1290
+ cmdargs = ' ' + cmdargs
1291
+ else:
1292
+ cmdargs = ''
1293
+ buildcmd = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)
1294
+ rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)
1295
+ cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)
1296
+
1297
+ # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,
1298
+ # so they could vary depending on the command being generated. This code
1299
+ # assumes they don't.
1300
+ preprocdefs = xmlify(';'.join(processDefines(cppdefines)))
1301
+ includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None)))
1302
+ additionaloptions = xmlify(' '.join(processFlags(cppflags, self.env)))
1303
+
1304
+ if not env_has_buildtarget:
1305
+ del self.env['MSVSBUILDTARGET']
1306
+
1307
+ self.file.write(V10DSPCommandLine % locals())
1308
+
1309
+ self.file.write('\t</PropertyGroup>\n')
1310
+
1311
+ #filter settings in MSVS 2010 are stored in separate file
1312
+ self.filtersabs = self.dspabs + '.filters'
1313
+ try:
1314
+ self.filters_file = open(self.filtersabs, 'w')
1315
+ except IOError as detail:
1316
+ raise SCons.Errors.InternalError('Unable to open "' + self.filtersabs + '" for writing:' + str(detail))
1317
+
1318
+ self.filters_file.write('<?xml version="1.0" encoding="utf-8"?>\n'
1319
+ '<Project ToolsVersion="%s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\n' %
1320
+ self.versionstr)
1321
+
1322
+ self.PrintSourceFiles()
1323
+
1324
+ self.filters_file.write('</Project>')
1325
+ self.filters_file.close()
1326
+
1327
+ self.file.write('\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />\n'
1328
+ '\t<ImportGroup Label="ExtensionTargets">\n'
1329
+ '\t</ImportGroup>\n'
1330
+ '</Project>\n')
1331
+
1332
+ if self.nokeep == 0:
1333
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
1334
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
1335
+ pdata = base64.b64encode(pdata).decode()
1336
+ self.file.write('<!-- SCons Data:\n' + pdata + '\n')
1337
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
1338
+ pdata = base64.b64encode(pdata).decode()
1339
+ self.file.write(pdata + '-->\n')
1340
+
1341
+ def printFilters(self, hierarchy, name):
1342
+ sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
1343
+
1344
+ for key, value in sorteditems:
1345
+ if SCons.Util.is_Dict(value):
1346
+ filter_name = name + '\\' + key
1347
+ self.filters_file.write('\t\t<Filter Include="%s">\n'
1348
+ '\t\t\t<UniqueIdentifier>%s</UniqueIdentifier>\n'
1349
+ '\t\t</Filter>\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))
1350
+ self.printFilters(value, filter_name)
1351
+
1352
+ def printSources(self, hierarchy, kind, commonprefix, filter_name):
1353
+ keywords = {'Source Files': 'ClCompile',
1354
+ 'Header Files': 'ClInclude',
1355
+ 'Local Headers': 'ClInclude',
1356
+ 'Resource Files': 'None',
1357
+ 'Other Files': 'None'}
1358
+
1359
+ sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
1360
+
1361
+ # First folders, then files
1362
+ for key, value in sorteditems:
1363
+ if SCons.Util.is_Dict(value):
1364
+ self.printSources(value, kind, commonprefix, filter_name + '\\' + key)
1365
+
1366
+ for key, value in sorteditems:
1367
+ if SCons.Util.is_String(value):
1368
+ file = value
1369
+ if commonprefix:
1370
+ file = os.path.join(commonprefix, value)
1371
+ file = os.path.normpath(file)
1372
+
1373
+ self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file))
1374
+ self.filters_file.write('\t\t<%s Include="%s">\n'
1375
+ '\t\t\t<Filter>%s</Filter>\n'
1376
+ '\t\t</%s>\n' % (keywords[kind], file, filter_name, keywords[kind]))
1377
+
1378
+ def PrintSourceFiles(self):
1379
+ categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',
1380
+ 'Header Files': 'h;hpp;hxx;hm;inl',
1381
+ 'Local Headers': 'h;hpp;hxx;hm;inl',
1382
+ 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
1383
+ 'Other Files': ''}
1384
+
1385
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
1386
+ key = lambda a: a.lower())
1387
+
1388
+ # print vcxproj.filters file first
1389
+ self.filters_file.write('\t<ItemGroup>\n')
1390
+ for kind in cats:
1391
+ self.filters_file.write('\t\t<Filter Include="%s">\n'
1392
+ '\t\t\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\n'
1393
+ '\t\t\t<Extensions>%s</Extensions>\n'
1394
+ '\t\t</Filter>\n' % (kind, categories[kind]))
1395
+
1396
+ # First remove any common prefix
1397
+ sources = self.sources[kind]
1398
+ commonprefix = None
1399
+ s = list(map(os.path.normpath, sources))
1400
+ # take the dirname because the prefix may include parts
1401
+ # of the filenames (e.g. if you have 'dir\abcd' and
1402
+ # 'dir\acde' then the cp will be 'dir\a' )
1403
+ cp = os.path.dirname( os.path.commonprefix(s) )
1404
+ if cp and s[0][len(cp)] == os.sep:
1405
+ # +1 because the filename starts after the separator
1406
+ sources = [s[len(cp)+1:] for s in sources]
1407
+ commonprefix = cp
1408
+
1409
+ hierarchy = makeHierarchy(sources)
1410
+ self.printFilters(hierarchy, kind)
1411
+
1412
+ self.filters_file.write('\t</ItemGroup>\n')
1413
+
1414
+ # then print files and filters
1415
+ for kind in cats:
1416
+ self.file.write('\t<ItemGroup>\n')
1417
+ self.filters_file.write('\t<ItemGroup>\n')
1418
+
1419
+ # First remove any common prefix
1420
+ sources = self.sources[kind]
1421
+ commonprefix = None
1422
+ s = list(map(os.path.normpath, sources))
1423
+ # take the dirname because the prefix may include parts
1424
+ # of the filenames (e.g. if you have 'dir\abcd' and
1425
+ # 'dir\acde' then the cp will be 'dir\a' )
1426
+ cp = os.path.dirname( os.path.commonprefix(s) )
1427
+ if cp and s[0][len(cp)] == os.sep:
1428
+ # +1 because the filename starts after the separator
1429
+ sources = [s[len(cp)+1:] for s in sources]
1430
+ commonprefix = cp
1431
+
1432
+ hierarchy = makeHierarchy(sources)
1433
+ self.printSources(hierarchy, kind, commonprefix, kind)
1434
+
1435
+ self.file.write('\t</ItemGroup>\n')
1436
+ self.filters_file.write('\t</ItemGroup>\n')
1437
+
1438
+ # add the SConscript file outside of the groups
1439
+ self.file.write('\t<ItemGroup>\n'
1440
+ '\t\t<None Include="%s" />\n'
1441
+ #'\t\t<None Include="SConstruct" />\n'
1442
+ '\t</ItemGroup>\n' % str(self.sconscript))
1443
+
1444
+ def Parse(self):
1445
+ # DEBUG
1446
+ # print("_GenerateV10DSP.Parse()")
1447
+ pass
1448
+
1449
+ def Build(self):
1450
+ try:
1451
+ self.file = open(self.dspabs, 'w')
1452
+ except IOError as detail:
1453
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
1454
+ else:
1455
+ self.PrintHeader()
1456
+ self.PrintProject()
1457
+ self.file.close()
1458
+
1459
+ _GenerateV10User.Build(self)
1460
+
1461
+ class _DSWGenerator:
1462
+ """ Base class for DSW generators """
1463
+ def __init__(self, dswfile, source, env):
1464
+ self.dswfile = os.path.normpath(str(dswfile))
1465
+ self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile))
1466
+ self.env = env
1467
+
1468
+ if 'projects' not in env:
1469
+ raise SCons.Errors.UserError("You must specify a 'projects' argument to create an MSVSSolution.")
1470
+ projects = env['projects']
1471
+ if not SCons.Util.is_List(projects):
1472
+ raise SCons.Errors.InternalError("The 'projects' argument must be a list of nodes.")
1473
+ projects = SCons.Util.flatten(projects)
1474
+ if len(projects) < 1:
1475
+ raise SCons.Errors.UserError("You must specify at least one project to create an MSVSSolution.")
1476
+ self.dspfiles = list(map(str, projects))
1477
+
1478
+ if 'name' in self.env:
1479
+ self.name = self.env['name']
1480
+ else:
1481
+ self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0])
1482
+ self.name = self.env.subst(self.name)
1483
+
1484
+ def Build(self):
1485
+ pass
1486
+
1487
+ class _GenerateV7DSW(_DSWGenerator):
1488
+ """Generates a Solution file for MSVS .NET"""
1489
+ def __init__(self, dswfile, source, env):
1490
+ _DSWGenerator.__init__(self, dswfile, source, env)
1491
+
1492
+ self.file = None
1493
+ self.version = self.env['MSVS_VERSION']
1494
+ self.version_num, self.suite = msvs_parse_version(self.version)
1495
+ self.versionstr = '7.00'
1496
+ if self.version_num >= 11.0:
1497
+ self.versionstr = '12.00'
1498
+ elif self.version_num >= 10.0:
1499
+ self.versionstr = '11.00'
1500
+ elif self.version_num >= 9.0:
1501
+ self.versionstr = '10.00'
1502
+ elif self.version_num >= 8.0:
1503
+ self.versionstr = '9.00'
1504
+ elif self.version_num >= 7.1:
1505
+ self.versionstr = '8.00'
1506
+
1507
+ if 'slnguid' in env and env['slnguid']:
1508
+ self.slnguid = env['slnguid']
1509
+ else:
1510
+ self.slnguid = _generateGUID(dswfile, self.name)
1511
+
1512
+ self.configs = {}
1513
+
1514
+ self.nokeep = 0
1515
+ if 'nokeep' in env and env['variant'] != 0:
1516
+ self.nokeep = 1
1517
+
1518
+ if self.nokeep == 0 and os.path.exists(self.dswfile):
1519
+ self.Parse()
1520
+
1521
+ def AddConfig(self, variant, dswfile=dswfile):
1522
+ config = Config()
1523
+
1524
+ match = re.match(r'(.*)\|(.*)', variant)
1525
+ if match:
1526
+ config.variant = match.group(1)
1527
+ config.platform = match.group(2)
1528
+ else:
1529
+ config.variant = variant
1530
+ config.platform = 'Win32'
1531
+
1532
+ self.configs[variant] = config
1533
+ # DEBUG
1534
+ # print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dswfile) + "'")
1535
+
1536
+ if 'variant' not in env:
1537
+ raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
1538
+ "'Release') to create an MSVS Solution File.")
1539
+ elif SCons.Util.is_String(env['variant']):
1540
+ AddConfig(self, env['variant'])
1541
+ elif SCons.Util.is_List(env['variant']):
1542
+ for variant in env['variant']:
1543
+ AddConfig(self, variant)
1544
+
1545
+ seen = set()
1546
+ self.platforms = [p.platform for p in self.configs.values()
1547
+ if not (p.platform in seen or seen.add(p.platform))]
1548
+
1549
+ def GenerateProjectFilesInfo(self):
1550
+ for dspfile in self.dspfiles:
1551
+ dsp_folder_path, name = os.path.split(dspfile)
1552
+ dsp_folder_path = os.path.abspath(dsp_folder_path)
1553
+ if SCons.Util.splitext(name)[1] == '.filters':
1554
+ # Ignore .filters project files
1555
+ continue
1556
+ dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path)
1557
+ if dsp_relative_folder_path == os.curdir:
1558
+ dsp_relative_file_path = name
1559
+ else:
1560
+ dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)
1561
+ dspfile_info = {'NAME': name,
1562
+ 'GUID': _generateGUID(dspfile, ''),
1563
+ 'FOLDER_PATH': dsp_folder_path,
1564
+ 'FILE_PATH': dspfile,
1565
+ 'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,
1566
+ 'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}
1567
+ self.dspfiles_info.append(dspfile_info)
1568
+
1569
+ self.dspfiles_info = []
1570
+ GenerateProjectFilesInfo(self)
1571
+
1572
+ def Parse(self):
1573
+ try:
1574
+ dswfile = open(self.dswfile,'r')
1575
+ except IOError:
1576
+ return # doesn't exist yet, so can't add anything to configs.
1577
+
1578
+ line = dswfile.readline()
1579
+ while line:
1580
+ if line[:9] == "EndGlobal":
1581
+ break
1582
+ line = dswfile.readline()
1583
+
1584
+ line = dswfile.readline()
1585
+ datas = line
1586
+ while line:
1587
+ line = dswfile.readline()
1588
+ datas = datas + line
1589
+ dswfile.close()
1590
+
1591
+ # OK, we've found our little pickled cache of data.
1592
+ try:
1593
+ datas = base64.decodestring(datas)
1594
+ data = pickle.loads(datas)
1595
+ except KeyboardInterrupt:
1596
+ raise
1597
+ except:
1598
+ return # unable to unpickle any data for some reason
1599
+
1600
+ self.configs.update(data)
1601
+
1602
+ def PrintSolution(self):
1603
+ """Writes a solution file"""
1604
+ self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr)
1605
+ if self.version_num >= 14.3:
1606
+ # Visual Studio 2022 is considered to be version 17.
1607
+ self.file.write('# Visual Studio 17\n')
1608
+ elif self.version_num >= 14.2:
1609
+ # Visual Studio 2019 is considered to be version 16.
1610
+ self.file.write('# Visual Studio 16\n')
1611
+ elif self.version_num > 14.0:
1612
+ # Visual Studio 2015 and 2017 are both considered to be version 15.
1613
+ self.file.write('# Visual Studio 15\n')
1614
+ elif self.version_num >= 12.0:
1615
+ self.file.write('# Visual Studio 14\n')
1616
+ elif self.version_num >= 11.0:
1617
+ self.file.write('# Visual Studio 11\n')
1618
+ elif self.version_num >= 10.0:
1619
+ self.file.write('# Visual Studio 2010\n')
1620
+ elif self.version_num >= 9.0:
1621
+ self.file.write('# Visual Studio 2008\n')
1622
+ elif self.version_num >= 8.0:
1623
+ self.file.write('# Visual Studio 2005\n')
1624
+
1625
+ for dspinfo in self.dspfiles_info:
1626
+ name = dspinfo['NAME']
1627
+ base, suffix = SCons.Util.splitext(name)
1628
+ if suffix == '.vcproj':
1629
+ name = base
1630
+ self.file.write('Project("%s") = "%s", "%s", "%s"\n'
1631
+ % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))
1632
+ if 7.1 <= self.version_num < 8.0:
1633
+ self.file.write('\tProjectSection(ProjectDependencies) = postProject\n'
1634
+ '\tEndProjectSection\n')
1635
+ self.file.write('EndProject\n')
1636
+
1637
+ self.file.write('Global\n')
1638
+
1639
+ env = self.env
1640
+ if 'MSVS_SCC_PROVIDER' in env:
1641
+ scc_number_of_projects = len(self.dspfiles) + 1
1642
+ slnguid = self.slnguid
1643
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\u0020')
1644
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\u0020')
1645
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
1646
+ scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\', '\\\\')
1647
+ self.file.write('\tGlobalSection(SourceCodeControl) = preSolution\n'
1648
+ '\t\tSccNumberOfProjects = %(scc_number_of_projects)d\n'
1649
+ '\t\tSccProjectName0 = %(scc_project_name)s\n'
1650
+ '\t\tSccLocalPath0 = %(scc_local_path)s\n'
1651
+ '\t\tSccProvider0 = %(scc_provider)s\n'
1652
+ '\t\tCanCheckoutShared = true\n' % locals())
1653
+ sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root)
1654
+ if sln_relative_path_from_scc != os.curdir:
1655
+ self.file.write('\t\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\n'
1656
+ % sln_relative_path_from_scc.replace('\\', '\\\\'))
1657
+ if self.version_num < 8.0:
1658
+ # When present, SolutionUniqueID is automatically removed by VS 2005
1659
+ # TODO: check for Visual Studio versions newer than 2005
1660
+ self.file.write('\t\tSolutionUniqueID = %s\n' % slnguid)
1661
+ for dspinfo in self.dspfiles_info:
1662
+ i = self.dspfiles_info.index(dspinfo) + 1
1663
+ dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\', '\\\\')
1664
+ dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\', '\\\\')
1665
+ self.file.write('\t\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\n'
1666
+ '\t\tSccLocalPath%(i)d = %(scc_local_path)s\n'
1667
+ '\t\tCanCheckoutShared = true\n'
1668
+ '\t\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\n'
1669
+ % locals())
1670
+ self.file.write('\tEndGlobalSection\n')
1671
+ if self.version_num >= 8.0:
1672
+ self.file.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n')
1673
+ else:
1674
+ self.file.write('\tGlobalSection(SolutionConfiguration) = preSolution\n')
1675
+
1676
+ confkeys = sorted(self.configs.keys())
1677
+ cnt = 0
1678
+ for name in confkeys:
1679
+ variant = self.configs[name].variant
1680
+ platform = self.configs[name].platform
1681
+ if self.version_num >= 8.0:
1682
+ self.file.write('\t\t%s|%s = %s|%s\n' % (variant, platform, variant, platform))
1683
+ else:
1684
+ self.file.write('\t\tConfigName.%d = %s\n' % (cnt, variant))
1685
+ cnt = cnt + 1
1686
+ self.file.write('\tEndGlobalSection\n')
1687
+ if self.version_num <= 7.1:
1688
+ self.file.write('\tGlobalSection(ProjectDependencies) = postSolution\n'
1689
+ '\tEndGlobalSection\n')
1690
+ if self.version_num >= 8.0:
1691
+ self.file.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n')
1692
+ else:
1693
+ self.file.write('\tGlobalSection(ProjectConfiguration) = postSolution\n')
1694
+
1695
+ for name in confkeys:
1696
+ variant = self.configs[name].variant
1697
+ platform = self.configs[name].platform
1698
+ if self.version_num >= 8.0:
1699
+ for dspinfo in self.dspfiles_info:
1700
+ guid = dspinfo['GUID']
1701
+ self.file.write('\t\t%s.%s|%s.ActiveCfg = %s|%s\n'
1702
+ '\t\t%s.%s|%s.Build.0 = %s|%s\n' % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))
1703
+ else:
1704
+ for dspinfo in self.dspfiles_info:
1705
+ guid = dspinfo['GUID']
1706
+ self.file.write('\t\t%s.%s.ActiveCfg = %s|%s\n'
1707
+ '\t\t%s.%s.Build.0 = %s|%s\n' %(guid,variant,variant,platform,guid,variant,variant,platform))
1708
+
1709
+ self.file.write('\tEndGlobalSection\n')
1710
+
1711
+ if self.version_num >= 8.0:
1712
+ self.file.write('\tGlobalSection(SolutionProperties) = preSolution\n'
1713
+ '\t\tHideSolutionNode = FALSE\n'
1714
+ '\tEndGlobalSection\n')
1715
+ else:
1716
+ self.file.write('\tGlobalSection(ExtensibilityGlobals) = postSolution\n'
1717
+ '\tEndGlobalSection\n'
1718
+ '\tGlobalSection(ExtensibilityAddIns) = postSolution\n'
1719
+ '\tEndGlobalSection\n')
1720
+ self.file.write('EndGlobal\n')
1721
+ if self.nokeep == 0:
1722
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
1723
+ pdata = base64.b64encode(pdata).decode()
1724
+ self.file.write(pdata)
1725
+ self.file.write('\n')
1726
+
1727
+ def Build(self):
1728
+ try:
1729
+ self.file = open(self.dswfile,'w')
1730
+ except IOError as detail:
1731
+ raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
1732
+ else:
1733
+ self.PrintSolution()
1734
+ self.file.close()
1735
+
1736
+ V6DSWHeader = """\
1737
+ Microsoft Developer Studio Workspace File, Format Version 6.00
1738
+ # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
1739
+
1740
+ ###############################################################################
1741
+
1742
+ Project: "%(name)s"="%(dspfile)s" - Package Owner=<4>
1743
+
1744
+ Package=<5>
1745
+ {{{
1746
+ }}}
1747
+
1748
+ Package=<4>
1749
+ {{{
1750
+ }}}
1751
+
1752
+ ###############################################################################
1753
+
1754
+ Global:
1755
+
1756
+ Package=<5>
1757
+ {{{
1758
+ }}}
1759
+
1760
+ Package=<3>
1761
+ {{{
1762
+ }}}
1763
+
1764
+ ###############################################################################
1765
+ """
1766
+
1767
+ class _GenerateV6DSW(_DSWGenerator):
1768
+ """Generates a Workspace file for MSVS 6.0"""
1769
+
1770
+ def PrintWorkspace(self):
1771
+ """ writes a DSW file """
1772
+ name = self.name
1773
+ dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path)
1774
+ self.file.write(V6DSWHeader % locals())
1775
+
1776
+ def Build(self):
1777
+ try:
1778
+ self.file = open(self.dswfile,'w')
1779
+ except IOError as detail:
1780
+ raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
1781
+ else:
1782
+ self.PrintWorkspace()
1783
+ self.file.close()
1784
+
1785
+
1786
+ def GenerateDSP(dspfile, source, env):
1787
+ """Generates a Project file based on the version of MSVS that is being used"""
1788
+
1789
+ version_num = 6.0
1790
+ if 'MSVS_VERSION' in env:
1791
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1792
+ if version_num >= 10.0:
1793
+ g = _GenerateV10DSP(dspfile, source, env)
1794
+ g.Build()
1795
+ elif version_num >= 7.0:
1796
+ g = _GenerateV7DSP(dspfile, source, env)
1797
+ g.Build()
1798
+ else:
1799
+ g = _GenerateV6DSP(dspfile, source, env)
1800
+ g.Build()
1801
+
1802
+ def GenerateDSW(dswfile, source, env):
1803
+ """Generates a Solution/Workspace file based on the version of MSVS that is being used"""
1804
+
1805
+ version_num = 6.0
1806
+ if 'MSVS_VERSION' in env:
1807
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1808
+ if version_num >= 7.0:
1809
+ g = _GenerateV7DSW(dswfile, source, env)
1810
+ g.Build()
1811
+ else:
1812
+ g = _GenerateV6DSW(dswfile, source, env)
1813
+ g.Build()
1814
+
1815
+
1816
+ ##############################################################################
1817
+ # Above here are the classes and functions for generation of
1818
+ # DSP/DSW/SLN/VCPROJ files.
1819
+ ##############################################################################
1820
+
1821
+ def GetMSVSProjectSuffix(target, source, env, for_signature):
1822
+ return env['MSVS']['PROJECTSUFFIX']
1823
+
1824
+ def GetMSVSSolutionSuffix(target, source, env, for_signature):
1825
+ return env['MSVS']['SOLUTIONSUFFIX']
1826
+
1827
+ def GenerateProject(target, source, env):
1828
+ # generate the dsp file, according to the version of MSVS.
1829
+ builddspfile = target[0]
1830
+ dspfile = builddspfile.srcnode()
1831
+
1832
+ # this detects whether or not we're using a VariantDir
1833
+ if dspfile is not builddspfile:
1834
+ try:
1835
+ bdsp = open(str(builddspfile), "w+")
1836
+ except IOError as detail:
1837
+ print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n')
1838
+ raise
1839
+
1840
+ bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath())
1841
+ bdsp.close()
1842
+
1843
+ GenerateDSP(dspfile, source, env)
1844
+
1845
+ if env.get('auto_build_solution', 1):
1846
+ builddswfile = target[1]
1847
+ dswfile = builddswfile.srcnode()
1848
+
1849
+ if dswfile is not builddswfile:
1850
+
1851
+ try:
1852
+ bdsw = open(str(builddswfile), "w+")
1853
+ except IOError as detail:
1854
+ print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n')
1855
+ raise
1856
+
1857
+ bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath())
1858
+ bdsw.close()
1859
+
1860
+ GenerateDSW(dswfile, source, env)
1861
+
1862
+ def GenerateSolution(target, source, env):
1863
+ GenerateDSW(target[0], source, env)
1864
+
1865
+ def projectEmitter(target, source, env):
1866
+ """Sets up the DSP dependencies."""
1867
+
1868
+ # todo: Not sure what sets source to what user has passed as target,
1869
+ # but this is what happens. When that is fixed, we also won't have
1870
+ # to make the user always append env['MSVSPROJECTSUFFIX'] to target.
1871
+ if source[0] == target[0]:
1872
+ source = []
1873
+
1874
+ # make sure the suffix is correct for the version of MSVS we're running.
1875
+ (base, suff) = SCons.Util.splitext(str(target[0]))
1876
+ suff = env.subst('$MSVSPROJECTSUFFIX')
1877
+ target[0] = base + suff
1878
+
1879
+ if not source:
1880
+ source = 'prj_inputs:'
1881
+ source = source + env.subst('$MSVSSCONSCOM', 1)
1882
+ source = source + env.subst('$MSVSENCODING', 1)
1883
+
1884
+ # Project file depends on CPPDEFINES and CPPPATH
1885
+ preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', []))))
1886
+ includepath = xmlify(';'.join(processIncludes(env.get('CPPPATH', []), env, None, None)))
1887
+ source = source + "; ppdefs:%s incpath:%s"%(preprocdefs, includepath)
1888
+
1889
+ if 'buildtarget' in env and env['buildtarget'] is not None:
1890
+ if SCons.Util.is_String(env['buildtarget']):
1891
+ source = source + ' "%s"' % env['buildtarget']
1892
+ elif SCons.Util.is_List(env['buildtarget']):
1893
+ for bt in env['buildtarget']:
1894
+ if SCons.Util.is_String(bt):
1895
+ source = source + ' "%s"' % bt
1896
+ else:
1897
+ try: source = source + ' "%s"' % bt.get_abspath()
1898
+ except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None")
1899
+ else:
1900
+ try: source = source + ' "%s"' % env['buildtarget'].get_abspath()
1901
+ except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None")
1902
+
1903
+ if 'outdir' in env and env['outdir'] is not None:
1904
+ if SCons.Util.is_String(env['outdir']):
1905
+ source = source + ' "%s"' % env['outdir']
1906
+ elif SCons.Util.is_List(env['outdir']):
1907
+ for s in env['outdir']:
1908
+ if SCons.Util.is_String(s):
1909
+ source = source + ' "%s"' % s
1910
+ else:
1911
+ try: source = source + ' "%s"' % s.get_abspath()
1912
+ except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None")
1913
+ else:
1914
+ try: source = source + ' "%s"' % env['outdir'].get_abspath()
1915
+ except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None")
1916
+
1917
+ if 'name' in env:
1918
+ if SCons.Util.is_String(env['name']):
1919
+ source = source + ' "%s"' % env['name']
1920
+ else:
1921
+ raise SCons.Errors.InternalError("name must be a string")
1922
+
1923
+ if 'variant' in env:
1924
+ if SCons.Util.is_String(env['variant']):
1925
+ source = source + ' "%s"' % env['variant']
1926
+ elif SCons.Util.is_List(env['variant']):
1927
+ for variant in env['variant']:
1928
+ if SCons.Util.is_String(variant):
1929
+ source = source + ' "%s"' % variant
1930
+ else:
1931
+ raise SCons.Errors.InternalError("name must be a string or a list of strings")
1932
+ else:
1933
+ raise SCons.Errors.InternalError("variant must be a string or a list of strings")
1934
+ else:
1935
+ raise SCons.Errors.InternalError("variant must be specified")
1936
+
1937
+ for s in _DSPGenerator.srcargs:
1938
+ if s in env:
1939
+ if SCons.Util.is_String(env[s]):
1940
+ source = source + ' "%s' % env[s]
1941
+ elif SCons.Util.is_List(env[s]):
1942
+ for t in env[s]:
1943
+ if SCons.Util.is_String(t):
1944
+ source = source + ' "%s"' % t
1945
+ else:
1946
+ raise SCons.Errors.InternalError(s + " must be a string or a list of strings")
1947
+ else:
1948
+ raise SCons.Errors.InternalError(s + " must be a string or a list of strings")
1949
+
1950
+ source = source + ' "%s"' % str(target[0])
1951
+ source = [SCons.Node.Python.Value(source)]
1952
+
1953
+ targetlist = [target[0]]
1954
+ sourcelist = source
1955
+
1956
+ if env.get('auto_build_solution', 1):
1957
+ env['projects'] = [env.File(t).srcnode() for t in targetlist]
1958
+ t, s = solutionEmitter(target, target, env)
1959
+ targetlist = targetlist + t
1960
+
1961
+ # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)
1962
+ version_num = 6.0
1963
+ if 'MSVS_VERSION' in env:
1964
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1965
+ if version_num >= 10.0:
1966
+ targetlist.append(targetlist[0] + '.filters')
1967
+
1968
+ return (targetlist, sourcelist)
1969
+
1970
+ def solutionEmitter(target, source, env):
1971
+ """Sets up the DSW dependencies."""
1972
+
1973
+ # todo: Not sure what sets source to what user has passed as target,
1974
+ # but this is what happens. When that is fixed, we also won't have
1975
+ # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target.
1976
+ if source[0] == target[0]:
1977
+ source = []
1978
+
1979
+ # make sure the suffix is correct for the version of MSVS we're running.
1980
+ (base, suff) = SCons.Util.splitext(str(target[0]))
1981
+ suff = env.subst('$MSVSSOLUTIONSUFFIX')
1982
+ target[0] = base + suff
1983
+
1984
+ if not source:
1985
+ source = 'sln_inputs:'
1986
+
1987
+ if 'name' in env:
1988
+ if SCons.Util.is_String(env['name']):
1989
+ source = source + ' "%s"' % env['name']
1990
+ else:
1991
+ raise SCons.Errors.InternalError("name must be a string")
1992
+
1993
+ if 'variant' in env:
1994
+ if SCons.Util.is_String(env['variant']):
1995
+ source = source + ' "%s"' % env['variant']
1996
+ elif SCons.Util.is_List(env['variant']):
1997
+ for variant in env['variant']:
1998
+ if SCons.Util.is_String(variant):
1999
+ source = source + ' "%s"' % variant
2000
+ else:
2001
+ raise SCons.Errors.InternalError("name must be a string or a list of strings")
2002
+ else:
2003
+ raise SCons.Errors.InternalError("variant must be a string or a list of strings")
2004
+ else:
2005
+ raise SCons.Errors.InternalError("variant must be specified")
2006
+
2007
+ if 'slnguid' in env:
2008
+ if SCons.Util.is_String(env['slnguid']):
2009
+ source = source + ' "%s"' % env['slnguid']
2010
+ else:
2011
+ raise SCons.Errors.InternalError("slnguid must be a string")
2012
+
2013
+ if 'projects' in env:
2014
+ if SCons.Util.is_String(env['projects']):
2015
+ source = source + ' "%s"' % env['projects']
2016
+ elif SCons.Util.is_List(env['projects']):
2017
+ for t in env['projects']:
2018
+ if SCons.Util.is_String(t):
2019
+ source = source + ' "%s"' % t
2020
+
2021
+ source = source + ' "%s"' % str(target[0])
2022
+ source = [SCons.Node.Python.Value(source)]
2023
+
2024
+ return ([target[0]], source)
2025
+
2026
+ projectAction = SCons.Action.Action(GenerateProject, None)
2027
+
2028
+ solutionAction = SCons.Action.Action(GenerateSolution, None)
2029
+
2030
+ projectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM',
2031
+ suffix = '$MSVSPROJECTSUFFIX',
2032
+ emitter = projectEmitter)
2033
+
2034
+ solutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM',
2035
+ suffix = '$MSVSSOLUTIONSUFFIX',
2036
+ emitter = solutionEmitter)
2037
+
2038
+ default_MSVS_SConscript = None
2039
+
2040
+ def generate(env):
2041
+ """Add Builders and construction variables for Microsoft Visual
2042
+ Studio project files to an Environment."""
2043
+ try:
2044
+ env['BUILDERS']['MSVSProject']
2045
+ except KeyError:
2046
+ env['BUILDERS']['MSVSProject'] = projectBuilder
2047
+
2048
+ try:
2049
+ env['BUILDERS']['MSVSSolution']
2050
+ except KeyError:
2051
+ env['BUILDERS']['MSVSSolution'] = solutionBuilder
2052
+
2053
+ env['MSVSPROJECTCOM'] = projectAction
2054
+ env['MSVSSOLUTIONCOM'] = solutionAction
2055
+
2056
+ if SCons.Script.call_stack:
2057
+ # XXX Need to find a way to abstract this; the build engine
2058
+ # shouldn't depend on anything in SCons.Script.
2059
+ env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript
2060
+ else:
2061
+ global default_MSVS_SConscript
2062
+ if default_MSVS_SConscript is None:
2063
+ default_MSVS_SConscript = env.File('SConstruct')
2064
+ env['MSVSSCONSCRIPT'] = default_MSVS_SConscript
2065
+
2066
+ # Allow consumers to provide their own versions of MSVSSCONS and
2067
+ # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to
2068
+ # invoke scons.
2069
+ if 'MSVSSCONS' not in env:
2070
+ env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env))
2071
+ if 'MSVSSCONSFLAGS' not in env:
2072
+ env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}'
2073
+
2074
+ env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'
2075
+ env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
2076
+ env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
2077
+ env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c "$MSVSBUILDTARGET"'
2078
+
2079
+ # Set-up ms tools paths for default version
2080
+ msvc_setup_env_once(env)
2081
+
2082
+ if 'MSVS_VERSION' in env:
2083
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
2084
+ else:
2085
+ (version_num, suite) = (7.0, None) # guess at a default
2086
+ if 'MSVS' not in env:
2087
+ env['MSVS'] = {}
2088
+ if version_num < 7.0:
2089
+ env['MSVS']['PROJECTSUFFIX'] = '.dsp'
2090
+ env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'
2091
+ elif version_num < 10.0:
2092
+ env['MSVS']['PROJECTSUFFIX'] = '.vcproj'
2093
+ env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
2094
+ else:
2095
+ env['MSVS']['PROJECTSUFFIX'] = '.vcxproj'
2096
+ env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
2097
+
2098
+ if version_num >= 10.0:
2099
+ env['MSVSENCODING'] = 'utf-8'
2100
+ else:
2101
+ env['MSVSENCODING'] = 'Windows-1252'
2102
+
2103
+ env['GET_MSVSPROJECTSUFFIX'] = GetMSVSProjectSuffix
2104
+ env['GET_MSVSSOLUTIONSUFFIX'] = GetMSVSSolutionSuffix
2105
+ env['MSVSPROJECTSUFFIX'] = '${GET_MSVSPROJECTSUFFIX}'
2106
+ env['MSVSSOLUTIONSUFFIX'] = '${GET_MSVSSOLUTIONSUFFIX}'
2107
+ env['SCONS_HOME'] = os.environ.get('SCONS_HOME')
2108
+
2109
+ def exists(env):
2110
+ return msvc_exists(env)
2111
+
2112
+ # Local Variables:
2113
+ # tab-width:4
2114
+ # indent-tabs-mode:nil
2115
+ # End:
2116
+ # vim: set expandtab tabstop=4 shiftwidth=4: