Opened 11 years ago

Closed 11 years ago

Last modified 2 years ago

#7741 closed enhancement

create_msvc: Add support for MSVC10

Reported by: Templier Owned by: lordhoto
Priority: low Component: Port: Win32
Keywords: Cc:
Game:

Description

Here is a set of project files for MSVC10 (converted from the MSVC9 files) to help adding support for VS2010 to create_msvc. Those were created using trunk (r45633).

Changes from MSVC9 - Solution format version is now 11 - New file extensions for vcproj & vsprops (vcxproj and props) - Filters are now stored in external files (vcxproj.filters instead of directly inside the vcproj file) - Projects and properties are now in MSBuild format

Note: some properties are bound to change, for example _ProjectFileVersion (might be all properties with a _ prefix)

Ticket imported from: #2891357. Ticket imported from: feature-requests/557.

Attachments (8)

0003-create_msvc-Silence-warnings-4512-4127.patch (890 bytes ) - added by Templier 11 years ago.
3 - Silence warnings (in project files)
0005-create_msvc-Add-MSVC10-project.patch (6.2 KB ) - added by Templier 11 years ago.
5 - Add MSVC10 project & solution
0006-Add-MSVC10-dists-folder.patch (2.2 KB ) - added by Templier 11 years ago.
6 - Add MSVC10 dists folder (batch file and readme)
0001-create_msvc-Extract-version-specific-code.patch (63.7 KB ) - added by Templier 11 years ago.
1 - Extract version specific code
0002-create_msvc-Simplify-createBuildProp.patch (9.2 KB ) - added by Templier 11 years ago.
2 - Simplify createBuildProp code
0004-create_msvc-Add-MSVC10-support.patch (25.2 KB ) - added by Templier 11 years ago.
4 - Add MSVC10 support
0007-Update-tools-README-to-mention-Visual-Studio-2010-su.patch (892 bytes ) - added by Templier 11 years ago.
7 - Mention 2010 version in tools README
0008-create_project-Update-for-VS2010-RTM.patch (7.3 KB ) - added by Templier 11 years ago.
8 - Update for VS2010 RTM

Download all attachments as: .zip

Change History (24)

comment:1 by lordhoto, 11 years ago

MSVC10 is not out yet AFAIK, thus I lower the priority.

comment:2 by lordhoto, 11 years ago

Owner: set to lordhoto
Priority: normallow

comment:3 by lordhoto, 11 years ago

Summary: MSVC10 solution and project filescreate_msvc: Add support for MSVC10

comment:4 by Templier, 11 years ago

Something I forgot: VS2010 now has per-project bin/include/lib directories settings, so you can have specific directories for dependencies without having to change Visual Studio global settings. This way, you no longer have to copy dependencies libs & include to the visual studio folder.

Since the scummvm project is the only one needing those libs, you need to add the following after all the CodeAnalysisRule* (which can probably be removed as they seem to be only of use with VS2010 enterprise versions): <IncludePath>%SCUMMVM_LIBS%\Include;$(IncludePath)</IncludePath> <ExecutablePath>%SCUMMVM_LIBS%\Bin;$(ExecutablePath)</ExecutablePath> <LibraryPath>%SCUMMVM_LIBS%\Lib;$(LibraryPath)</LibraryPath>

(with the SCUMMVM_LIBS env var pointing to the custom dependency folder).

comment:5 by Templier, 11 years ago

I started working on MSVC10 support some days ago. Here a the first two patches to prepare for MSVC10 support (they do not have any VS2010-specific code, so they might be committed after review):

1 - Extracts all the version-specific code to a separate class: the shared code has been moved to a ProjectProvider class and a new VisualStudioProvider class implements the version-specific output code.

2 - Simplify createBuildProp: all the property files share a lot in common. This patch simplifies the output function to have only two main code paths (debug & release).

by Templier, 11 years ago

3 - Silence warnings (in project files)

by Templier, 11 years ago

5 - Add MSVC10 project & solution

by Templier, 11 years ago

6 - Add MSVC10 dists folder (batch file and readme)

comment:6 by Templier, 11 years ago

I've rebased the patches on the latest trunk.

The first three are only refactoring and can be applied after review (see previous comment for details)

The last three patches add support for MSVC10, a new project for create_msvc and a dists folder with a batch file to generate the project files. I've added FIXMEs in all places which output "temporary" properties (those prefixed with _).

comment:7 by lordhoto, 11 years ago

Your first patch doesn't cleanly apply for me. Hunk #10 fails to apply.

