From: stevenknight Date: Sun, 9 Oct 2005 22:43:28 +0000 (+0000) Subject: Put quotes around the -C directory in command lines in MSVS project files. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e96f90d4b61db2839540d28f747b1b3f93fa202;p=scons.git Put quotes around the -C directory in command lines in MSVS project files. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1368 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b169fde4..2312d58b 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -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. diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 5542a883..084f1d45 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -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' diff --git a/test/MSVS/vs-6.0-exec.py b/test/MSVS/vs-6.0-exec.py index 8f15bdc1..a9637723 100644 --- a/test/MSVS/vs-6.0-exec.py +++ b/test/MSVS/vs-6.0-exec.py @@ -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") diff --git a/test/MSVS/vs-6.0-files.py b/test/MSVS/vs-6.0-files.py index e3f29942..135bb7fa 100644 --- a/test/MSVS/vs-6.0-files.py +++ b/test/MSVS/vs-6.0-files.py @@ -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 && "" -c "" -C -f SConstruct Test.exe" -# PROP BASE Rebuild_Opt "-c && echo Starting SCons && "" -c "" -C -f SConstruct Test.exe" +# PROP BASE Cmd_Line "echo Starting SCons && "" -c "" -C "" -f SConstruct Test.exe" +# PROP BASE Rebuild_Opt "-c && echo Starting SCons && "" -c "" -C "" -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 && "" -c "" -C -f SConstruct Test.exe" -# PROP Rebuild_Opt "-c && echo Starting SCons && "" -c "" -C -f SConstruct Test.exe" +# PROP Cmd_Line "echo Starting SCons && "" -c "" -C "" -f SConstruct Test.exe" +# PROP Rebuild_Opt "-c && echo Starting SCons && "" -c "" -C "" -f SConstruct Test.exe" # PROP Target_File "Test.exe" # PROP Bsc_Name "" # PROP Target_Dir "" diff --git a/test/MSVS/vs-7.0-exec.py b/test/MSVS/vs-7.0-exec.py index 04384346..8700d416 100644 --- a/test/MSVS/vs-7.0-exec.py +++ b/test/MSVS/vs-7.0-exec.py @@ -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") diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py index 409501d6..0ab4870a 100644 --- a/test/MSVS/vs-7.0-files.py +++ b/test/MSVS/vs-7.0-files.py @@ -86,9 +86,9 @@ expected_vcprojfile = """\ \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE"> \t\t\t \t\t \t diff --git a/test/MSVS/vs-7.1-exec.py b/test/MSVS/vs-7.1-exec.py index f546aa5b..ea886b2b 100644 --- a/test/MSVS/vs-7.1-exec.py +++ b/test/MSVS/vs-7.1-exec.py @@ -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") diff --git a/test/MSVS/vs-7.1-files.py b/test/MSVS/vs-7.1-files.py index 9cbab128..d7ec165d 100644 --- a/test/MSVS/vs-7.1-files.py +++ b/test/MSVS/vs-7.1-files.py @@ -86,9 +86,9 @@ expected_vcprojfile = """\ \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE"> \t\t\t \t\t \t