libv8 3.3.10.2 → 3.3.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +35 -7
  3. data/Rakefile +61 -20
  4. data/ext/libv8/extconf.rb +15 -0
  5. data/lib/libv8/scons/CHANGES.txt +231 -24
  6. data/lib/libv8/scons/LICENSE.txt +1 -1
  7. data/lib/libv8/scons/MANIFEST +1 -0
  8. data/lib/libv8/scons/PKG-INFO +1 -1
  9. data/lib/libv8/scons/README.txt +9 -9
  10. data/lib/libv8/scons/RELEASE.txt +77 -75
  11. data/lib/libv8/scons/engine/SCons/Action.py +22 -6
  12. data/lib/libv8/scons/engine/SCons/Builder.py +2 -2
  13. data/lib/libv8/scons/engine/SCons/CacheDir.py +2 -2
  14. data/lib/libv8/scons/engine/SCons/Debug.py +2 -2
  15. data/lib/libv8/scons/engine/SCons/Defaults.py +24 -10
  16. data/lib/libv8/scons/engine/SCons/Environment.py +118 -19
  17. data/lib/libv8/scons/engine/SCons/Errors.py +2 -2
  18. data/lib/libv8/scons/engine/SCons/Executor.py +2 -2
  19. data/lib/libv8/scons/engine/SCons/Job.py +2 -2
  20. data/lib/libv8/scons/engine/SCons/Memoize.py +2 -2
  21. data/lib/libv8/scons/engine/SCons/Node/Alias.py +2 -2
  22. data/lib/libv8/scons/engine/SCons/Node/FS.py +281 -121
  23. data/lib/libv8/scons/engine/SCons/Node/Python.py +2 -2
  24. data/lib/libv8/scons/engine/SCons/Node/__init__.py +6 -5
  25. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +2 -2
  26. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +2 -2
  27. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +2 -2
  28. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +2 -2
  29. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +2 -2
  30. data/lib/libv8/scons/engine/SCons/Options/__init__.py +2 -2
  31. data/lib/libv8/scons/engine/SCons/PathList.py +2 -2
  32. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +2 -2
  33. data/lib/libv8/scons/engine/SCons/Platform/aix.py +2 -2
  34. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +2 -2
  35. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +27 -3
  36. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +2 -2
  37. data/lib/libv8/scons/engine/SCons/Platform/irix.py +2 -2
  38. data/lib/libv8/scons/engine/SCons/Platform/os2.py +2 -2
  39. data/lib/libv8/scons/engine/SCons/Platform/posix.py +2 -2
  40. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +2 -2
  41. data/lib/libv8/scons/engine/SCons/Platform/win32.py +2 -2
  42. data/lib/libv8/scons/engine/SCons/SConf.py +2 -2
  43. data/lib/libv8/scons/engine/SCons/SConsign.py +9 -3
  44. data/lib/libv8/scons/engine/SCons/Scanner/C.py +2 -2
  45. data/lib/libv8/scons/engine/SCons/Scanner/D.py +2 -2
  46. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +2 -2
  47. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +2 -2
  48. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +2 -2
  49. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +5 -2
  50. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +2 -2
  51. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +3 -3
  52. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +2 -2
  53. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +2 -2
  54. data/lib/libv8/scons/engine/SCons/Script/Main.py +82 -11
  55. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +5 -5
  56. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +2 -2
  57. data/lib/libv8/scons/engine/SCons/Script/__init__.py +2 -2
  58. data/lib/libv8/scons/engine/SCons/Sig.py +2 -2
  59. data/lib/libv8/scons/engine/SCons/Subst.py +2 -2
  60. data/lib/libv8/scons/engine/SCons/Taskmaster.py +10 -2
  61. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +2 -2
  62. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +2 -2
  63. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +2 -2
  64. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +19 -2
  65. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +2 -2
  66. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +2 -2
  67. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +2 -2
  68. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +2 -2
  69. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +2 -2
  70. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +2 -2
  71. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +9 -6
  72. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +29 -2
  73. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +2 -2
  74. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +2 -2
  75. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +2 -2
  76. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +2 -2
  77. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +2 -2
  78. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +3 -3
  79. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +2 -2
  80. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +2 -2
  81. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +2 -2
  82. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +2 -2
  83. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +2 -2
  84. data/lib/libv8/scons/engine/SCons/Tool/ar.py +2 -2
  85. data/lib/libv8/scons/engine/SCons/Tool/as.py +2 -2
  86. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +2 -2
  87. data/lib/libv8/scons/engine/SCons/Tool/c++.py +2 -2
  88. data/lib/libv8/scons/engine/SCons/Tool/cc.py +2 -2
  89. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +2 -2
  90. data/lib/libv8/scons/engine/SCons/Tool/default.py +2 -2
  91. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +24 -7
  92. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +2 -2
  93. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +3 -2
  94. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +3 -2
  95. data/lib/libv8/scons/engine/SCons/Tool/f03.py +63 -0
  96. data/lib/libv8/scons/engine/SCons/Tool/f77.py +2 -2
  97. data/lib/libv8/scons/engine/SCons/Tool/f90.py +2 -2
  98. data/lib/libv8/scons/engine/SCons/Tool/f95.py +2 -2
  99. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +2 -2
  100. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +2 -2
  101. data/lib/libv8/scons/engine/SCons/Tool/g++.py +2 -2
  102. data/lib/libv8/scons/engine/SCons/Tool/g77.py +2 -2
  103. data/lib/libv8/scons/engine/SCons/Tool/gas.py +2 -2
  104. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +2 -2
  105. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +3 -3
  106. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +2 -3
  107. data/lib/libv8/scons/engine/SCons/Tool/gs.py +2 -2
  108. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +2 -2
  109. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +2 -2
  110. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +2 -2
  111. data/lib/libv8/scons/engine/SCons/Tool/icc.py +2 -2
  112. data/lib/libv8/scons/engine/SCons/Tool/icl.py +2 -2
  113. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +2 -2
  114. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +2 -2
  115. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +2 -2
  116. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +2 -2
  117. data/lib/libv8/scons/engine/SCons/Tool/install.py +57 -3
  118. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +65 -25
  119. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +2 -2
  120. data/lib/libv8/scons/engine/SCons/Tool/jar.py +9 -3
  121. data/lib/libv8/scons/engine/SCons/Tool/javac.py +2 -2
  122. data/lib/libv8/scons/engine/SCons/Tool/javah.py +2 -2
  123. data/lib/libv8/scons/engine/SCons/Tool/latex.py +3 -2
  124. data/lib/libv8/scons/engine/SCons/Tool/lex.py +2 -2
  125. data/lib/libv8/scons/engine/SCons/Tool/link.py +6 -5
  126. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +2 -2
  127. data/lib/libv8/scons/engine/SCons/Tool/m4.py +2 -2
  128. data/lib/libv8/scons/engine/SCons/Tool/masm.py +2 -2
  129. data/lib/libv8/scons/engine/SCons/Tool/midl.py +2 -2
  130. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +31 -10
  131. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +2 -2
  132. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +61 -9
  133. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +2 -2
  134. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +21 -11
  135. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +477 -59
  136. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +2 -2
  137. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +2 -2
  138. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +2 -2
  139. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +2 -2
  140. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +2 -2
  141. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +2 -2
  142. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +2 -2
  143. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +2 -2
  144. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +2 -2
  145. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +2 -2
  146. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +2 -2
  147. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +2 -2
  148. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +2 -2
  149. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +2 -2
  150. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +3 -2
  151. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +3 -2
  152. data/lib/libv8/scons/engine/SCons/Tool/qt.py +2 -2
  153. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +9 -3
  154. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +2 -2
  155. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +2 -2
  156. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +2 -2
  157. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +2 -2
  158. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +2 -2
  159. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +2 -3
  160. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +2 -2
  161. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +2 -2
  162. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +2 -2
  163. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +2 -2
  164. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +2 -2
  165. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +2 -2
  166. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +2 -3
  167. data/lib/libv8/scons/engine/SCons/Tool/swig.py +6 -5
  168. data/lib/libv8/scons/engine/SCons/Tool/tar.py +2 -2
  169. data/lib/libv8/scons/engine/SCons/Tool/tex.py +96 -43
  170. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +2 -2
  171. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +2 -2
  172. data/lib/libv8/scons/engine/SCons/Tool/wix.py +2 -2
  173. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +12 -2
  174. data/lib/libv8/scons/engine/SCons/Tool/zip.py +2 -2
  175. data/lib/libv8/scons/engine/SCons/Util.py +3 -3
  176. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +2 -2
  177. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +3 -3
  178. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +2 -2
  179. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +2 -2
  180. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +2 -2
  181. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +2 -2
  182. data/lib/libv8/scons/engine/SCons/Warnings.py +2 -2
  183. data/lib/libv8/scons/engine/SCons/__init__.py +6 -6
  184. data/lib/libv8/scons/engine/SCons/compat/__init__.py +2 -2
  185. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +2 -2
  186. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +2 -2
  187. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +2 -2
  188. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +2 -2
  189. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +2 -2
  190. data/lib/libv8/scons/engine/SCons/cpp.py +2 -2
  191. data/lib/libv8/scons/engine/SCons/dblite.py +4 -1
  192. data/lib/libv8/scons/engine/SCons/exitfuncs.py +2 -2
  193. data/lib/libv8/scons/scons-time.1 +3 -3
  194. data/lib/libv8/scons/scons.1 +1209 -1203
  195. data/lib/libv8/scons/sconsign.1 +3 -3
  196. data/lib/libv8/scons/script/scons +22 -22
  197. data/lib/libv8/scons/script/scons-time +2 -2
  198. data/lib/libv8/scons/script/scons.bat +7 -4
  199. data/lib/libv8/scons/script/sconsign +21 -20
  200. data/lib/libv8/scons/setup.cfg +0 -1
  201. data/lib/libv8/scons/setup.py +38 -40
  202. data/lib/libv8/version.rb +4 -2
  203. data/libv8.gemspec +7 -2
  204. metadata +46 -67