Also after fixing that manually I get the following compilation errors (actually they are only warnings, but never the less they should be fixed): ../git/tools/create_msvc/create_msvc.cpp:235: error: type qualifiers ignored on function return type ../git/tools/create_msvc/create_msvc.cpp:129: error: ‘class<unnamed>::ProjectProvider’ has virtual functions and accessible non-virtual destructor ../git/tools/create_msvc/create_msvc.cpp:288: error: type qualifiers ignored on function return type ../git/tools/create_msvc/create_msvc.cpp:270: error: ‘class<unnamed>::VisualStudioProvider’ has virtual functions and accessible non-virtual destructor ../git/tools/create_msvc/create_msvc.cpp:1384: error: type qualifiers ignored on function return type

Apart I see some incorrect use of tabs and whitespaces in your patch: + virtual void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir, + const StringList &includeList, const StringList &excludeList) = 0;

You seem to use two tabs later in in formatting the second line, while there should only be one tab at the beginning of the line for indentation. There is at least one other place where indentation is incorrectly done with whitespaces, the second and third line of the addFileToProject definition inside the class definition. Strangely it uses two tabs later on in that line... Also it seems you incorrectly use tabs for formatting in the stream output parts of createProjectFile. For formatting whitespaces should be used. Tabs are only for increasing the indentation level!

I'm also wondering about the public variables in "ProjectProvider", it doesn't look like "_version" nor "_globalWarnings" nor "_projectWarnings" nor "_uuidMap" should really be public in that class. I would rather guess they should be made private. All in all I like the idea of creating that ProjectProvider interface. With some further abstraction it might even be used to create project files for other IDEs (XCode comes to mind, since we seem to update that one from time to time by hand). But of course that's not part of this patch :-).

Those problems shouldn't be too hard to fix and when you uploading a patch file taking care of all that, the 0001 patch should be ready for commit.

by Templier, 11 years ago

1 - Extract version specific code

by Templier, 11 years ago

2 - Simplify createBuildProp code

by Templier, 11 years ago

4 - Add MSVC10 support

by Templier, 11 years ago

7 - Mention 2010 version in tools README

comment:8 by Templier, 11 years ago

Thanks for the feedback!

My git installation seems borked and does crazy stuff with endlines, so I reexported the first patch using Tortoise and it should apply cleanly now.

What changed: - Fixed the whitespace/tabs problems (I hope I didn't miss any) in patches 1, 2 & 4 - Fixed all the warnings (in patches 1 & 4) - Made all the member variables protected

comment:9 by lordhoto, 11 years ago

I did commit all the patches now (some with a little modification though). I'll leave this feature request open, till the final MSVC10 version is out and known to be working.

I think meanwhile we could consider cleaning up all the provider classes though. Albeit being a nice idea I have the feeling they could still have some cleanup :-). For example the UUID stuff looks pretty project specified and thus could be moved into ProjectProvider.

comment:10 by Templier, 11 years ago

Thanks for committing the patches!

I started doing a bit of cleanup (patch 8 attached): - Moved createUUIDMap & createUUID to ProjectProvider class - Moved getIndent to VisualStudioProvider class - Made all methods in ProjectProvider protected except for createMSVCProject - Fixed whitespaces in createBuildProp

I'm going to look into adding other project types next. It seems most other ide projects in dists are badly out of date apart from the iphone xcode projet.

Anything against moving each project type code (msvc, xcode, others...) into a separate cpp file? (If you'd rather keep a single file, it's ok, but I try to avoid working with 3000+lines files when I can :)

comment:11 by lordhoto, 11 years ago

About potentiality support for other project files: I guess XCode is the only one, which is really used ;-) (and that only by vinterstum IIRC). About multiple files: No problem with that.

comment:12 by Templier, 11 years ago

I'm going to add support for XCode and Code::Blocks (since digitall is using it) next.

I've removed patch 8 in the meantime since I'm going to move things around anyway (and it doesn't apply to the MSVC part specifically).

I'll probably open a new patch tracker entry with those changes and keep this entry for one last patch when Visual Studio 2010 is released.

by Templier, 11 years ago

8 - Update for VS2010 RTM

comment:13 by Templier, 11 years ago

The last patch updates project templates for the RTM version of VS2010: - _ProjectFileVersion values using the RTM build number - lowercase filename for xml documentation property - add label for user properties import group - update included VS2010 solution

Once this is commited, you can close this tracker item.

Refactoring & new features will be tracked in this new entry: https://sourceforge.net/tracker/?func=detail&aid=2946946&group_id=37116&atid=418822 (with code available on my git tree here: http://github.com/Littleboy/scummvm-jt/tree/create_project )

comment:14 by lordhoto, 11 years ago

Status: newclosed

comment:15 by lordhoto, 11 years ago

Thanks for the patch, I committed it as is. Since I still don't own a MSVC10, I am unable to test it though.

comment:16 by digitall, 2 years ago

Component: Port: Win32
Note: See TracTickets for help on using tickets.