add -tt to the Python invocations in the packaging build and the
tests so they don't creep back in.
+ - In Visual Studio project files, put quotes around the -C directory
+ so everything works even if the path has spaces in it.
+
From Chen Lee:
- Handle Visual Studio project and solution files in Unicode.
env['MSVSSCONSCRIPT'] = env.File('SConstruct')
env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, exec_script_main)
- env['MSVSSCONSFLAGS'] = '-C ${MSVSSCONSCRIPT.dir.abspath} -f ${MSVSSCONSCRIPT.name}'
+ env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.abspath}" -f ${MSVSSCONSCRIPT.name}'
env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'
env['MSVSBUILDCOM'] = '$MSVSSCONSCOM $MSVSBUILDTARGET'
env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM $MSVSBUILDTARGET'
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
env=Environment(MSVS_VERSION = '6.0')
env.MSVSProject(target = 'foo.dsp',
env.Program('foo.c')
""")
-test.write('foo.c', r"""
+test.write(['sub dir', 'foo.c'], r"""
int
main(int argc, char *argv)
{
}
""")
-test.run(arguments='.')
+test.run(chdir='sub dir', arguments='.')
-test.run(program=['msdev'],
+test.run(chdir='sub dir',
+ program=['msdev'],
arguments=['Test.dsp', '/MAKE', 'foo - Win32 Release'])
-test.run(program=test.workpath('foo'), stdout="foo.c\n")
+test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir ""
# PROP BASE Intermediate_Dir ""
-# PROP BASE Cmd_Line "echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct Test.exe"
-# PROP BASE Rebuild_Opt "-c && echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct Test.exe"
+# PROP BASE Cmd_Line "echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C "<WORKPATH>" -f SConstruct Test.exe"
+# PROP BASE Rebuild_Opt "-c && echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C "<WORKPATH>" -f SConstruct Test.exe"
# PROP BASE Target_File "Test.exe"
# PROP BASE Bsc_Name ""
# PROP BASE Target_Dir ""
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir ""
-# PROP Cmd_Line "echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct Test.exe"
-# PROP Rebuild_Opt "-c && echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct Test.exe"
+# PROP Cmd_Line "echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C "<WORKPATH>" -f SConstruct Test.exe"
+# PROP Rebuild_Opt "-c && echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C "<WORKPATH>" -f SConstruct Test.exe"
# PROP Target_File "Test.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
env=Environment(MSVS_VERSION = '7.0')
env.MSVSProject(target = 'foo.vcproj',
env.Program('foo.c')
""")
-test.write('foo.c', r"""
+test.write(['sub dir', 'foo.c'], r"""
int
main(int argc, char *argv)
{
}
""")
-test.run(arguments='.')
+test.run(chdir='sub dir', arguments='.')
-test.vcproj_sys_path('foo.vcproj')
+test.vcproj_sys_path(test.workpath('sub dir', 'foo.vcproj'))
-test.run(program=['devenv'],
+test.run(chdir='sub dir',
+ program=['devenv'],
arguments=['foo.sln', '/build', 'Release'])
-test.run(program=test.workpath('foo'), stdout="foo.c\n")
+test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
\t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
\t\t\t<Tool
\t\t\t\tName="VCNMakeTool"
-\t\t\t\tBuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct Test.exe"
-\t\t\t\tCleanCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct -c Test.exe"
-\t\t\t\tRebuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct Test.exe"
+\t\t\t\tBuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct Test.exe"
+\t\t\t\tCleanCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct -c Test.exe"
+\t\t\t\tRebuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct Test.exe"
\t\t\t\tOutput="Test.exe"/>
\t\t</Configuration>
\t</Configurations>
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
env=Environment(MSVS_VERSION = '7.1')
env.MSVSProject(target = 'foo.vcproj',
env.Program('foo.c')
""")
-test.write('foo.c', r"""
+test.write(['sub dir', 'foo.c'], r"""
int
main(int argc, char *argv)
{
}
""")
-test.run(arguments='.')
+test.run(chdir='sub dir', arguments='.')
-test.vcproj_sys_path('foo.vcproj')
+test.vcproj_sys_path(test.workpath('sub dir', 'foo.vcproj'))
-test.run(program=['devenv'],
+test.run(chdir='sub dir',
+ program=['devenv'],
arguments=['foo.sln', '/build', 'Release'])
-test.run(program=test.workpath('foo'), stdout="foo.c\n")
+test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
\t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
\t\t\t<Tool
\t\t\t\tName="VCNMakeTool"
-\t\t\t\tBuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct Test.exe"
-\t\t\t\tCleanCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct -c Test.exe"
-\t\t\t\tRebuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C <WORKPATH> -f SConstruct Test.exe"
+\t\t\t\tBuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct Test.exe"
+\t\t\t\tCleanCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct -c Test.exe"
+\t\t\t\tRebuildCommandLine="echo Starting SCons && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN_XML>" -C "<WORKPATH>" -f SConstruct Test.exe"
\t\t\t\tOutput="Test.exe"/>
\t\t</Configuration>
\t</Configurations>