@@ -9,7 +9,7 @@ selection method.
9
9
  """
10
10
 
11
11
  #
12
- # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
13
13
  #
14
14
  # Permission is hereby granted, free of charge, to any person obtaining
15
15
  # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
31
31
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
32
  #
33
33
 
34
- __revision__ = "src/engine/SCons/Tool/mslib.py 5134 2010/08/16 23:02:40 bdeegan"
34
+ __revision__ = "src/engine/SCons/Tool/mslib.py 5357 2011/09/09 21:31:03 bdeegan"
35
35
 
36
36
  import SCons.Defaults
37
37
  import SCons.Tool
@@ -9,7 +9,7 @@ selection method.
9
9
  """
10
10
 
11
11
  #
12
- # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
13
13
  #
14
14
  # Permission is hereby granted, free of charge, to any person obtaining
15
15
  # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
31
31
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
32
  #
33
33
 
34
- __revision__ = "src/engine/SCons/Tool/mslink.py 5134 2010/08/16 23:02:40 bdeegan"
34
+ __revision__ = "src/engine/SCons/Tool/mslink.py 5357 2011/09/09 21:31:03 bdeegan"
35
35
 
36
36
  import os.path
37
37
 
@@ -116,8 +116,9 @@ def _dllEmitter(target, source, env, paramtp):
116
116
  "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"))
117
117
 
118
118
  version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))
119
- if version_num >= 8.0 and env.get('WINDOWS_INSERT_MANIFEST', 0):
120
- # MSVC 8 automatically generates .manifest files that must be installed
119
+ if version_num >= 8.0 and \
120
+ (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):
121
+ # MSVC 8 and above automatically generate .manifest files that must be installed
121
122
  extratargets.append(
122
123
  env.ReplaceIxes(dll,
123
124
  '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,
@@ -164,8 +165,9 @@ def prog_emitter(target, source, env):
164
165
  raise SCons.Errors.UserError("An executable should have exactly one target with the suffix: %s" % env.subst("$PROGSUFFIX"))
165
166
 
166
167
  version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))
167
- if version_num >= 8.0 and env.get('WINDOWS_INSERT_MANIFEST', 0):
168
- # MSVC 8 automatically generates .manifest files that have to be installed
168
+ if version_num >= 8.0 and \
169
+ (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)):
170
+ # MSVC 8 and above automatically generate .manifest files that have to be installed
169
171
  extratargets.append(
170
172
  env.ReplaceIxes(exe,
171
173
  "PROGPREFIX", "PROGSUFFIX",
@@ -188,12 +190,50 @@ def RegServerFunc(target, source, env):
188
190
  return ret
189
191
  return 0
190
192
 
193
+ # These are the actual actions run to embed the manifest.
194
+ # They are only called from the Check versions below.
195
+ embedManifestExeAction = SCons.Action.Action('$MTEXECOM')
196
+ embedManifestDllAction = SCons.Action.Action('$MTSHLIBCOM')
197
+
198
+ def embedManifestDllCheck(target, source, env):
199
+ """Function run by embedManifestDllCheckAction to check for existence of manifest
200
+ and other conditions, and embed the manifest by calling embedManifestDllAction if so."""
201
+ if env.get('WINDOWS_EMBED_MANIFEST', 0):
202
+ manifestSrc = target[0].abspath + '.manifest'
203
+ if os.path.exists(manifestSrc):
204
+ ret = (embedManifestDllAction) ([target[0]],None,env)
205
+ if ret:
206
+ raise SCons.Errors.UserError, "Unable to embed manifest into %s" % (target[0])
207
+ return ret
208
+ else:
209
+ print '(embed: no %s.manifest found; not embedding.)'%str(target[0])
210
+ return 0
211
+
212
+ def embedManifestExeCheck(target, source, env):
213
+ """Function run by embedManifestExeCheckAction to check for existence of manifest
214
+ and other conditions, and embed the manifest by calling embedManifestExeAction if so."""
215
+ if env.get('WINDOWS_EMBED_MANIFEST', 0):
216
+ manifestSrc = target[0].abspath + '.manifest'
217
+ if os.path.exists(manifestSrc):
218
+ ret = (embedManifestExeAction) ([target[0]],None,env)
219
+ if ret:
220
+ raise SCons.Errors.UserError, "Unable to embed manifest into %s" % (target[0])
221
+ return ret
222
+ else:
223
+ print '(embed: no %s.manifest found; not embedding.)'%str(target[0])
224
+ return 0
225
+
226
+ embedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None)
227
+ embedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)
228
+
191
229
  regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
