Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstarkos <none@none>2008-04-22 18:58:30 +0400
committerstarkos <none@none>2008-04-22 18:58:30 +0400
commit4b04d27a2380e03988b36c90a07070288f7c9236 (patch)
treeeb0c53942b97c8d1700830035ede33bb91fea09b
parent43ad264558b5c7ecd471efd90353603d9589a1a8 (diff)
Added initial support for Visual Studio 2008 solutions.
-rw-r--r--samples/vs2008/CppExe/CppExe.vcproj225
-rw-r--r--samples/vs2008/MySolution.sln20
-rw-r--r--src/action/action.c1
-rw-r--r--src/action/action.h1
-rw-r--r--src/action/make/gmake.c6
-rw-r--r--src/action/vs200x/tests/vs2002_solution_tests.cpp16
-rw-r--r--src/action/vs200x/tests/vs2003_solution_tests.cpp8
-rw-r--r--src/action/vs200x/tests/vs2005_solution_tests.cpp12
-rw-r--r--src/action/vs200x/tests/vs2008_solution_tests.cpp30
-rw-r--r--src/action/vs200x/tests/vs200x_tests.cpp10
-rw-r--r--src/action/vs200x/tests/vs200x_tests.h42
-rw-r--r--src/action/vs200x/vs2002.c6
-rw-r--r--src/action/vs200x/vs2003.c6
-rw-r--r--src/action/vs200x/vs2005.c6
-rw-r--r--src/action/vs200x/vs2008.c42
-rw-r--r--src/action/vs200x/vs2008_solution.c29
-rw-r--r--src/action/vs200x/vs200x_solution.h2
17 files changed, 381 insertions, 81 deletions
diff --git a/samples/vs2008/CppExe/CppExe.vcproj b/samples/vs2008/CppExe/CppExe.vcproj
new file mode 100644
index 0000000..41f914c
--- /dev/null
+++ b/samples/vs2008/CppExe/CppExe.vcproj
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="CppExe"
+ ProjectGUID="{790A1FC0-287D-4F4A-8AE8-D0B48406BECF}"
+ RootNamespace="CppExe"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\CppExe.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\targetver.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/samples/vs2008/MySolution.sln b/samples/vs2008/MySolution.sln
new file mode 100644
index 0000000..eaa9dea
--- /dev/null
+++ b/samples/vs2008/MySolution.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppExe", "CppExe\CppExe.vcproj", "{790A1FC0-287D-4F4A-8AE8-D0B48406BECF}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {790A1FC0-287D-4F4A-8AE8-D0B48406BECF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {790A1FC0-287D-4F4A-8AE8-D0B48406BECF}.Debug|Win32.Build.0 = Debug|Win32
+ {790A1FC0-287D-4F4A-8AE8-D0B48406BECF}.Release|Win32.ActiveCfg = Release|Win32
+ {790A1FC0-287D-4F4A-8AE8-D0B48406BECF}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/src/action/action.c b/src/action/action.c
index b407dc6..609a3e3 100644
--- a/src/action/action.c
+++ b/src/action/action.c
@@ -14,5 +14,6 @@ SessionAction Actions[] =
{ "vs2002", "Microsoft Visual Studio 2002", vs2002_action },
{ "vs2003", "Microsoft Visual Studio 2003", vs2003_action },
{ "vs2005", "Microsoft Visual Studio 2005 (includes Express editions)", vs2005_action },
+ { "vs2008", "Microsoft Visual Studio 2008 (includes Express editions)", vs2008_action },
{ 0, 0, 0 }
};
diff --git a/src/action/action.h b/src/action/action.h
index f2f5b30..f022d96 100644
--- a/src/action/action.h
+++ b/src/action/action.h
@@ -14,5 +14,6 @@ int gmake_action(Session sess);
int vs2002_action(Session sess);
int vs2003_action(Session sess);
int vs2005_action(Session sess);
+int vs2008_action(Session sess);
#endif
diff --git a/src/action/make/gmake.c b/src/action/make/gmake.c
index 4958731..6664fa9 100644
--- a/src/action/make/gmake.c
+++ b/src/action/make/gmake.c
@@ -11,7 +11,7 @@
/** The GNU make solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback GmakeSolutionCallbacks[] =
+static SessionSolutionCallback SolutionCallbacks[] =
{
make_solution_create,
gmake_solution_signature,
@@ -24,7 +24,7 @@ static SessionSolutionCallback GmakeSolutionCallbacks[] =
};
/** The GNU make project writing process, for session_enumerate_objects() */
-static SessionProjectCallback GmakeProjectCallbacks[] =
+static SessionProjectCallback ProjectCallbacks[] =
{
NULL
};
@@ -38,6 +38,6 @@ static SessionProjectCallback GmakeProjectCallbacks[] =
int gmake_action(Session sess)
{
stream_writeline(Console, "Generating project files for GNU make...");
- return session_enumerate_objects(sess, GmakeSolutionCallbacks, GmakeProjectCallbacks);
+ return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks);
}
diff --git a/src/action/vs200x/tests/vs2002_solution_tests.cpp b/src/action/vs200x/tests/vs2002_solution_tests.cpp
index 0796782..97c352f 100644
--- a/src/action/vs200x/tests/vs2002_solution_tests.cpp
+++ b/src/action/vs200x/tests/vs2002_solution_tests.cpp
@@ -5,13 +5,11 @@
*/
#include "premake.h"
-#include "testing/testing.h"
+#include "action/tests/action_tests.h"
extern "C" {
#include "action/vs200x/vs200x_solution.h"
}
-#include "vs200x_tests.h"
-
SUITE(action)
{
@@ -19,7 +17,7 @@ SUITE(action)
* Signature tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_Signature_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2002_Signature_IsCorrect)
{
vs2002_solution_signature(sess, sln, strm);
CHECK_EQUAL(
@@ -32,7 +30,7 @@ SUITE(action)
* Project entry tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_ProjectEntry_UsesRelativePath)
+ TEST_FIXTURE(FxAction, Vs2002_ProjectEntry_UsesRelativePath)
{
vs2002_solution_projects(sess, sln, strm);
CHECK_EQUAL(
@@ -46,7 +44,7 @@ SUITE(action)
* Solution configuration tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_SolutionConfiguration_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2002_SolutionConfiguration_IsCorrect)
{
vs2002_solution_configuration(sess, sln, strm);
CHECK_EQUAL(
@@ -63,7 +61,7 @@ SUITE(action)
* Project dependencies tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_ProjectDependencies_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2002_ProjectDependencies_IsCorrect)
{
vs2002_solution_dependencies(sess, sln, strm);
CHECK_EQUAL(
@@ -77,7 +75,7 @@ SUITE(action)
* Project configuration tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_ProjectConfiguration_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2002_ProjectConfiguration_IsCorrect)
{
vs2002_solution_project_configuration(sess, sln, strm);
CHECK_EQUAL(
@@ -95,7 +93,7 @@ SUITE(action)
* Solution extensibility tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2002_Extensibility_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2002_Extensibility_IsCorrect)
{
vs2002_solution_extensibility(sess, sln, strm);
CHECK_EQUAL(
diff --git a/src/action/vs200x/tests/vs2003_solution_tests.cpp b/src/action/vs200x/tests/vs2003_solution_tests.cpp
index d881824..ee4fa2b 100644
--- a/src/action/vs200x/tests/vs2003_solution_tests.cpp
+++ b/src/action/vs200x/tests/vs2003_solution_tests.cpp
@@ -5,13 +5,11 @@
*/
#include "premake.h"
-#include "testing/testing.h"
+#include "action/tests/action_tests.h"
extern "C" {
#include "action/vs200x/vs200x_solution.h"
}
-#include "vs200x_tests.h"
-
SUITE(action)
{
@@ -19,7 +17,7 @@ SUITE(action)
* Signature tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2003_Signature_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2003_Signature_IsCorrect)
{
vs2003_solution_signature(sess, sln, strm);
CHECK_EQUAL(
@@ -32,7 +30,7 @@ SUITE(action)
* Solution configuration tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2003_SolutionConfiguration_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2003_SolutionConfiguration_IsCorrect)
{
vs2003_solution_configuration(sess, sln, strm);
CHECK_EQUAL(
diff --git a/src/action/vs200x/tests/vs2005_solution_tests.cpp b/src/action/vs200x/tests/vs2005_solution_tests.cpp
index 70243f1..416572a 100644
--- a/src/action/vs200x/tests/vs2005_solution_tests.cpp
+++ b/src/action/vs200x/tests/vs2005_solution_tests.cpp
@@ -5,13 +5,11 @@
*/
#include "premake.h"
-#include "testing/testing.h"
+#include "action/tests/action_tests.h"
extern "C" {
#include "action/vs200x/vs200x_solution.h"
}
-#include "vs200x_tests.h"
-
SUITE(action)
{
@@ -19,7 +17,7 @@ SUITE(action)
* Signature tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Vs2005_Signature_IsCorrect)
+ TEST_FIXTURE(FxAction, Vs2005_Signature_IsCorrect)
{
vs2005_solution_signature(sess, sln, strm);
CHECK_EQUAL(
@@ -34,7 +32,7 @@ SUITE(action)
* Solution Configuration Platforms tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Platforms_IsCorrect)
+ TEST_FIXTURE(FxAction, Platforms_IsCorrect)
{
vs2005_solution_platforms(sess, sln, strm);
CHECK_EQUAL(
@@ -51,7 +49,7 @@ SUITE(action)
* Project Configuration Platforms tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, ProjectPlatforms_IsCorrect)
+ TEST_FIXTURE(FxAction, ProjectPlatforms_IsCorrect)
{
vs2005_solution_project_platforms(sess, sln, strm);
CHECK_EQUAL(
@@ -69,7 +67,7 @@ SUITE(action)
* Solution Project tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, Properties_IsCorrect)
+ TEST_FIXTURE(FxAction, Properties_IsCorrect)
{
vs2005_solution_properties(sess, sln, strm);
CHECK_EQUAL(
diff --git a/src/action/vs200x/tests/vs2008_solution_tests.cpp b/src/action/vs200x/tests/vs2008_solution_tests.cpp
new file mode 100644
index 0000000..87202d4
--- /dev/null
+++ b/src/action/vs200x/tests/vs2008_solution_tests.cpp
@@ -0,0 +1,30 @@
+/**
+ * \file vs2008_solution_tests.cpp
+ * \brief Automated tests for VS2008 solution processing.
+ * \author Copyright (c) 2008 Jason Perkins and the Premake project
+ */
+
+#include "premake.h"
+#include "action/tests/action_tests.h"
+extern "C" {
+#include "action/vs200x/vs200x_solution.h"
+}
+
+
+SUITE(action)
+{
+ /**********************************************************************
+ * Signature tests
+ **********************************************************************/
+
+ TEST_FIXTURE(FxAction, Vs2008_Signature_IsCorrect)
+ {
+ vs2008_solution_signature(sess, sln, strm);
+ CHECK_EQUAL(
+ "\357\273\277\r\n"
+ "Microsoft Visual Studio Solution File, Format Version 10.00\r\n"
+ "# Visual Studio 2008\r\n",
+ buffer);
+ }
+
+} \ No newline at end of file
diff --git a/src/action/vs200x/tests/vs200x_tests.cpp b/src/action/vs200x/tests/vs200x_tests.cpp
index 6643970..857aa9a 100644
--- a/src/action/vs200x/tests/vs200x_tests.cpp
+++ b/src/action/vs200x/tests/vs200x_tests.cpp
@@ -5,13 +5,11 @@
*/
#include "premake.h"
-#include "testing/testing.h"
+#include "action/tests/action_tests.h"
extern "C" {
#include "action/vs200x/vs200x.h"
}
-#include "vs200x_tests.h"
-
SUITE(action)
{
@@ -19,21 +17,21 @@ SUITE(action)
* Version identification tests
**********************************************************************/
- TEST_FIXTURE(FxVs200x, GetTargetVersion_Returns2002_OnVs2002)
+ TEST_FIXTURE(FxAction, GetTargetVersion_Returns2002_OnVs2002)
{
session_set_action(sess, "vs2002");
int result = vs200x_get_target_version(sess);
CHECK(result == 2002);
}
- TEST_FIXTURE(FxVs200x, GetTargetVersion_Returns2003_OnVs2003)
+ TEST_FIXTURE(FxAction, GetTargetVersion_Returns2003_OnVs2003)
{
session_set_action(sess, "vs2003");
int result = vs200x_get_target_version(sess);
CHECK(result == 2003);
}
- TEST_FIXTURE(FxVs200x, GetTargetVersion_Returns2005_OnVs2005)
+ TEST_FIXTURE(FxAction, GetTargetVersion_Returns2005_OnVs2005)
{
session_set_action(sess, "vs2005");
int result = vs200x_get_target_version(sess);
diff --git a/src/action/vs200x/tests/vs200x_tests.h b/src/action/vs200x/tests/vs200x_tests.h
deleted file mode 100644
index b967654..0000000
--- a/src/action/vs200x/tests/vs200x_tests.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * \file vs200x_tests.h
- * \brief Standard test fixtures for Visual Studio.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-struct FxVs200x
-{
- Session sess;
- Stream strm;
- Solution sln;
- Project prj;
- char buffer[8192];
-
- FxVs200x()
- {
- sess = session_create();
-
- strm = stream_create_null();
- stream_set_buffer(strm, buffer);
-
- sln = solution_create();
- solution_set_name(sln, "MySolution");
- solution_set_base_dir(sln, "/Root");
- solution_add_config_name(sln, "Debug");
- solution_add_config_name(sln, "Release");
-
- prj = project_create();
- project_set_name(prj, "MyProject");
- project_set_base_dir(prj, "/Root");
- project_set_location(prj, "ProjectFolder");
- project_set_guid(prj, "AE2461B7-236F-4278-81D3-F0D476F9A4C0");
- solution_add_project(sln, prj);
- }
-
- ~FxVs200x()
- {
- solution_destroy(sln);
- stream_destroy(strm);
- session_destroy(sess);
- }
-};
diff --git a/src/action/vs200x/vs2002.c b/src/action/vs200x/vs2002.c
index 8c0c8a9..32b433e 100644
--- a/src/action/vs200x/vs2002.c
+++ b/src/action/vs200x/vs2002.c
@@ -11,7 +11,7 @@
/** The VS2002 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback Vs2002SolutionCallbacks[] =
+static SessionSolutionCallback SolutionCallbacks[] =
{
vs2002_solution_create,
vs2002_solution_signature,
@@ -24,7 +24,7 @@ static SessionSolutionCallback Vs2002SolutionCallbacks[] =
};
/** The VS2002 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback Vs2002ProjectCallbacks[] =
+static SessionProjectCallback ProjectCallbacks[] =
{
NULL
};
@@ -38,6 +38,6 @@ static SessionProjectCallback Vs2002ProjectCallbacks[] =
int vs2002_action(Session sess)
{
stream_writeline(Console, "Generating project files for Visual Studio 2002...");
- return session_enumerate_objects(sess, Vs2002SolutionCallbacks, Vs2002ProjectCallbacks);
+ return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks);
}
diff --git a/src/action/vs200x/vs2003.c b/src/action/vs200x/vs2003.c
index 4bc026a..e63f98d 100644
--- a/src/action/vs200x/vs2003.c
+++ b/src/action/vs200x/vs2003.c
@@ -11,7 +11,7 @@
/** The VS2003 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback Vs2003SolutionCallbacks[] =
+static SessionSolutionCallback SolutionCallbacks[] =
{
vs2002_solution_create,
vs2003_solution_signature,
@@ -23,7 +23,7 @@ static SessionSolutionCallback Vs2003SolutionCallbacks[] =
};
/** The VS2003 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback Vs2003ProjectCallbacks[] =
+static SessionProjectCallback ProjectCallbacks[] =
{
NULL
};
@@ -37,5 +37,5 @@ static SessionProjectCallback Vs2003ProjectCallbacks[] =
int vs2003_action(Session sess)
{
stream_writeline(Console, "Generating project files for Visual Studio 2003...");
- return session_enumerate_objects(sess, Vs2003SolutionCallbacks, Vs2003ProjectCallbacks);
+ return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks);
}
diff --git a/src/action/vs200x/vs2005.c b/src/action/vs200x/vs2005.c
index 975d0f6..4501e38 100644
--- a/src/action/vs200x/vs2005.c
+++ b/src/action/vs200x/vs2005.c
@@ -11,7 +11,7 @@
/** The VS2005 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback Vs2005SolutionCallbacks[] =
+static SessionSolutionCallback SolutionCallbacks[] =
{
vs2002_solution_create,
vs2005_solution_signature,
@@ -23,7 +23,7 @@ static SessionSolutionCallback Vs2005SolutionCallbacks[] =
};
/** The VS2005 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback Vs2005ProjectCallbacks[] =
+static SessionProjectCallback ProjectCallbacks[] =
{
NULL
};
@@ -37,6 +37,6 @@ static SessionProjectCallback Vs2005ProjectCallbacks[] =
int vs2005_action(Session sess)
{
stream_writeline(Console, "Generating project files for Visual Studio 2005...");
- return session_enumerate_objects(sess, Vs2005SolutionCallbacks, Vs2005ProjectCallbacks);
+ return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks);
}
diff --git a/src/action/vs200x/vs2008.c b/src/action/vs200x/vs2008.c
new file mode 100644
index 0000000..2ff40d7
--- /dev/null
+++ b/src/action/vs200x/vs2008.c
@@ -0,0 +1,42 @@
+/**
+ * \file vs2008.c
+ * \brief Visual Studio 2008 project file generation action.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <stdlib.h>
+#include "premake.h"
+#include "action/action.h"
+#include "vs200x_solution.h"
+
+
+/** The VS2008 solution writing process, for session_enumerate_objects() */
+static SessionSolutionCallback SolutionCallbacks[] =
+{
+ vs2002_solution_create,
+ vs2008_solution_signature,
+ vs2002_solution_projects,
+ vs2005_solution_platforms,
+ vs2005_solution_project_platforms,
+ vs2005_solution_properties,
+ NULL
+};
+
+/** The VS2008 project writing process, for session_enumerate_objects() */
+static SessionProjectCallback ProjectCallbacks[] =
+{
+ NULL
+};
+
+
+/**
+ * The Visual Studio 2008 action handler.
+ * \param sess The active session object.
+ * \returns OKAY if successful.
+ */
+int vs2008_action(Session sess)
+{
+ stream_writeline(Console, "Generating project files for Visual Studio 2008...");
+ return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks);
+}
+
diff --git a/src/action/vs200x/vs2008_solution.c b/src/action/vs200x/vs2008_solution.c
new file mode 100644
index 0000000..73e4e8e
--- /dev/null
+++ b/src/action/vs200x/vs2008_solution.c
@@ -0,0 +1,29 @@
+/**
+ * \file vs2008_solution.c
+ * \brief Visual Studio 2008 solution generation functions.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include "premake.h"
+#include "vs200x_solution.h"
+
+
+/**
+ * Write the Visual Studio 2008 solution file signature.
+ * \param sess The execution session context.
+ * \param sln The current solution.
+ * \param strm The currently active stream; set with session_set_active_stream().
+ * \returns OKAY if successful.
+ */
+int vs2008_solution_signature(Session sess, Solution sln, Stream strm)
+{
+ int z;
+ UNUSED(sess);
+ UNUSED(sln);
+ stream_set_newline(strm, "\r\n");
+ z = stream_write_unicode_marker(strm);
+ z |= stream_writeline(strm, "");
+ z |= stream_writeline(strm, "Microsoft Visual Studio Solution File, Format Version 10.00");
+ z |= stream_writeline(strm, "# Visual Studio 2008");
+ return z;
+}
diff --git a/src/action/vs200x/vs200x_solution.h b/src/action/vs200x/vs200x_solution.h
index 1d926d4..03d8d52 100644
--- a/src/action/vs200x/vs200x_solution.h
+++ b/src/action/vs200x/vs200x_solution.h
@@ -24,4 +24,6 @@ int vs2005_solution_project_platforms(Session sess, Solution sln, Stream strm);
int vs2005_solution_properties(Session sess, Solution sln, Stream strm);
int vs2005_solution_signature(Session sess, Solution sln, Stream strm);
+int vs2008_solution_signature(Session sess, Solution sln, Stream strm);
+
#endif