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

premake.c « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8c577612913995453dfcfc383b6f7147526ebc38 (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
/**
 * \file   premake.c
 * \brief  Program entry point.
 * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
 */

#include <stdlib.h>
#include "premake.h"
#include "host/host.h"
#include "action/action.h"


/**
 * These are the steps in the process; each function runs one part of the whole.
 */
static HostExecutionStep Steps[] =
{
	host_parse_argv,        /* process the command line arguments */
	host_run_script,        /* run the main script (i.e. premake4.lua) */
	session_unload,         /* unload the objects built by the script into more accessible C data structures */
	host_show_help,         /* show help and version messages as appropriate; may end processing here */
	host_run_action,        /* run the action specified on the command line */
	NULL                    /* all done! */
};


/**
 * \brief   Program entry point.
 */
int main(int argc, const char** argv)
{
	Session sess;

	/* If testing is enabled, calling premake.exe with no arguments will
	 * trigger a call to the automated tests. This is used by a post-build
	 * step to run the tests after every successful build. */
#if defined(TESTING_ENABLED)
	if (argc == 1)
	{
		return host_tests();
	}
#else
    UNUSED(argc);
#endif

	/* initialize */
	host_set_argv(argv);
	sess = session_create();

	/* run */
	host_run_steps(sess, Steps);

	/* report back to the user and clean up */
	host_report_results(sess);
	session_destroy(sess);
	return OKAY;
}