192
230
  regServerCheck = SCons.Action.Action(RegServerFunc, None)
193
231
  shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
194
- compositeShLinkAction = shlibLinkAction + regServerCheck
232
+ compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction
195
233
  ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}')
196
- compositeLdmodAction = ldmodLinkAction + regServerCheck
234
+ compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction
235
+ exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}')
236
+ compositeLinkAction = exeLinkAction + embedManifestExeCheckAction
197
237
 
198
238
  def generate(env):
199
239
  """Add Builders and construction variables for ar to an Environment."""
@@ -209,7 +249,7 @@ def generate(env):
209
249
  env['LINK'] = 'link'
210
250
  env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
211
251
  env['_PDB'] = pdbGenerator
212
- env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}'
252
+ env['LINKCOM'] = compositeLinkAction
213
253
  env.Append(PROGEMITTER = [prog_emitter])
214
254
  env['LIBDIRPREFIX']='/LIBPATH:'
215
255
  env['LIBDIRSUFFIX']=''
@@ -238,6 +278,18 @@ def generate(env):
238
278
  env['REGSVRFLAGS'] = '/s '
239
279
  env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'
240
280
 
281
+ env['WINDOWS_EMBED_MANIFEST'] = 0
282
+ env['MT'] = 'mt'
283
+ #env['MTFLAGS'] = ['-hashupdate']
284
+ env['MTFLAGS'] = SCons.Util.CLVar('/nologo')
285
+ # Note: use - here to prevent build failure if no manifest produced.
286
+ # This seems much simpler than a fancy system using a function action to see
287
+ # if the manifest actually exists before trying to run mt with it.
288
+ env['MTEXECOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1'
289
+ env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2'
290
+ # Future work garyo 27-Feb-11
291
+ env['_MANIFEST_SOURCES'] = None # _windowsManifestSources
292
+
241
293
  # Set-up ms tools paths
242
294
  msvc_setup_env_once(env)
243
295
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
2
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
21
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  #
23
23
 
24
- __revision__ = "src/engine/SCons/Tool/mssdk.py 5134 2010/08/16 23:02:40 bdeegan"
24
+ __revision__ = "src/engine/SCons/Tool/mssdk.py 5357 2011/09/09 21:31:03 bdeegan"
25
25
 
26
26
  """engine.SCons.Tool.mssdk
27
27
 
@@ -9,7 +9,7 @@ selection method.
9
9
  """
10
10
 
11
11
  #
12
- # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
13
13
  #
14
14
  # Permission is hereby granted, free of charge, to any person obtaining
15
15
  # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
31
31
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
32
  #
33
33
 
34
- __revision__ = "src/engine/SCons/Tool/msvc.py 5134 2010/08/16 23:02:40 bdeegan"
34
+ __revision__ = "src/engine/SCons/Tool/msvc.py 5357 2011/09/09 21:31:03 bdeegan"
35
35
 
36
36
  import os.path
37
37
  import re
@@ -140,8 +140,13 @@ def msvc_batch_key(action, env, target, source):
140
140
  Returning None specifies that the specified target+source should not
141
141
  be batched with other compilations.
142
142
  """
143
- b = env.subst('$MSVC_BATCH')
144
- if b in (None, '', '0'):
143
+
144
+ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH
145
+ # was set to False. This new version should work better.
146
+ # Note we need to do the env.subst so $MSVC_BATCH can be a reference to
147
+ # another construction variable, which is why we test for False and 0
148
+ # as strings.
149
+ if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):
145
150
  # We're not using batching; return no key.
146
151
  return None
147
152
  t = target[0]
@@ -161,8 +166,13 @@ def msvc_output_flag(target, source, env, for_signature):
161
166
  we return an /Fo string that just specifies the first target's
162
167
  directory (where the Visual C/C++ compiler will put the .obj files).
163
168
  """
164
- b = env.subst('$MSVC_BATCH')
165
- if b in (None, '', '0') or len(source) == 1:
169
+
170
+ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH
171
+ # was set to False. This new version should work better. Removed
172
+ # len(source)==1 as batch mode can compile only one file
173
+ # (and it also fixed problem with compiling only one changed file
174
+ # with batch mode enabled)
175
+ if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):
166
176
  return '/Fo$TARGET'
167
177
  else:
168
178
  # The Visual C/C++ compiler requires a \ at the end of the /Fo
@@ -208,23 +218,23 @@ def generate(env):
208
218
  shared_obj.add_emitter(suffix, shared_object_emitter)
209
219
 
210
220
  env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
211
- env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
221
+ env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s \\\"/Fp%s\\\""%(PCHSTOP or "",File(PCH))) or ""}'])
212
222
  env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag
213
223
  env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'
214
224
  env['CC'] = 'cl'
215
225
  env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
216
226
  env['CFLAGS'] = SCons.Util.CLVar('')
217
- env['CCCOM'] = '$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM'
227
+ env['CCCOM'] = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM")}'
218
228
  env['SHCC'] = '$CC'
219
229
  env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
220
230
  env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
221
- env['SHCCCOM'] = '$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM'
231
+ env['SHCCCOM'] = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM")}'
222
232
  env['CXX'] = '$CC'
223
233
  env['CXXFLAGS'] = SCons.Util.CLVar('$( /TP $)')
224
- env['CXXCOM'] = '$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM'
234
+ env['CXXCOM'] = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM")}'
225
235
  env['SHCXX'] = '$CXX'
226
236
  env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
227
- env['SHCXXCOM'] = '$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM'
237
+ env['SHCXXCOM'] = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM")}'
228
238
  env['CPPDEFPREFIX'] = '/D'
229
239
  env['CPPDEFSUFFIX'] = ''
230
240
  env['INCPREFIX'] = '/I'
@@ -9,7 +9,7 @@ selection method.
9
9
  """
10
10
 
11
11
  #
12
- # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
13
13
  #
14
14
  # Permission is hereby granted, free of charge, to any person obtaining
15
15
  # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
30
30
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
31
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
32
 
33
- __revision__ = "src/engine/SCons/Tool/msvs.py 5134 2010/08/16 23:02:40 bdeegan"
33
+ __revision__ = "src/engine/SCons/Tool/msvs.py 5357 2011/09/09 21:31:03 bdeegan"
34
34
 
35
35
  import SCons.compat
36
36
 
@@ -47,6 +47,7 @@ import SCons.Builder
47
47
  import SCons.Node.FS
48
48
  import SCons.Platform.win32
49
49
  import SCons.Script.SConscript
50
+ import SCons.PathList
50
51
  import SCons.Util
51
52
  import SCons.Warnings
52
53
 
@@ -64,6 +65,12 @@ def xmlify(s):
64
65
  s = s.replace('"', """)
