Updated Premake to generate VS2008 project files.

This was SVN commit r6127.
This commit is contained in:
Ykkrosh 2008-06-28 00:49:38 +00:00
parent b8594fb56f
commit 6b51050f96
9 changed files with 55 additions and 26 deletions

Binary file not shown.

View File

@ -859,6 +859,7 @@ function setup_tests()
include = " --include=precompiled.h"
package.rootoptions = package.rootoptions .. include
package.testoptions = package.testoptions .. include
tinsert(package.buildflags, "no-manifest")
package_create("test_2_build", "winexe")
links = static_lib_names
@ -905,6 +906,7 @@ function setup_tests()
tinsert(package.buildflags, "use-library-dep-inputs")
package_create("test_1_run", "run")
tinsert(package.buildflags, "no-manifest")
package.links = { "test_2_build" } -- This determines which project's executable to run
end

View File

@ -186,8 +186,9 @@ int gnu_cpp()
}
else
{
io_print("PCHS := \\\n");
const char *basename = path_getbasename(pchOrigin);
io_print("PCHS := \\\n");
io_print("\t$(OBJDIR)/%s.%s \\\n", basename, pchExt);
io_print("\n");
}

View File

@ -220,7 +220,11 @@ int onCommand(const char* cmd, const char* arg)
}
else if (matches(arg, "vs2005"))
{
return vs2005_generate();
return vs2005_generate(2005);
}
else if (matches(arg, "vs2008"))
{
return vs2005_generate(2008);
}
else
{
@ -293,6 +297,7 @@ void showUsage()
puts(" vs2002 Microsoft Visual Studio 2002");
puts(" vs2003 Microsoft Visual Studio 2003");
puts(" vs2005 Microsoft Visual Studio 2005 (includes Express editions)");
puts(" vs2008 Microsoft Visual Studio 2008 (includes Express editions)");
puts("");
puts(" --help Display this information");
puts(" --version Display version information");

View File

@ -1,6 +1,6 @@
/**********************************************************************
* Premake - vs.c
* Common code for Visual Studio 2002-2005 targets.
* Common code for Visual Studio 2002-2008 targets.
*
* Copyright (c) 2002-2006 Jason Perkins and the Premake project
*
@ -85,7 +85,7 @@ static int blocks_2003[] =
BlocksEnd
};
static int blocks_2005[] =
static int blocks_2005_2008[] =
{
VCPreBuildEventTool,
VCCustomBuildTool,
@ -112,7 +112,8 @@ static int* blocks[] =
{
blocks_2002,
blocks_2003,
blocks_2005
blocks_2005_2008,
blocks_2005_2008
};
@ -135,7 +136,7 @@ static void tag_open(const char* name)
{
if (opened)
{
if (version == VS2005 && attrib > 0)
if (version >= VS2005 && attrib > 0)
{
io_print("\n");
tag_indent();
@ -192,7 +193,7 @@ static void tag_close(const char* name, int form)
}
else
{
if (version == VS2005)
if (version >= VS2005)
{
io_print("\n");
tag_indent();
@ -235,7 +236,7 @@ void vs_assign_guids()
generateUUID(data->projGuid);
prj_select_config(0);
if (version == VS2005 && prj_is_kind("aspnet"))
if (version >= VS2005 && prj_is_kind("aspnet"))
{
strcpy(data->toolGuid, "E24C65DC-7377-472B-9ABA-BC803B73C61A");
strcpy(data->projExt, "");
@ -294,13 +295,16 @@ int vs_write_cpp()
case VS2005:
str = "8.00";
break;
case VS2008:
str = "9.00";
break;
}
tag_attr("Version=\"%s\"", str);
tag_attr("Name=\"%s\"", prj_get_pkgname());
tag_attr("ProjectGUID=\"{%s}\"", data->projGuid);
if (version == VS2005)
if (version >= VS2005)
tag_attr("RootNamespace=\"%s\"", prj_get_pkgname());
tag_attr("Keyword=\"%s\"", prj_has_flag("managed") ? "ManagedCProj" : "Win32Proj");
@ -311,7 +315,7 @@ int vs_write_cpp()
tag_close("Platform", 0);
tag_close("Platforms", 1);
if (version == VS2005)
if (version >= VS2005)
{
tag_open("ToolFiles");
tag_close("ToolFiles", 1);
@ -523,12 +527,12 @@ int vs_write_cpp()
if (version < VS2005 && !prj_has_flag("no-rtti"))
tag_attr("RuntimeTypeInfo=\"%s\"", S_TRUE);
if (version == VS2005 && prj_has_flag("no-rtti"))
if (version >= VS2005 && prj_has_flag("no-rtti"))
tag_attr("RuntimeTypeInfo=\"%s\"", S_FALSE);
if (version < VS2005 && prj_has_flag("native-wchar_t"))
tag_attr("TreatWChar_tAsBuiltInType=\"%s\"", S_TRUE);
if (version == VS2005 && prj_has_flag("no-native-wchar_t"))
if (version >= VS2005 && prj_has_flag("no-native-wchar_t"))
tag_attr("TreatWChar_tAsBuiltInType=\"%s\"", S_FALSE);
if (pchHeader)
@ -542,7 +546,7 @@ int vs_write_cpp()
tag_attr("WarningLevel=\"%d\"", prj_has_flag("extra-warnings") ? 4 : 3);
if (prj_has_flag("fatal-warnings"))
tag_attr("WarnAsError=\"%s\"", S_TRUE);
if (!prj_has_flag("managed"))
if (version < VS2008 && !prj_has_flag("managed"))
tag_attr("Detect64BitPortabilityProblems=\"%s\"", prj_has_flag("no-64bit-checks") ? S_FALSE : S_TRUE);
tag_attr("DebugInformationFormat=\"%d\"", symbols);

View File

@ -1,6 +1,6 @@
/**********************************************************************
* Premake - vs.h
* Common code for Visual Studio 2002-2005 targets.
* Common code for Visual Studio 2002-2008 targets.
*
* Copyright (c) 2002-2006 Jason Perkins and the Premake project
*
@ -19,7 +19,8 @@ enum VsVer
{
VS2002,
VS2003,
VS2005
VS2005,
VS2008
};
typedef struct tagVsPkgData

View File

@ -22,15 +22,23 @@
#include "vs.h"
#include "vs2005.h"
static int vs2005_write_solution();
static int vs2005_write_solution(int target);
static const char* list_aspnet_refs(const char* name);
int vs2005_generate(int target)
{
int p;
vs_setversion(VS2005);
printf("Generating Visual Studio 2005 solution and project files:\n");
if (target == 2005)
{
vs_setversion(VS2005);
printf("Generating Visual Studio 2005 solution and project files:\n");
}
else
{
vs_setversion(VS2008);
printf("Generating Visual Studio 2008 solution and project files:\n");
}
/* Assign GUIDs to packages */
vs_assign_guids();
@ -63,7 +71,7 @@ int vs2005_generate(int target)
}
}
return vs2005_write_solution();
return vs2005_write_solution(target);
}
@ -71,7 +79,7 @@ int vs2005_generate(int target)
* Write out the solution file
***********************************************************************/
static int vs2005_write_solution()
static int vs2005_write_solution(int target)
{
VsPkgData* data;
int hasDotNet, hasCpp;
@ -82,8 +90,16 @@ static int vs2005_write_solution()
return 0;
/* Format identification string */
io_print("Microsoft Visual Studio Solution File, Format Version 9.00\n");
io_print("# Visual Studio 2005\n");
if (target == 2005)
{
io_print("Microsoft Visual Studio Solution File, Format Version 9.00\n");
io_print("# Visual Studio 2005\n");
}
else
{
io_print("Microsoft Visual Studio Solution File, Format Version 10.00\n");
io_print("# Visual Studio 2008\n");
}
/* List packages */
numAspNet = 0;

View File

@ -15,6 +15,6 @@
* GNU General Public License in the file LICENSE.txt for details.
**********************************************************************/
int vs2005_generate();
int vs2005_generate(int target);
int vs2005_cs();

View File

@ -1,15 +1,15 @@
@echo off
rem ** Create Visual Studio Workspaces on Windows **
if not exist vc2003\pyrogenesis.sln mkdir vc2003
if not exist vc2005\pyrogenesis.sln mkdir vc2005
if not exist vc2008\pyrogenesis.sln mkdir vc2008
rem VC2002 removed because no one is using it and generating it wastes time.
rem VC2002 and VC2003 removed because no one is using it and generating it wastes time.
rem it's entirely analogous to other cmdlines - just copy+paste if needed again.
cd ..\premake
if not exist ..\workspaces\vc2003\SKIP_PREMAKE_HERE premake --target vs2003 --outpath ../workspaces/vc2003 %*
if not exist ..\workspaces\vc2005\SKIP_PREMAKE_HERE premake --target vs2005 --outpath ../workspaces/vc2005 %*
if not exist ..\workspaces\vc2008\SKIP_PREMAKE_HERE premake --target vs2008 --outpath ../workspaces/vc2008 %*
cd ..\workspaces