- Support passing environment override keyword arguments to Command().
+ - Fix use of $MSVS_IGNORE_IDE_PATHS, which was broken when we added
+ support for $MSVS_USE_MFC_DIRS last release.
+
+
RELEASE 0.95 - Mon, 08 Mar 2004 06:43:20 -0600
raise OSError
shutil.copy2 = copy2
save_mkdir = os.mkdir
- def mkdir(dir):
+ def mkdir(dir, mode=0):
pass
os.mkdir = mkdir
old_warn_exceptions = SCons.Warnings.warningAsException(1)
return (include_path, lib_path, exe_path)
-def get_msvc_default_paths(version = None):
+def get_msvc_default_paths(version=None, use_mfc_dirs=0):
"""Return a 3-tuple of (INCLUDE, LIB, PATH) as the values of those
three environment variables that should be set in order to execute
the MSVC tools properly. This will only return the default
pass
if float(version) >= 7.0:
- return _get_msvc7_default_paths(version)
+ return _get_msvc7_default_paths(version, use_mfc_dirs)
else:
- return _get_msvc6_default_paths(version)
+ return _get_msvc6_default_paths(version, use_mfc_dirs)
def validate_vars(env):
"""Validate the PDB, PCH, and PCHSTOP construction variables."""
try:
version = SCons.Tool.msvs.get_default_visualstudio_version(env)
- if env.has_key('MSVS_IGNORE_IDE_PATHS') and env['MSVS_IGNORE_IDE_PATHS']:
- include_path, lib_path, exe_path = get_msvc_default_paths(version)
+ # By default, add the MFC directories, because this is what
+ # we've been doing for a long time. We may change this.
+ use_mfc_dirs = env.get('MSVS_USE_MFC_DIRS', 1)
+ if env.get('MSVS_IGNORE_IDE_PATHS', 0):
+ _get_paths = get_msvc_default_paths
else:
- # By default, add the MFC directories, because this is what
- # we've been doing for a long time. We may change this.
- use_mfc_dirs = env.get('MSVS_USE_MFC_DIRS', 1)
- include_path, lib_path, exe_path = get_msvc_paths(version, use_mfc_dirs)
+ _get_paths = get_msvc_paths
+ include_path, lib_path, exe_path = _get_paths(version, use_mfc_dirs)
# since other tools can set these, we just make sure that the
# relevant stuff from MSVS is in there somewhere.
test = TestSCons.TestSCons()
-test.write('copy.py', """\
+test.write('my_copy.py', """\
import sys
open(sys.argv[2], 'wb').write(open(sys.argv[1], 'rb').read())
try:
""")
test.write('SConstruct', """\
-Execute("%s copy.py a.in a.out")
-Execute(Action("%s copy.py b.in b.out"))
-env = Environment(COPY = 'copy.py')
-env.Execute("%s copy.py c.in c.out")
-env.Execute(Action("%s copy.py d.in d.out"))
+Execute("%s my_copy.py a.in a.out")
+Execute(Action("%s my_copy.py b.in b.out"))
+env = Environment(COPY = 'my_copy.py')
+env.Execute("%s my_copy.py c.in c.out")
+env.Execute(Action("%s my_copy.py d.in d.out"))
v = env.Execute("%s $COPY e.in e.out")
assert v == 0, v
v = env.Execute(Action("%s $COPY f.in f.out"))
if sys.platform != 'win32':
test.pass_test()
-exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-0.94'), join(sys.prefix, 'scons-0.94'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()"
+test.run(arguments = '-q -Q -f -', stdin = "import SCons; print SCons.__version__")
+version = test.stdout()[:-1]
+
+exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%s'), join(sys.prefix, 'scons-%s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % (version, version)
exec_script_main_xml = string.replace(exec_script_main, "'", "'")
def substitute(input, workpath=test.workpath(), python=sys.executable):