65
66
  return s
66
67
 
68
+ # Process a CPPPATH list in includes, given the env, target and source.
69
+ # Returns a tuple of nodes.
70
+ def processIncludes(includes, env, target, source):
71
+ return SCons.PathList.PathList(includes).subst_path(env, target, source)
72
+
73
+
67
74
  external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'
68
75
 
69
76
  def _generateGUID(slnfile, name):
@@ -92,6 +99,42 @@ def msvs_parse_version(s):
92
99
  num, suite = version_re.match(s).groups()
93
100
  return float(num), suite
94
101
 
102
+ # os.path.relpath has been introduced in Python 2.6
103
+ # We define it locally for earlier versions of Python
104
+ def relpath(path, start=os.path.curdir):
105
+ """Return a relative version of a path"""
106
+ import sys
107
+ if not path:
108
+ raise ValueError("no path specified")
109
+ start_list = os.path.abspath(start).split(os.sep)
110
+ path_list = os.path.abspath(path).split(os.sep)
111
+ if 'posix' in sys.builtin_module_names:
112
+ # Work out how much of the filepath is shared by start and path.
113
+ i = len(os.path.commonprefix([start_list, path_list]))
114
+ else:
115
+ if start_list[0].lower() != path_list[0].lower():
116
+ unc_path, rest = os.path.splitunc(path)
117
+ unc_start, rest = os.path.splitunc(start)
118
+ if bool(unc_path) ^ bool(unc_start):
119
+ raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
120
+ % (path, start))
121
+ else:
122
+ raise ValueError("path is on drive %s, start on drive %s"
123
+ % (path_list[0], start_list[0]))
124
+ # Work out how much of the filepath is shared by start and path.
125
+ for i in range(min(len(start_list), len(path_list))):
126
+ if start_list[i].lower() != path_list[i].lower():
127
+ break
128
+ else:
129
+ i += 1
130
+ rel_list = [os.pardir] * (len(start_list)-i) + path_list[i:]
131
+ if not rel_list:
132
+ return os.path.curdir
133
+ return os.path.join(*rel_list)
134
+
135
+ if not "relpath" in os.path.__all__:
136
+ os.path.relpath = relpath
137
+
95
138
  # This is how we re-invoke SCons from inside MSVS Project files.
96
139
  # The problem is that we might have been invoked as either scons.bat
97
140
  # or scons.py. If we were invoked directly as scons.py, then we could
@@ -516,11 +559,12 @@ class _GenerateV6DSP(_DSPGenerator):
516
559
  self.file.close()
517
560
 
518
561
  V7DSPHeader = """\
519
- <?xml version="1.0" encoding = "%(encoding)s"?>
562
+ <?xml version="1.0" encoding="%(encoding)s"?>
520
563
  <VisualStudioProject
521
564
  \tProjectType="Visual C++"
522
565
  \tVersion="%(versionstr)s"
523
566
  \tName="%(name)s"
567
+ \tProjectGUID="%(project_guid)s"
524
568
  %(scc_attrs)s
525
569
  \tKeyword="MakeFileProj">
526
570
  """
@@ -536,8 +580,8 @@ V7DSPConfiguration = """\
536
580
  \t\t\t<Tool
537
581
  \t\t\t\tName="VCNMakeTool"
538
582
  \t\t\t\tBuildCommandLine="%(buildcmd)s"
583
+ \t\t\t\tReBuildCommandLine="%(rebuildcmd)s"
539
584
  \t\t\t\tCleanCommandLine="%(cleancmd)s"
540
- \t\t\t\tRebuildCommandLine="%(rebuildcmd)s"
541
585
  \t\t\t\tOutput="%(runfile)s"/>
542
586
  \t\t</Configuration>
543
587
  """
@@ -548,8 +592,9 @@ V8DSPHeader = """\
548
592
  \tProjectType="Visual C++"
549
593
  \tVersion="%(versionstr)s"
550
594
  \tName="%(name)s"
551
- %(scc_attrs)s
595
+ \tProjectGUID="%(project_guid)s"
552
596
  \tRootNamespace="%(name)s"
597
+ %(scc_attrs)s
553
598
  \tKeyword="MakeFileProj">
554
599
  """
555
600
 
@@ -582,7 +627,11 @@ class _GenerateV7DSP(_DSPGenerator):
582
627
  _DSPGenerator.__init__(self, dspfile, source, env)
583
628
  self.version = env['MSVS_VERSION']
584
629
  self.version_num, self.suite = msvs_parse_version(self.version)
585
- if self.version_num >= 8.0:
630
+ if self.version_num >= 9.0:
631
+ self.versionstr = '9.00'
632
+ self.dspheader = V8DSPHeader
633
+ self.dspconfiguration = V8DSPConfiguration
634
+ elif self.version_num >= 8.0:
586
635
  self.versionstr = '8.00'
587
636
  self.dspheader = V8DSPHeader
588
637
  self.dspconfiguration = V8DSPConfiguration
@@ -603,20 +652,27 @@ class _GenerateV7DSP(_DSPGenerator):
603
652
  scc_provider = env.get('MSVS_SCC_PROVIDER', '')
604
653
  scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
605
654
  scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
606
- scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
655
+ # MSVS_SCC_LOCAL_PATH is kept for backwards compatibility purpose and should
656
+ # be deprecated as soon as possible.
657
+ scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')
658
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
659
+ scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))
607
660
  project_guid = env.get('MSVS_PROJECT_GUID', '')
608
- if self.version_num >= 8.0 and not project_guid:
661
+ if not project_guid:
609
662
  project_guid = _generateGUID(self.dspfile, '')
610
663
  if scc_provider != '':
611
- scc_attrs = ('\tProjectGUID="%s"\n'
612
- '\tSccProjectName="%s"\n'
613
- '\tSccAuxPath="%s"\n'
614
- '\tSccLocalPath="%s"\n'
615
- '\tSccProvider="%s"' % (project_guid, scc_project_name, scc_aux_path, scc_local_path, scc_provider))
664
+ scc_attrs = '\tSccProjectName="%s"\n' % scc_project_name
665
+ if scc_aux_path != '':
666
+ scc_attrs += '\tSccAuxPath="%s"\n' % scc_aux_path
667
+ scc_attrs += ('\tSccLocalPath="%s"\n'
668
+ '\tSccProvider="%s"' % (scc_local_path, scc_provider))
669
+ elif scc_local_path_legacy != '':
670
+ # This case is kept for backwards compatibility purpose and should
671
+ # be deprecated as soon as possible.
672
+ scc_attrs = ('\tSccProjectName="%s"\n'
673
+ '\tSccLocalPath="%s"' % (scc_project_name, scc_local_path_legacy))
616
674
  else:
