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

vs2005_solution.c « vs200x « action « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 27c89be89b9e105d8306f116a726ee8fcbbd7b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
 * \file   vs2005_solution.c
 * \brief  Visual Studio 2005 solution generation functions.
 * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
 */

#include <assert.h>
#include <stdlib.h>
#include "premake.h"
#include "vs200x_solution.h"


/**
 * Write out the Visual Studio solution-level platform configuration block.
 * \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 vs2005_solution_platforms(Session sess, Solution sln, Stream strm)
{
	int i, n, z;
	UNUSED(sess);

	z  = stream_writeline(strm, "Global");
	z |= stream_writeline(strm, "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");

	n = solution_num_configs(sln);
	for (i = 0; i < n; ++i)
	{
		const char* config_name = solution_get_config_name(sln, i);
		z |= stream_writeline(strm, "\t\t%s|Win32 = %s|Win32", config_name, config_name);
	}

	z |= stream_writeline(strm, "\tEndGlobalSection");
	return z;
}


/**
 * Write out the Visual Studio 2005 project-level platform configurations block.
 * \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 vs2005_solution_project_platforms(Session sess, Solution sln, Stream strm)
{
	int pi, pn, z;
	UNUSED(sess);
	z = stream_writeline(strm, "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
	pn = solution_num_projects(sln);
	for (pi = 0; pi < pn; ++pi)
	{
		int ci, cn;
		Project prj = solution_get_project(sln, pi);
		const char* prj_id = project_get_guid(prj);
		
		cn = solution_num_configs(sln);
		for (ci = 0; ci < cn; ++ci)
		{
			const char* config_name = solution_get_config_name(sln, ci);
			z |= stream_writeline(strm, "\t\t{%s}.%s|Win32.ActiveCfg = %s|Win32", prj_id, config_name, config_name);
			z |= stream_writeline(strm, "\t\t{%s}.%s|Win32.Build.0 = %s|Win32", prj_id, config_name, config_name);
		}
	}
	z |= stream_writeline(strm, "\tEndGlobalSection");
	return z;
}


/**
 * Write out the Visual Studio 2005 solution properties block.
 * \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 vs2005_solution_properties(Session sess, Solution sln, Stream strm)
{
	int z;
	UNUSED(sess);
	UNUSED(sln);
	z  = stream_writeline(strm, "\tGlobalSection(SolutionProperties) = preSolution");
	z |= stream_writeline(strm, "\t\tHideSolutionNode = FALSE");
	z |= stream_writeline(strm, "\tEndGlobalSection");
	z |= stream_writeline(strm, "EndGlobal");
	return z;
}


/**
 * Write the Visual Studio 2005 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 vs2005_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 9.00");
	z |= stream_writeline(strm, "# Visual Studio 2005");
	return z;
}