forked from 0ad/0ad
Updated Premake to generate VS2008 project files.
This was SVN commit r6127.
This commit is contained in:
parent
b8594fb56f
commit
6b51050f96
Binary file not shown.
@ -859,6 +859,7 @@ function setup_tests()
|
|||||||
include = " --include=precompiled.h"
|
include = " --include=precompiled.h"
|
||||||
package.rootoptions = package.rootoptions .. include
|
package.rootoptions = package.rootoptions .. include
|
||||||
package.testoptions = package.testoptions .. include
|
package.testoptions = package.testoptions .. include
|
||||||
|
tinsert(package.buildflags, "no-manifest")
|
||||||
|
|
||||||
package_create("test_2_build", "winexe")
|
package_create("test_2_build", "winexe")
|
||||||
links = static_lib_names
|
links = static_lib_names
|
||||||
@ -905,6 +906,7 @@ function setup_tests()
|
|||||||
tinsert(package.buildflags, "use-library-dep-inputs")
|
tinsert(package.buildflags, "use-library-dep-inputs")
|
||||||
|
|
||||||
package_create("test_1_run", "run")
|
package_create("test_1_run", "run")
|
||||||
|
tinsert(package.buildflags, "no-manifest")
|
||||||
package.links = { "test_2_build" } -- This determines which project's executable to run
|
package.links = { "test_2_build" } -- This determines which project's executable to run
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -186,8 +186,9 @@ int gnu_cpp()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
io_print("PCHS := \\\n");
|
|
||||||
const char *basename = path_getbasename(pchOrigin);
|
const char *basename = path_getbasename(pchOrigin);
|
||||||
|
io_print("PCHS := \\\n");
|
||||||
io_print("\t$(OBJDIR)/%s.%s \\\n", basename, pchExt);
|
io_print("\t$(OBJDIR)/%s.%s \\\n", basename, pchExt);
|
||||||
io_print("\n");
|
io_print("\n");
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,11 @@ int onCommand(const char* cmd, const char* arg)
|
|||||||
}
|
}
|
||||||
else if (matches(arg, "vs2005"))
|
else if (matches(arg, "vs2005"))
|
||||||
{
|
{
|
||||||
return vs2005_generate();
|
return vs2005_generate(2005);
|
||||||
|
}
|
||||||
|
else if (matches(arg, "vs2008"))
|
||||||
|
{
|
||||||
|
return vs2005_generate(2008);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -293,6 +297,7 @@ void showUsage()
|
|||||||
puts(" vs2002 Microsoft Visual Studio 2002");
|
puts(" vs2002 Microsoft Visual Studio 2002");
|
||||||
puts(" vs2003 Microsoft Visual Studio 2003");
|
puts(" vs2003 Microsoft Visual Studio 2003");
|
||||||
puts(" vs2005 Microsoft Visual Studio 2005 (includes Express editions)");
|
puts(" vs2005 Microsoft Visual Studio 2005 (includes Express editions)");
|
||||||
|
puts(" vs2008 Microsoft Visual Studio 2008 (includes Express editions)");
|
||||||
puts("");
|
puts("");
|
||||||
puts(" --help Display this information");
|
puts(" --help Display this information");
|
||||||
puts(" --version Display version information");
|
puts(" --version Display version information");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Premake - vs.c
|
* 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
|
* Copyright (c) 2002-2006 Jason Perkins and the Premake project
|
||||||
*
|
*
|
||||||
@ -85,7 +85,7 @@ static int blocks_2003[] =
|
|||||||
BlocksEnd
|
BlocksEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
static int blocks_2005[] =
|
static int blocks_2005_2008[] =
|
||||||
{
|
{
|
||||||
VCPreBuildEventTool,
|
VCPreBuildEventTool,
|
||||||
VCCustomBuildTool,
|
VCCustomBuildTool,
|
||||||
@ -112,7 +112,8 @@ static int* blocks[] =
|
|||||||
{
|
{
|
||||||
blocks_2002,
|
blocks_2002,
|
||||||
blocks_2003,
|
blocks_2003,
|
||||||
blocks_2005
|
blocks_2005_2008,
|
||||||
|
blocks_2005_2008
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ static void tag_open(const char* name)
|
|||||||
{
|
{
|
||||||
if (opened)
|
if (opened)
|
||||||
{
|
{
|
||||||
if (version == VS2005 && attrib > 0)
|
if (version >= VS2005 && attrib > 0)
|
||||||
{
|
{
|
||||||
io_print("\n");
|
io_print("\n");
|
||||||
tag_indent();
|
tag_indent();
|
||||||
@ -192,7 +193,7 @@ static void tag_close(const char* name, int form)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (version == VS2005)
|
if (version >= VS2005)
|
||||||
{
|
{
|
||||||
io_print("\n");
|
io_print("\n");
|
||||||
tag_indent();
|
tag_indent();
|
||||||
@ -235,7 +236,7 @@ void vs_assign_guids()
|
|||||||
generateUUID(data->projGuid);
|
generateUUID(data->projGuid);
|
||||||
|
|
||||||
prj_select_config(0);
|
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->toolGuid, "E24C65DC-7377-472B-9ABA-BC803B73C61A");
|
||||||
strcpy(data->projExt, "");
|
strcpy(data->projExt, "");
|
||||||
@ -294,13 +295,16 @@ int vs_write_cpp()
|
|||||||
case VS2005:
|
case VS2005:
|
||||||
str = "8.00";
|
str = "8.00";
|
||||||
break;
|
break;
|
||||||
|
case VS2008:
|
||||||
|
str = "9.00";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
tag_attr("Version=\"%s\"", str);
|
tag_attr("Version=\"%s\"", str);
|
||||||
|
|
||||||
tag_attr("Name=\"%s\"", prj_get_pkgname());
|
tag_attr("Name=\"%s\"", prj_get_pkgname());
|
||||||
tag_attr("ProjectGUID=\"{%s}\"", data->projGuid);
|
tag_attr("ProjectGUID=\"{%s}\"", data->projGuid);
|
||||||
|
|
||||||
if (version == VS2005)
|
if (version >= VS2005)
|
||||||
tag_attr("RootNamespace=\"%s\"", prj_get_pkgname());
|
tag_attr("RootNamespace=\"%s\"", prj_get_pkgname());
|
||||||
|
|
||||||
tag_attr("Keyword=\"%s\"", prj_has_flag("managed") ? "ManagedCProj" : "Win32Proj");
|
tag_attr("Keyword=\"%s\"", prj_has_flag("managed") ? "ManagedCProj" : "Win32Proj");
|
||||||
@ -311,7 +315,7 @@ int vs_write_cpp()
|
|||||||
tag_close("Platform", 0);
|
tag_close("Platform", 0);
|
||||||
tag_close("Platforms", 1);
|
tag_close("Platforms", 1);
|
||||||
|
|
||||||
if (version == VS2005)
|
if (version >= VS2005)
|
||||||
{
|
{
|
||||||
tag_open("ToolFiles");
|
tag_open("ToolFiles");
|
||||||
tag_close("ToolFiles", 1);
|
tag_close("ToolFiles", 1);
|
||||||
@ -523,12 +527,12 @@ int vs_write_cpp()
|
|||||||
|
|
||||||
if (version < VS2005 && !prj_has_flag("no-rtti"))
|
if (version < VS2005 && !prj_has_flag("no-rtti"))
|
||||||
tag_attr("RuntimeTypeInfo=\"%s\"", S_TRUE);
|
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);
|
tag_attr("RuntimeTypeInfo=\"%s\"", S_FALSE);
|
||||||
|
|
||||||
if (version < VS2005 && prj_has_flag("native-wchar_t"))
|
if (version < VS2005 && prj_has_flag("native-wchar_t"))
|
||||||
tag_attr("TreatWChar_tAsBuiltInType=\"%s\"", S_TRUE);
|
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);
|
tag_attr("TreatWChar_tAsBuiltInType=\"%s\"", S_FALSE);
|
||||||
|
|
||||||
if (pchHeader)
|
if (pchHeader)
|
||||||
@ -542,7 +546,7 @@ int vs_write_cpp()
|
|||||||
tag_attr("WarningLevel=\"%d\"", prj_has_flag("extra-warnings") ? 4 : 3);
|
tag_attr("WarningLevel=\"%d\"", prj_has_flag("extra-warnings") ? 4 : 3);
|
||||||
if (prj_has_flag("fatal-warnings"))
|
if (prj_has_flag("fatal-warnings"))
|
||||||
tag_attr("WarnAsError=\"%s\"", S_TRUE);
|
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("Detect64BitPortabilityProblems=\"%s\"", prj_has_flag("no-64bit-checks") ? S_FALSE : S_TRUE);
|
||||||
|
|
||||||
tag_attr("DebugInformationFormat=\"%d\"", symbols);
|
tag_attr("DebugInformationFormat=\"%d\"", symbols);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Premake - vs.h
|
* 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
|
* Copyright (c) 2002-2006 Jason Perkins and the Premake project
|
||||||
*
|
*
|
||||||
@ -19,7 +19,8 @@ enum VsVer
|
|||||||
{
|
{
|
||||||
VS2002,
|
VS2002,
|
||||||
VS2003,
|
VS2003,
|
||||||
VS2005
|
VS2005,
|
||||||
|
VS2008
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct tagVsPkgData
|
typedef struct tagVsPkgData
|
||||||
|
@ -22,15 +22,23 @@
|
|||||||
#include "vs.h"
|
#include "vs.h"
|
||||||
#include "vs2005.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);
|
static const char* list_aspnet_refs(const char* name);
|
||||||
|
|
||||||
int vs2005_generate(int target)
|
int vs2005_generate(int target)
|
||||||
{
|
{
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
vs_setversion(VS2005);
|
if (target == 2005)
|
||||||
printf("Generating Visual Studio 2005 solution and project files:\n");
|
{
|
||||||
|
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 */
|
/* Assign GUIDs to packages */
|
||||||
vs_assign_guids();
|
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
|
* Write out the solution file
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
static int vs2005_write_solution()
|
static int vs2005_write_solution(int target)
|
||||||
{
|
{
|
||||||
VsPkgData* data;
|
VsPkgData* data;
|
||||||
int hasDotNet, hasCpp;
|
int hasDotNet, hasCpp;
|
||||||
@ -82,8 +90,16 @@ static int vs2005_write_solution()
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Format identification string */
|
/* Format identification string */
|
||||||
io_print("Microsoft Visual Studio Solution File, Format Version 9.00\n");
|
if (target == 2005)
|
||||||
io_print("# Visual Studio 2005\n");
|
{
|
||||||
|
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 */
|
/* List packages */
|
||||||
numAspNet = 0;
|
numAspNet = 0;
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
* GNU General Public License in the file LICENSE.txt for details.
|
* GNU General Public License in the file LICENSE.txt for details.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
int vs2005_generate();
|
int vs2005_generate(int target);
|
||||||
int vs2005_cs();
|
int vs2005_cs();
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem ** Create Visual Studio Workspaces on Windows **
|
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 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.
|
rem it's entirely analogous to other cmdlines - just copy+paste if needed again.
|
||||||
|
|
||||||
cd ..\premake
|
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\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
|
cd ..\workspaces
|
||||||
|
Loading…
Reference in New Issue
Block a user