Put quotes around the -C directory in command lines in MSVS project files.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 9 Oct 2005 22:43:28 +0000 (22:43 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 9 Oct 2005 22:43:28 +0000 (22:43 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1368 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Tool/msvs.py
test/MSVS/vs-6.0-exec.py
test/MSVS/vs-6.0-files.py
test/MSVS/vs-7.0-exec.py
test/MSVS/vs-7.0-files.py
test/MSVS/vs-7.1-exec.py
test/MSVS/vs-7.1-files.py

index b169fde4352e0adeaa354c2ba174f7cf3e30b7e4..2312d58bee3f98b4f243938c6426dab770cf885a 100644 (file)
@@ -353,6 +353,9 @@ RELEASE 0.97 - XXX
     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.
index 5542a883c96813bda3936010bed672bc403c5f0c..084f1d4576049fb2816d6b9a731c6f0ccca1a822 100644 (file)
@@ -1419,7 +1419,7 @@ def generate(env):
         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'
index 8f15bdc18c12cee6d6255293571341672c9bc202..a9637723afcde0cca0e0d9b31ad81e6681043dff 100644 (file)
@@ -59,7 +59,9 @@ exec(test.stdout())
 
 
 
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
 env=Environment(MSVS_VERSION = '6.0')
 
 env.MSVSProject(target = 'foo.dsp',
@@ -70,7 +72,7 @@ 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)
 {
@@ -79,12 +81,13 @@ 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")
 
 
 
index e3f29942046a4c83b5095407d4f55dfc38ec2499..135bb7faa36ee104a127c50a18bd8b5c1d20778d 100644 (file)
@@ -77,8 +77,8 @@ CFG=Test - Win32 Release
 # 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 ""
@@ -86,8 +86,8 @@ CFG=Test - Win32 Release
 # 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 ""
index 04384346756cd6786fa615b7dc3a93228a0cf988..8700d41659b6fed2529d6b810f282ad2e6b0885a 100644 (file)
@@ -59,7 +59,9 @@ exec(test.stdout())
 
 
 
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
 env=Environment(MSVS_VERSION = '7.0')
 
 env.MSVSProject(target = 'foo.vcproj',
@@ -70,7 +72,7 @@ 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)
 {
@@ -79,14 +81,15 @@ 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")
 
 
 
index 409501d6ec5a4510f1747c5f10e76f6e1adbe099..0ab4870ad2c78b44e4dc69108f0fc1561e948df7 100644 (file)
@@ -86,9 +86,9 @@ expected_vcprojfile = """\
 \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
 \t\t\t<Tool
 \t\t\t\tName="VCNMakeTool"
-\t\t\t\tBuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct Test.exe"
-\t\t\t\tCleanCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct -c Test.exe"
-\t\t\t\tRebuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct Test.exe"
+\t\t\t\tBuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct Test.exe"
+\t\t\t\tCleanCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct -c Test.exe"
+\t\t\t\tRebuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct Test.exe"
 \t\t\t\tOutput="Test.exe"/>
 \t\t</Configuration>
 \t</Configurations>
index f546aa5b9689ff671bdbd8607b5488f61968e627..ea886b2bd69e2de86605fc8f04f88473be04536c 100644 (file)
@@ -59,7 +59,9 @@ exec(test.stdout())
 
 
 
-test.write('SConstruct', """\
+test.subdir('sub dir')
+
+test.write(['sub dir', 'SConstruct'], """\
 env=Environment(MSVS_VERSION = '7.1')
 
 env.MSVSProject(target = 'foo.vcproj',
@@ -70,7 +72,7 @@ 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)
 {
@@ -79,14 +81,15 @@ 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")
 
 
 
index 9cbab12886de296b303a311a3547eddcb8c5560d..d7ec165d79b70c31298d3ac68f2e9b3958cfb40b 100644 (file)
@@ -86,9 +86,9 @@ expected_vcprojfile = """\
 \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
 \t\t\t<Tool
 \t\t\t\tName="VCNMakeTool"
-\t\t\t\tBuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct Test.exe"
-\t\t\t\tCleanCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct -c Test.exe"
-\t\t\t\tRebuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C <WORKPATH> -f SConstruct Test.exe"
+\t\t\t\tBuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct Test.exe"
+\t\t\t\tCleanCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct -c Test.exe"
+\t\t\t\tRebuildCommandLine="echo Starting SCons &amp;&amp; &quot;<PYTHON>&quot; -c &quot;<SCONS_SCRIPT_MAIN_XML>&quot; -C &quot;<WORKPATH>&quot; -f SConstruct Test.exe"
 \t\t\t\tOutput="Test.exe"/>
 \t\t</Configuration>
 \t</Configurations>