617
- scc_attrs = ('\tProjectGUID="%s"\n'
618
- '\tSccProjectName="%s"\n'
619
- '\tSccLocalPath="%s"' % (project_guid, scc_project_name, scc_local_path))
675
+ self.dspheader = self.dspheader.replace('%(scc_attrs)s\n', '')
620
676
 
621
677
  self.file.write(self.dspheader % locals())
622
678
 
@@ -656,9 +712,13 @@ class _GenerateV7DSP(_DSPGenerator):
656
712
  rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)
657
713
  cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)
658
714
 
715
+ # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,
716
+ # so they could vary depending on the command being generated. This code
717
+ # assumes they don't.
659
718
  preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))
660
- includepath = xmlify(';'.join(self.env.get('CPPPATH', [])))
661
-
719
+ includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None)
720
+ includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))
721
+
662
722
  if not env_has_buildtarget:
663
723
  del self.env['MSVSBUILDTARGET']
664
724
 
@@ -811,11 +871,322 @@ class _GenerateV7DSP(_DSPGenerator):
811
871
  self.PrintHeader()
812
872
  self.PrintProject()
813
873
  self.file.close()
874
+
875
+ V10DSPHeader = """\
876
+ <?xml version="1.0" encoding="%(encoding)s"?>
877
+ <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
878
+ """
879
+
880
+ V10DSPProjectConfiguration = """\
881
+ \t\t<ProjectConfiguration Include="%(variant)s|%(platform)s">
882
+ \t\t\t<Configuration>%(variant)s</Configuration>
883
+ \t\t\t<Platform>%(platform)s</Platform>
884
+ \t\t</ProjectConfiguration>
885
+ """
886
+
887
+ V10DSPGlobals = """\
888
+ \t<PropertyGroup Label="Globals">
889
+ \t\t<ProjectGuid>%(project_guid)s</ProjectGuid>
890
+ %(scc_attrs)s\t\t<RootNamespace>%(name)s</RootNamespace>
891
+ \t\t<Keyword>MakeFileProj</Keyword>
892
+ \t</PropertyGroup>
893
+ """
894
+
895
+ V10DSPPropertyGroupCondition = """\
896
+ \t<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">
897
+ \t\t<ConfigurationType>Makefile</ConfigurationType>
898
+ \t\t<UseOfMfc>false</UseOfMfc>
899
+ \t</PropertyGroup>
900
+ """
901
+
902
+ V10DSPImportGroupCondition = """\
903
+ \t<ImportGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="PropertySheets">
904
+ \t\t<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
905
+ \t</ImportGroup>
906
+ """
907
+
908
+ V10DSPCommandLine = """\
909
+ \t\t<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(buildcmd)s</NMakeBuildCommandLine>
910
+ \t\t<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(rebuildcmd)s</NMakeReBuildCommandLine>
911
+ \t\t<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(cleancmd)s</NMakeCleanCommandLine>
912
+ \t\t<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(runfile)s</NMakeOutput>
913
+ \t\t<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(preprocdefs)s</NMakePreprocessorDefinitions>
914
+ \t\t<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">%(includepath)s</NMakeIncludeSearchPath>
915
+ \t\t<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
916
+ \t\t<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
917
+ \t\t<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
918
+ """
919
+
920
+ class _GenerateV10DSP(_DSPGenerator):
921
+ """Generates a Project file for MSVS 2010"""
922
+
923
+ def __init__(self, dspfile, source, env):
924
+ _DSPGenerator.__init__(self, dspfile, source, env)
925
+
926
+ self.dspheader = V10DSPHeader
927
+ self.dspconfiguration = V10DSPProjectConfiguration
928
+ self.dspglobals = V10DSPGlobals
929
+
930
+ def PrintHeader(self):
931
+ env = self.env
932
+ name = self.name
933
+ encoding = env.subst('$MSVSENCODING')
934
+ project_guid = env.get('MSVS_PROJECT_GUID', '')
935
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '')
936
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
937
+ scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
938
+ # MSVS_SCC_LOCAL_PATH is kept for backwards compatibility purpose and should
939
+ # be deprecated as soon as possible.
940
+ scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '')
941
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
942
+ scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs))
943
+ if not project_guid:
944
+ project_guid = _generateGUID(self.dspfile, '')
945
+ if scc_provider != '':
946
+ scc_attrs = '\t\t<SccProjectName>%s</SccProjectName>\n' % scc_project_name
947
+ if scc_aux_path != '':
948
+ scc_attrs += '\t\t<SccAuxPath>%s</SccAuxPath>\n' % scc_aux_path
949
+ scc_attrs += ('\t\t<SccLocalPath>%s</SccLocalPath>\n'
950
+ '\t\t<SccProvider>%s</SccProvider>\n' % (scc_local_path, scc_provider))
951
+ elif scc_local_path_legacy != '':
952
+ # This case is kept for backwards compatibility purpose and should
953
+ # be deprecated as soon as possible.
954
+ scc_attrs = ('\t\t<SccProjectName>%s</SccProjectName>\n'
955
+ '\t\t<SccLocalPath>%s</SccLocalPath>\n' % (scc_project_name, scc_local_path_legacy))
956
+ else:
957
+ self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')
958
+
959
+ self.file.write(self.dspheader % locals())
960
+
961
+ self.file.write('\t<ItemGroup Label="ProjectConfigurations">\n')
962
+
963
+ confkeys = sorted(self.configs.keys())
964
+ for kind in confkeys:
965
+ variant = self.configs[kind].variant
966
+ platform = self.configs[kind].platform
967
+ self.file.write(self.dspconfiguration % locals())
968
+
969
+ self.file.write('\t</ItemGroup>\n')
970
+
971
+ self.file.write(self.dspglobals % locals())
972
+
973
+ def PrintProject(self):
974
+ name = self.name
975
+ confkeys = sorted(self.configs.keys())
976
+
977
+ self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\n')
978
+
979
+ for kind in confkeys:
980
+ variant = self.configs[kind].variant
981
+ platform = self.configs[kind].platform
982
+ self.file.write(V10DSPPropertyGroupCondition % locals())
983
+
984
+ self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\n')
985
+ self.file.write('\t<ImportGroup Label="ExtensionSettings">\n')
986
+ self.file.write('\t</ImportGroup>\n')
987
+
988
+ for kind in confkeys:
989
+ variant = self.configs[kind].variant
990
+ platform = self.configs[kind].platform
991
+ self.file.write(V10DSPImportGroupCondition % locals())
992
+
993
+ self.file.write('\t<PropertyGroup Label="UserMacros" />\n')
994
+ self.file.write('\t<PropertyGroup>\n')
995
+ self.file.write('\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n')
996
+
997
+ for kind in confkeys:
998
+ variant = self.configs[kind].variant
999
+ platform = self.configs[kind].platform
1000
+ outdir = self.configs[kind].outdir
1001
+ buildtarget = self.configs[kind].buildtarget
1002
+ runfile = self.configs[kind].runfile
1003
+ cmdargs = self.configs[kind].cmdargs
1004
+
1005
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
1006
+ if not env_has_buildtarget:
1007
+ self.env['MSVSBUILDTARGET'] = buildtarget
1008
+
1009
+ starting = 'echo Starting SCons && '
1010
+ if cmdargs:
1011
+ cmdargs = ' ' + cmdargs
1012
+ else:
1013
+ cmdargs = ''
1014
+ buildcmd = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)
1015
+ rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)
1016
+ cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)
1017
+
1018
+ # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE,
1019
+ # so they could vary depending on the command being generated. This code
1020
+ # assumes they don't.
1021
+ preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))
1022
+ includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None)
1023
+ includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))
1024
+
1025
+ if not env_has_buildtarget:
1026
+ del self.env['MSVSBUILDTARGET']
1027
+
1028
+ self.file.write(V10DSPCommandLine % locals())
1029
+
1030
+ self.file.write('\t</PropertyGroup>\n')
1031
+
1032
+ #filter settings in MSVS 2010 are stored in separate file
1033
+ self.filtersabs = self.dspabs + '.filters'
1034
+ try:
1035
+ self.filters_file = open(self.filtersabs, 'w')
1036
+ except IOError, detail:
1037
+ raise SCons.Errors.InternalError('Unable to open "' + self.filtersabs + '" for writing:' + str(detail))
1038
+
1039
+ self.filters_file.write('<?xml version="1.0" encoding="utf-8"?>\n'
1040
+ '<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\n')
1041
+
1042
+ self.PrintSourceFiles()
1043
+
1044
+ self.filters_file.write('</Project>')
1045
+ self.filters_file.close()
1046
+
1047
+ self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\n'
1048
+ '\t<ImportGroup Label="ExtensionTargets">\n'
1049
+ '\t</ImportGroup>\n'
1050
+ '</Project>\n')
1051
+
1052
+ if self.nokeep == 0:
1053
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
1054
+ pdata = pickle.dumps(self.configs,1)
1055
+ pdata = base64.encodestring(pdata)
1056
+ self.file.write('<!-- SCons Data:\n' + pdata + '\n')
1057
+ pdata = pickle.dumps(self.sources,1)
1058
+ pdata = base64.encodestring(pdata)
1059
+ self.file.write(pdata + '-->\n')
1060
+
1061
+ def printFilters(self, hierarchy, name):
1062
+ sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
1063
+
1064
+ for key, value in sorteditems:
1065
+ if SCons.Util.is_Dict(value):
1066
+ filter_name = name + '\\' + key
1067
+ self.filters_file.write('\t\t<Filter Include="%s">\n'
1068
+ '\t\t\t<UniqueIdentifier>%s</UniqueIdentifier>\n'
1069
+ '\t\t</Filter>\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))
1070
+ self.printFilters(value, filter_name)
1071
+
1072
+ def printSources(self, hierarchy, kind, commonprefix, filter_name):
1073
+ keywords = {'Source Files': 'ClCompile',
1074
+ 'Header Files': 'ClInclude',
1075
+ 'Local Headers': 'ClInclude',
1076
+ 'Resource Files': 'None',
1077
+ 'Other Files': 'None'}
1078
+
1079
+ sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
1080
+
1081
+ # First folders, then files
1082
+ for key, value in sorteditems:
1083
+ if SCons.Util.is_Dict(value):
1084
+ self.printSources(value, kind, commonprefix, filter_name + '\\' + key)
1085
+
1086
+ for key, value in sorteditems:
1087
+ if SCons.Util.is_String(value):
1088
+ file = value
1089
+ if commonprefix:
1090
+ file = os.path.join(commonprefix, value)
1091
+ file = os.path.normpath(file)
1092
+
1093
+ self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file))
1094
+ self.filters_file.write('\t\t<%s Include="%s">\n'
1095
+ '\t\t\t<Filter>%s</Filter>\n'
1096
+ '\t\t</%s>\n' % (keywords[kind], file, filter_name, keywords[kind]))
1097
+
1098
+ def PrintSourceFiles(self):
1099
+ categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',
1100
+ 'Header Files': 'h;hpp;hxx;hm;inl',
1101
+ 'Local Headers': 'h;hpp;hxx;hm;inl',
1102
+ 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
1103
+ 'Other Files': ''}
1104
+
1105
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
1106
+ key = lambda a: a.lower())
1107
+
1108
+ # print vcxproj.filters file first
1109
+ self.filters_file.write('\t<ItemGroup>\n')
1110
+ for kind in cats:
1111
+ self.filters_file.write('\t\t<Filter Include="%s">\n'
1112
+ '\t\t\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\n'
1113
+ '\t\t\t<Extensions>%s</Extensions>\n'
1114
+ '\t\t</Filter>\n' % (kind, categories[kind]))
1115
+
1116
+ # First remove any common prefix
1117
+ sources = self.sources[kind]
1118
+ commonprefix = None
1119
+ if len(sources) > 1:
1120
+ s = list(map(os.path.normpath, sources))
1121
+ # take the dirname because the prefix may include parts
1122
+ # of the filenames (e.g. if you have 'dir\abcd' and
1123
+ # 'dir\acde' then the cp will be 'dir\a' )
1124
+ cp = os.path.dirname( os.path.commonprefix(s) )
1125
+ if cp and s[0][len(cp)] == os.sep:
1126
+ # +1 because the filename starts after the separator
1127
+ sources = [s[len(cp)+1:] for s in sources]
1128
+ commonprefix = cp
1129
+ elif len(sources) == 1:
1130
+ commonprefix = os.path.dirname( sources[0] )
1131
+ sources[0] = os.path.basename( sources[0] )
1132
+
1133
+ hierarchy = makeHierarchy(sources)
1134
+ self.printFilters(hierarchy, kind)
1135
+
1136
+ self.filters_file.write('\t</ItemGroup>\n')
1137
+
1138
+ # then print files and filters
1139
+ for kind in cats:
1140
+ self.file.write('\t<ItemGroup>\n')
1141
+ self.filters_file.write('\t<ItemGroup>\n')
1142
+
1143
+ # First remove any common prefix
1144
+ sources = self.sources[kind]
1145
+ commonprefix = None
1146
+ if len(sources) > 1:
1147
+ s = list(map(os.path.normpath, sources))
1148
+ # take the dirname because the prefix may include parts
1149
+ # of the filenames (e.g. if you have 'dir\abcd' and
1150
+ # 'dir\acde' then the cp will be 'dir\a' )
1151
+ cp = os.path.dirname( os.path.commonprefix(s) )
1152
+ if cp and s[0][len(cp)] == os.sep:
1153
+ # +1 because the filename starts after the separator
1154
+ sources = [s[len(cp)+1:] for s in sources]
1155
+ commonprefix = cp
1156
+ elif len(sources) == 1:
1157
+ commonprefix = os.path.dirname( sources[0] )
1158
+ sources[0] = os.path.basename( sources[0] )
1159
+
1160
+ hierarchy = makeHierarchy(sources)
1161
+ self.printSources(hierarchy, kind, commonprefix, kind)
1162
+
1163
+ self.file.write('\t</ItemGroup>\n')
1164
+ self.filters_file.write('\t</ItemGroup>\n')
1165
+
1166
+ # add the SConscript file outside of the groups
1167
+ self.file.write('\t<ItemGroup>\n'
1168
+ '\t\t<None Include="%s" />\n'
1169
+ #'\t\t<None Include="SConstruct" />\n'
1170
+ '\t</ItemGroup>\n' % str(self.sconscript))
1171
+
1172
+ def Parse(self):
1173
+ print "_GenerateV10DSP.Parse()"
1174
+
1175
+ def Build(self):
1176
+ try:
1177
+ self.file = open(self.dspabs, 'w')
1178
+ except IOError, detail:
1179
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
1180
+ else:
1181
+ self.PrintHeader()
1182
+ self.PrintProject()
1183
+ self.file.close()
814
1184
 
