From 04b10a2b9a5d1be08e3884c2f3ee641359b86989 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 9 Oct 2005 22:43:28 +0000 Subject: Put quotes around the -C directory in command lines in MSVS project files. --- src/CHANGES.txt | 3 +++ src/engine/SCons/Tool/msvs.py | 2 +- test/MSVS/vs-6.0-exec.py | 13 ++++++++----- test/MSVS/vs-6.0-files.py | 8 ++++---- test/MSVS/vs-7.0-exec.py | 15 +++++++++------ test/MSVS/vs-7.0-files.py | 6 +++--- test/MSVS/vs-7.1-exec.py | 15 +++++++++------ test/MSVS/vs-7.1-files.py | 6 +++--- 8 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b169fde..2312d58 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 5542a88..084f1d4 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 8f15bdc..a963772 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 e3f2994..135bb7f 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 0438434..8700d41 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 409501d..0ab4870 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 f546aa5..ea886b2 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 9cbab12..d7ec165 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 -- cgit v0.12