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 830

Summary: Visual Studio builds checked out from Subversion are broken...
Product: SDL Reporter: Ryan C. Gordon <icculus>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-1.2.14
Version: HG 2.0   
Hardware: x86   
OS: Windows (All)   

Description Ryan C. Gordon 2009-10-07 22:29:55 UTC
If you check out SDL from Subversion and try to build it on Windows, it'll fail because files that configure would normally build aren't there.

Here's how to fix it so you don't have to manually mess with it. I'm tossing this to Sam, because I'm nervous about changing the VS project files myself (what version do we use to build these? etc).

- Open the project.
- Right-click the "SDL" project, click "Properties"
- Set "Configuration" to "All configurations"
- Find the "Configuration Properties" node, then "Build Events", then "Pre-build Event"
- On the "Command line" field, click the three-dot box and then paste this in there (this gets copied to a .bat file by VS.NET and run when needed).


if exist $(SolutionDir)\..\include\SDL_revision.h goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >$(SolutionDir)\..\include\SDL_revision.h
:SDLREVISIONOKAY

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


- Click OK.
- Set Description to "Making sure basic SDL headers are in place..."
- Make sure "Exclude From Build" is set to "No."
- Click OK.
- Do the same for the SDLmain project.

Now this will make sure SDL_config.h and SDL_revision.h are sane whenever you build SDL.

This could be made more fancy (try to run svnversion.exe, check errorlevel, fall back to "echo SDL_REVISION 0" if necessary), but I don't want to screw with it too much.

Also, this depends on VisualC.zip being unzipped so the new VisualC directory is in the root of the source tree ($(SolutionDir) is where the .sln file is)...is there any reason we can't store this unzipped in svn?

--ryan.
Comment 1 Ryan C. Gordon 2009-10-07 22:30:56 UTC
Tossing to Sam.

Also, adding target-1.2.14 keyword, but this probably applies to 1.3, too.

--ryan.
Comment 2 Sam Lantinga 2009-10-07 22:48:36 UTC
Thanks, I'll add this to the projects for SDL 1.3.

I'm going to leave it as it is for SDL 1.2, since you should probably just start with the snapshot which has this taken care of: http://www.libsdl.org/tmp/SDL-1.2.zip
Comment 3 Sam Lantinga 2009-10-08 02:50:28 UTC
This is fixed for SDL 1.3, thanks!