815
1185
  class _DSWGenerator(object):
816
1186
  """ Base class for DSW generators """
817
1187
  def __init__(self, dswfile, source, env):
818
1188
  self.dswfile = os.path.normpath(str(dswfile))
1189
+ self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile))
819
1190
  self.env = env
820
1191
 
821
1192
  if 'projects' not in env:
@@ -846,12 +1217,14 @@ class _GenerateV7DSW(_DSWGenerator):
846
1217
  self.version = self.env['MSVS_VERSION']
847
1218
  self.version_num, self.suite = msvs_parse_version(self.version)
848
1219
  self.versionstr = '7.00'
849
- if self.version_num >= 8.0:
1220
+ if self.version_num >= 10.0:
1221
+ self.versionstr = '11.00'
1222
+ elif self.version_num >= 9.0:
1223
+ self.versionstr = '10.00'
1224
+ elif self.version_num >= 8.0:
850
1225
  self.versionstr = '9.00'
851
1226
  elif self.version_num >= 7.1:
852
1227
  self.versionstr = '8.00'
853
- if self.version_num >= 8.0:
854
- self.versionstr = '9.00'
855
1228
 
856
1229
  if 'slnguid' in env and env['slnguid']:
857
1230
  self.slnguid = env['slnguid']
@@ -896,6 +1269,26 @@ class _GenerateV7DSW(_DSWGenerator):
896
1269
  if not platform in self.platforms:
