We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 852

Summary: Build script fails when project directory path include spaces
Product: SDL Reporter: Jesse Anders <jesseanders>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: jesseanders
Version: HG 2.0   
Hardware: x86   
OS: Windows (XP)   

Description Jesse Anders 2009-10-17 14:17:25 UTC
In VC++, the build script that creates SDL_config.h and SDL_revision.h fails when the project directory path includes spaces. For example, if the project directory path is:

c:\Documents and Settings\Jesse\My Documents\Visual Studio 2008\Projects\SDL 1.3\VisualC\SDL\

The following error is generated:

'and' is not recognized as an internal or external command

Placing all paths in quotes fixes this.

I don't know if this qualifies as a 'bug' (in fact, it could just be user error), but I thought I'd file it just in case. Here is the revised script in its entirety:

if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
Comment 1 Sam Lantinga 2009-10-17 14:46:26 UTC
Thanks!  This should be fixed in subversion, can you try it out?
Comment 2 Jesse Anders 2009-10-17 16:05:53 UTC
> This should be fixed in subversion, can you try it out?

Absolutely :)

When loading the solution (in VC++ 9.0), an XML parse error is generated due to the nested quotes in the following:

				CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"&#x0D;&#x0A;:SDLREVISIONOKAY"

If I replace each nested quote with '&quot;' and then load the project, the project loads successfully, and the build script works.

Let me know if you need any other info.
Comment 3 Sam Lantinga 2009-10-17 16:33:12 UTC
Got it, thanks!
Comment 4 Jesse Anders 2009-10-17 18:01:31 UTC
(In reply to comment #3)
> Got it, thanks!

Just to confirm, everything appears to be working correctly now.

Thanks :)
Comment 5 Sam Lantinga 2009-10-17 20:34:45 UTC
Great, thanks for the fix and the followup! :)