Merge 14551:14980 from trunk
[reactos.git] / reactos / tools / rbuild / bootstrap.cpp
1 #include "pch.h"
2 #include <assert.h>
3
4 #include "rbuild.h"
5
6 using std::string;
7
8 Bootstrap::Bootstrap ( const Project& project_,
9 const Module* module_,
10 const XMLElement& bootstrapNode )
11 : project(project_),
12 module(module_),
13 node(bootstrapNode)
14 {
15 Initialize();
16 }
17
18 Bootstrap::~Bootstrap ()
19 {
20 }
21
22 bool
23 Bootstrap::IsSupportedModuleType ( ModuleType type )
24 {
25 switch ( type )
26 {
27 case Kernel:
28 case KernelModeDLL:
29 case NativeDLL:
30 case NativeCUI:
31 case Win32DLL:
32 case Win32CUI:
33 case Win32GUI:
34 case KernelModeDriver:
35 case BootSector:
36 case BootLoader:
37 return true;
38 case BuildTool:
39 case StaticLibrary:
40 case ObjectLibrary:
41 case Iso:
42 case LiveIso:
43 case Test:
44 case RpcServer:
45 case RpcClient:
46 return false;
47 }
48 throw InvalidOperationException ( __FILE__,
49 __LINE__ );
50 }
51
52 void
53 Bootstrap::Initialize ()
54 {
55 if ( !IsSupportedModuleType ( module->type ) )
56 {
57 throw InvalidBuildFileException (
58 node.location,
59 "<bootstrap> is not applicable for this module type." );
60 }
61
62 const XMLAttribute* att = node.GetAttribute ( "base", false );
63 if ( att != NULL )
64 base = att->value;
65 else
66 base = "";
67
68 att = node.GetAttribute ( "nameoncd", false );
69 if ( att != NULL )
70 nameoncd = att->value;
71 else
72 nameoncd = module->GetTargetName ();
73 }
74
75 void
76 Bootstrap::ProcessXML()
77 {
78 }