897
1270
  self.platforms.append(platform)
898
1271
 
1272
+ def GenerateProjectFilesInfo(self):
1273
+ for dspfile in self.dspfiles:
1274
+ dsp_folder_path, name = os.path.split(dspfile)
1275
+ dsp_folder_path = os.path.abspath(dsp_folder_path)
1276
+ dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path)
1277
+ if dsp_relative_folder_path == os.curdir:
1278
+ dsp_relative_file_path = name
1279
+ else:
1280
+ dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)
1281
+ dspfile_info = {'NAME': name,
1282
+ 'GUID': _generateGUID(dspfile, ''),
1283
+ 'FOLDER_PATH': dsp_folder_path,
1284
+ 'FILE_PATH': dspfile,
1285
+ 'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,
1286
+ 'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}
1287
+ self.dspfiles_info.append(dspfile_info)
1288
+
1289
+ self.dspfiles_info = []
1290
+ GenerateProjectFilesInfo(self)
1291
+
899
1292
  def Parse(self):
900
1293
  try:
901
1294
  dswfile = open(self.dswfile,'r')
@@ -928,16 +1321,19 @@ class _GenerateV7DSW(_DSWGenerator):
928
1321
  def PrintSolution(self):
929
1322
  """Writes a solution file"""
930
1323
  self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr )
931
- if self.version_num >= 8.0:
1324
+ if self.version_num >= 10.0:
1325
+ self.file.write('# Visual Studio 2010\n')
1326
+ elif self.version_num >= 9.0:
1327
+ self.file.write('# Visual Studio 2008\n')
1328
+ elif self.version_num >= 8.0:
932
1329
  self.file.write('# Visual Studio 2005\n')
933
- for p in self.dspfiles:
934
- name = os.path.basename(p)
1330
+ for dspinfo in self.dspfiles_info:
1331
+ name = dspinfo['NAME']
935
1332
  base, suffix = SCons.Util.splitext(name)
936
1333
  if suffix == '.vcproj':
937
1334
  name = base
938
- guid = _generateGUID(p, '')
939
1335
  self.file.write('Project("%s") = "%s", "%s", "%s"\n'
940
- % ( external_makefile_guid, name, p, guid ) )
1336
+ % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))
941
1337
  if self.version_num >= 7.1 and self.version_num < 8.0:
942
1338
  self.file.write('\tProjectSection(ProjectDependencies) = postProject\n'
943
1339
  '\tEndProjectSection\n')
@@ -947,30 +1343,36 @@ class _GenerateV7DSW(_DSWGenerator):
947
1343
 
948
1344
  env = self.env
949
1345
  if 'MSVS_SCC_PROVIDER' in env:
950
- dspfile_base = os.path.basename(self.dspfile)
1346
+ scc_number_of_projects = len(self.dspfiles) + 1
951
1347
  slnguid = self.slnguid
952
- scc_provider = env.get('MSVS_SCC_PROVIDER', '')
953
- scc_provider = scc_provider.replace(' ', r'\u0020')
954
- scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
955
- # scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
956
- scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
957
- scc_project_base_path = env.get('MSVS_SCC_PROJECT_BASE_PATH', '')
958
- # project_guid = env.get('MSVS_PROJECT_GUID', '')
959
-
1348
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\u0020')
1349
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\u0020')
1350
+ scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir)
1351
+ scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\', '\\\\')
960
1352
  self.file.write('\tGlobalSection(SourceCodeControl) = preSolution\n'
961
- '\t\tSccNumberOfProjects = 2\n'
962
- '\t\tSccProjectUniqueName0 = %(dspfile_base)s\n'
1353
+ '\t\tSccNumberOfProjects = %(scc_number_of_projects)d\n'
1354
+ '\t\tSccProjectName0 = %(scc_project_name)s\n'
963
1355
  '\t\tSccLocalPath0 = %(scc_local_path)s\n'
964
- '\t\tCanCheckoutShared = true\n'
965
- '\t\tSccProjectFilePathRelativizedFromConnection0 = %(scc_project_base_path)s\n'
966
- '\t\tSccProjectName1 = %(scc_project_name)s\n'
967
- '\t\tSccLocalPath1 = %(scc_local_path)s\n'
968
- '\t\tSccProvider1 = %(scc_provider)s\n'
969
- '\t\tCanCheckoutShared = true\n'
970
- '\t\tSccProjectFilePathRelativizedFromConnection1 = %(scc_project_base_path)s\n'
971
- '\t\tSolutionUniqueID = %(slnguid)s\n'
972
- '\tEndGlobalSection\n' % locals())
973
-
1356
+ '\t\tSccProvider0 = %(scc_provider)s\n'
1357
+ '\t\tCanCheckoutShared = true\n' % locals())
1358
+ sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root)
1359
+ if sln_relative_path_from_scc != os.curdir:
1360
+ self.file.write('\t\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\n'
1361
+ % sln_relative_path_from_scc.replace('\\', '\\\\'))
1362
+ if self.version_num < 8.0:
1363
+ # When present, SolutionUniqueID is automatically removed by VS 2005
1364
+ # TODO: check for Visual Studio versions newer than 2005
1365
+ self.file.write('\t\tSolutionUniqueID = %s\n' % slnguid)
1366
+ for dspinfo in self.dspfiles_info:
1367
+ i = self.dspfiles_info.index(dspinfo) + 1
1368
+ dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\', '\\\\')
1369
+ dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\', '\\\\')
1370
+ self.file.write('\t\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\n'
1371
+ '\t\tSccLocalPath%(i)d = %(scc_local_path)s\n'
1372
+ '\t\tCanCheckoutShared = true\n'
1373
+ '\t\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\n'
1374
+ % locals())
1375
+ self.file.write('\tEndGlobalSection\n')
974
1376
  if self.version_num >= 8.0:
975
1377
  self.file.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n')
976
1378
  else:
@@ -987,7 +1389,7 @@ class _GenerateV7DSW(_DSWGenerator):
987
1389
  self.file.write('\t\tConfigName.%d = %s\n' % (cnt, variant))
988
1390
  cnt = cnt + 1
989
1391
  self.file.write('\tEndGlobalSection\n')
990
- if self.version_num < 7.1:
1392
+ if self.version_num <= 7.1:
991
1393
  self.file.write('\tGlobalSection(ProjectDependencies) = postSolution\n'
992
1394
  '\tEndGlobalSection\n')
993
1395
  if self.version_num >= 8.0:
@@ -999,13 +1401,13 @@ class _GenerateV7DSW(_DSWGenerator):
999
1401
  variant = self.configs[name].variant
1000
1402
  platform = self.configs[name].platform
1001
1403
  if self.version_num >= 8.0:
1002
- for p in self.dspfiles:
1003
- guid = _generateGUID(p, '')
1404
+ for dspinfo in self.dspfiles_info:
1405
+ guid = dspinfo['GUID']
1004
1406
  self.file.write('\t\t%s.%s|%s.ActiveCfg = %s|%s\n'
1005
1407
  '\t\t%s.%s|%s.Build.0 = %s|%s\n' % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))
1006
1408
  else:
1007
- for p in self.dspfiles:
1008
- guid = _generateGUID(p, '')
1409
+ for dspinfo in self.dspfiles_info:
1410
+ guid = dspinfo['GUID']
1009
1411
  self.file.write('\t\t%s.%s.ActiveCfg = %s|%s\n'
1010
1412
  '\t\t%s.%s.Build.0 = %s|%s\n' %(guid,variant,variant,platform,guid,variant,variant,platform))
1011
1413
 
@@ -1072,7 +1474,7 @@ class _GenerateV6DSW(_DSWGenerator):
1072
1474
  def PrintWorkspace(self):
1073
1475
  """ writes a DSW file """
1074
1476
  name = self.name
1075
- dspfile = self.dspfiles[0]
1477
+ dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path)
1076
1478
  self.file.write(V6DSWHeader % locals())
1077
1479
 
1078
1480
  def Build(self):
@@ -1091,7 +1493,10 @@ def GenerateDSP(dspfile, source, env):
1091
1493
  version_num = 6.0
1092
1494
  if 'MSVS_VERSION' in env:
1093
1495
  version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1094
- if version_num >= 7.0:
1496
+ if version_num >= 10.0:
1497
+ g = _GenerateV10DSP(dspfile, source, env)
1498
+ g.Build()
1499
+ elif version_num >= 7.0:
1095
1500
  g = _GenerateV7DSP(dspfile, source, env)
1096
1501
  g.Build()
1097
1502
  else:
@@ -1118,10 +1523,10 @@ def GenerateDSW(dswfile, source, env):
1118
1523
  ##############################################################################
1119
1524
 
1120
1525
  def GetMSVSProjectSuffix(target, source, env, for_signature):
1121
- return env['MSVS']['PROJECTSUFFIX']
1526
+ return env['MSVS']['PROJECTSUFFIX']
1122
1527
 
1123
1528
  def GetMSVSSolutionSuffix(target, source, env, for_signature):
1124
- return env['MSVS']['SOLUTIONSUFFIX']
1529
+ return env['MSVS']['SOLUTIONSUFFIX']
1125
1530
 
1126
1531
  def GenerateProject(target, source, env):
1127
1532
  # generate the dsp file, according to the version of MSVS.
@@ -1178,6 +1583,12 @@ def projectEmitter(target, source, env):
1178
1583
  source = source + env.subst('$MSVSSCONSCOM', 1)
1179
1584
  source = source + env.subst('$MSVSENCODING', 1)
1180
1585
 
1586
+ # Project file depends on CPPDEFINES and CPPPATH
1587
+ preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', []))))
1588
+ includepath_Dirs = processIncludes(env.get('CPPPATH', []), env, None, None)
1589
+ includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))
1590
+ source = source + "; ppdefs:%s incpath:%s"%(preprocdefs, includepath)
1591
+
1181
1592
  if 'buildtarget' in env and env['buildtarget'] != None:
1182
1593
  if SCons.Util.is_String(env['buildtarget']):
1183
1594
  source = source + ' "%s"' % env['buildtarget']
@@ -1246,7 +1657,7 @@ def projectEmitter(target, source, env):
1246
1657
  sourcelist = source
1247
1658
 
1248
1659
  if env.get('auto_build_solution', 1):
1249
- env['projects'] = targetlist
1660
+ env['projects'] = [env.File(t).srcnode() for t in targetlist]
1250
1661
  t, s = solutionEmitter(target, target, env)
1251
1662
  targetlist = targetlist + t
1252
1663
 
@@ -1354,7 +1765,6 @@ def generate(env):
1354
1765
  env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
1355
1766
  env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
1356
1767
  env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c "$MSVSBUILDTARGET"'
1357
- env['MSVSENCODING'] = 'Windows-1252'
1358
1768
 
1359
1769
  # Set-up ms tools paths for default version
1360
1770
  msvc_setup_env_once(env)
@@ -1368,9 +1778,17 @@ def generate(env):
1368
1778
  if (version_num < 7.0):
1369
1779
  env['MSVS']['PROJECTSUFFIX'] = '.dsp'
1370
1780
  env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'
1371
- else:
1781
+ elif (version_num < 10.0):
1372
1782
  env['MSVS']['PROJECTSUFFIX'] = '.vcproj'
1373
1783
  env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
1784
+ else:
1785
+ env['MSVS']['PROJECTSUFFIX'] = '.vcxproj'
1786
+ env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
1787
+
1788
+ if (version_num >= 10.0):
1789
+ env['MSVSENCODING'] = 'utf-8'
1790
+ else:
1791
+ env['MSVSENCODING'] = 'Windows-1252'
1374
1792
 
1375
1793
  env['GET_MSVSPROJECTSUFFIX'] = GetMSVSProjectSuffix
1376
1794
  env['GET_MSVSSOLUTIONSUFFIX'] = GetMSVSSolutionSuffix