mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 12:32:47 +00:00
Option to disable automatic dependencies
svn path=/branches/xmlbuildsystem/; revision=15413
This commit is contained in:
parent
2342aee312
commit
083a71c9f2
11 changed files with 72 additions and 52 deletions
|
@ -34,8 +34,7 @@ Backend::Factory::~Factory ()
|
|||
/*static*/ Backend*
|
||||
Backend::Factory::Create ( const string& name,
|
||||
Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo )
|
||||
Configuration& configuration )
|
||||
{
|
||||
string sname ( name );
|
||||
strlwr ( &sname[0] );
|
||||
|
@ -49,14 +48,12 @@ Backend::Factory::Create ( const string& name,
|
|||
throw UnknownBackendException ( sname );
|
||||
return NULL;
|
||||
}
|
||||
return (*f) ( project, verbose, cleanAsYouGo );
|
||||
return (*f) ( project, configuration );
|
||||
}
|
||||
|
||||
Backend::Backend ( Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo )
|
||||
Configuration& configuration )
|
||||
: ProjectNode ( project ),
|
||||
verbose ( verbose ),
|
||||
cleanAsYouGo ( cleanAsYouGo )
|
||||
configuration ( configuration )
|
||||
{
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class Backend;
|
||||
|
||||
typedef Backend* BackendFactory ( Project& project,
|
||||
bool verbose );
|
||||
Configuration& configuration );
|
||||
|
||||
class Backend
|
||||
{
|
||||
|
@ -22,26 +22,22 @@ public:
|
|||
virtual ~Factory();
|
||||
|
||||
virtual Backend* operator() ( Project&,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo ) = 0;
|
||||
Configuration& configuration ) = 0;
|
||||
|
||||
public:
|
||||
static Backend* Create ( const std::string& name,
|
||||
Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo );
|
||||
Configuration& configuration );
|
||||
};
|
||||
|
||||
protected:
|
||||
Backend ( Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo );
|
||||
Configuration& configuration );
|
||||
|
||||
public:
|
||||
virtual void Process () = 0;
|
||||
Project& ProjectNode;
|
||||
bool verbose;
|
||||
bool cleanAsYouGo;
|
||||
Configuration& configuration;
|
||||
};
|
||||
|
||||
#endif /* __BACKEND_H */
|
||||
|
|
|
@ -35,18 +35,16 @@ static class DevCppFactory : public Backend::Factory
|
|||
|
||||
DevCppFactory() : Factory("devcpp") {}
|
||||
Backend *operator() (Project &project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo)
|
||||
Configuration& configuration)
|
||||
{
|
||||
return new DevCppBackend(project, verbose, cleanAsYouGo);
|
||||
return new DevCppBackend(project, configuration);
|
||||
}
|
||||
|
||||
} factory;
|
||||
|
||||
|
||||
DevCppBackend::DevCppBackend(Project &project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo) : Backend(project, verbose, cleanAsYouGo)
|
||||
Configuration& configuration) : Backend(project, configuration)
|
||||
{
|
||||
m_unitCount = 0;
|
||||
}
|
||||
|
@ -113,8 +111,7 @@ void DevCppBackend::Process()
|
|||
|
||||
Backend *backend = Backend::Factory::Create("mingw",
|
||||
ProjectNode,
|
||||
verbose,
|
||||
cleanAsYouGo );
|
||||
configuration );
|
||||
backend->Process();
|
||||
delete backend;
|
||||
|
||||
|
|
|
@ -20,8 +20,7 @@ class DevCppBackend : public Backend
|
|||
public:
|
||||
|
||||
DevCppBackend(Project &project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo);
|
||||
Configuration& configuration);
|
||||
virtual ~DevCppBackend() {}
|
||||
|
||||
virtual void Process();
|
||||
|
|
|
@ -212,20 +212,17 @@ static class MingwFactory : public Backend::Factory
|
|||
public:
|
||||
MingwFactory() : Factory ( "mingw" ) {}
|
||||
Backend* operator() ( Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo )
|
||||
Configuration& configuration )
|
||||
{
|
||||
return new MingwBackend ( project,
|
||||
verbose,
|
||||
cleanAsYouGo );
|
||||
configuration );
|
||||
}
|
||||
} factory;
|
||||
|
||||
|
||||
MingwBackend::MingwBackend ( Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo )
|
||||
: Backend ( project, verbose, cleanAsYouGo ),
|
||||
Configuration& configuration )
|
||||
: Backend ( project, configuration ),
|
||||
intermediateDirectory ( new Directory ("$(INTERMEDIATE)" ) ),
|
||||
outputDirectory ( new Directory ( "$(OUTPUT)" ) ),
|
||||
installDirectory ( new Directory ( "$(INSTALL)" ) )
|
||||
|
@ -622,7 +619,7 @@ MingwBackend::UnpackWineResources ()
|
|||
printf ( "Unpacking WINE resources..." );
|
||||
WineResource wineResource ( ProjectNode,
|
||||
GetBin2ResExecutable () );
|
||||
wineResource.UnpackResources ( verbose );
|
||||
wineResource.UnpackResources ( configuration.Verbose );
|
||||
printf ( "done\n" );
|
||||
}
|
||||
|
||||
|
@ -631,7 +628,7 @@ MingwBackend::GenerateTestSupportCode ()
|
|||
{
|
||||
printf ( "Generating test support code..." );
|
||||
TestSupportCode testSupportCode ( ProjectNode );
|
||||
testSupportCode.GenerateTestSupportCode ( verbose );
|
||||
testSupportCode.GenerateTestSupportCode ( configuration.Verbose );
|
||||
printf ( "done\n" );
|
||||
}
|
||||
|
||||
|
@ -640,18 +637,21 @@ MingwBackend::GenerateProxyMakefiles ()
|
|||
{
|
||||
printf ( "Generating proxy makefiles..." );
|
||||
ProxyMakefile proxyMakefile ( ProjectNode );
|
||||
proxyMakefile.GenerateProxyMakefiles ( verbose );
|
||||
proxyMakefile.GenerateProxyMakefiles ( configuration.Verbose );
|
||||
printf ( "done\n" );
|
||||
}
|
||||
|
||||
void
|
||||
MingwBackend::CheckAutomaticDependencies ()
|
||||
{
|
||||
printf ( "Checking automatic dependencies..." );
|
||||
AutomaticDependency automaticDependency ( ProjectNode );
|
||||
automaticDependency.Process ();
|
||||
automaticDependency.CheckAutomaticDependencies ( verbose );
|
||||
printf ( "done\n" );
|
||||
if ( configuration.AutomaticDependencies )
|
||||
{
|
||||
printf ( "Checking automatic dependencies..." );
|
||||
AutomaticDependency automaticDependency ( ProjectNode );
|
||||
automaticDependency.Process ();
|
||||
automaticDependency.CheckAutomaticDependencies ( configuration.Verbose );
|
||||
printf ( "done\n" );
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -667,9 +667,9 @@ void
|
|||
MingwBackend::GenerateDirectories ()
|
||||
{
|
||||
printf ( "Creating directories..." );
|
||||
intermediateDirectory->GenerateTree ( "", verbose );
|
||||
outputDirectory->GenerateTree ( "", verbose );
|
||||
installDirectory->GenerateTree ( "", verbose );
|
||||
intermediateDirectory->GenerateTree ( "", configuration.Verbose );
|
||||
outputDirectory->GenerateTree ( "", configuration.Verbose );
|
||||
installDirectory->GenerateTree ( "", configuration.Verbose );
|
||||
printf ( "done\n" );
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ class MingwBackend : public Backend
|
|||
{
|
||||
public:
|
||||
MingwBackend ( Project& project,
|
||||
bool verbose,
|
||||
bool cleanAsYouGo );
|
||||
Configuration& configuration );
|
||||
virtual ~MingwBackend ();
|
||||
virtual void Process ();
|
||||
std::string AddDirectoryTarget ( const std::string& directory,
|
||||
|
|
|
@ -1280,7 +1280,7 @@ MingwModuleHandler::GetObjectsVector ( const IfableData& data,
|
|||
void
|
||||
MingwModuleHandler::GenerateCleanObjectsAsYouGoCode () const
|
||||
{
|
||||
if ( backend->cleanAsYouGo )
|
||||
if ( backend->configuration.CleanAsYouGo )
|
||||
{
|
||||
vector<string> objectFiles;
|
||||
GetObjectsVector ( module.non_if_data,
|
||||
|
|
15
reactos/tools/rbuild/configuration.cpp
Normal file
15
reactos/tools/rbuild/configuration.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "pch.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include "rbuild.h"
|
||||
|
||||
Configuration::Configuration ()
|
||||
{
|
||||
Verbose = false;
|
||||
CleanAsYouGo = false;
|
||||
AutomaticDependencies = true;
|
||||
}
|
||||
|
||||
Configuration::~Configuration ()
|
||||
{
|
||||
}
|
|
@ -18,8 +18,7 @@ using std::vector;
|
|||
|
||||
static string BuildSystem;
|
||||
static string RootXmlFile = "ReactOS.xml";
|
||||
static bool Verbose = false;
|
||||
static bool CleanAsYouGo = false;
|
||||
static Configuration configuration;
|
||||
|
||||
bool
|
||||
ParseSwitch ( int argc, char** argv, int index )
|
||||
|
@ -28,10 +27,13 @@ ParseSwitch ( int argc, char** argv, int index )
|
|||
switch ( switchChar )
|
||||
{
|
||||
case 'v':
|
||||
Verbose = true;
|
||||
configuration.Verbose = true;
|
||||
break;
|
||||
case 'c':
|
||||
CleanAsYouGo = true;
|
||||
configuration.CleanAsYouGo = true;
|
||||
break;
|
||||
case 'd':
|
||||
configuration.AutomaticDependencies = false;
|
||||
break;
|
||||
case 'r':
|
||||
RootXmlFile = string(&argv[index][2]);
|
||||
|
@ -74,6 +76,7 @@ main ( int argc, char** argv )
|
|||
printf ( "Switches:\n" );
|
||||
printf ( " -v Be verbose\n" );
|
||||
printf ( " -c Clean as you go. Delete generated files as soon as they are not needed anymore\n" );
|
||||
printf ( " -d Disable automatic dependencies.\n" );
|
||||
printf ( " -rfile.xml Name of the root xml file. Default is ReactOS.xml\n" );
|
||||
printf ( "\n" );
|
||||
printf ( " buildsystem Target build system. Can be one of:\n" );
|
||||
|
@ -91,8 +94,7 @@ main ( int argc, char** argv )
|
|||
project.ExecuteInvocations ();
|
||||
Backend* backend = Backend::Factory::Create ( BuildSystem,
|
||||
project,
|
||||
Verbose,
|
||||
CleanAsYouGo );
|
||||
configuration );
|
||||
backend->Process ();
|
||||
delete backend;
|
||||
|
||||
|
|
|
@ -68,6 +68,16 @@ class StubbedSymbol;
|
|||
class SourceFileTest;
|
||||
|
||||
|
||||
class Configuration
|
||||
{
|
||||
public:
|
||||
Configuration ();
|
||||
~Configuration ();
|
||||
bool Verbose;
|
||||
bool CleanAsYouGo;
|
||||
bool AutomaticDependencies;
|
||||
};
|
||||
|
||||
class Environment
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -115,6 +115,7 @@ RBUILD_COMMON_SOURCES = \
|
|||
bootstrap.cpp \
|
||||
cdfile.cpp \
|
||||
compilerflag.cpp \
|
||||
configuration.cpp \
|
||||
define.cpp \
|
||||
exception.cpp \
|
||||
filesupportcode.cpp \
|
||||
|
@ -225,6 +226,10 @@ $(RBUILD_INT_)compilerflag.o: $(RBUILD_BASE_)compilerflag.cpp $(RBUILD_HEADERS)
|
|||
$(ECHO_CC)
|
||||
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
|
||||
|
||||
$(RBUILD_INT_)configuration.o: $(RBUILD_BASE_)configuration.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
|
||||
$(ECHO_CC)
|
||||
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
|
||||
|
||||
$(RBUILD_INT_)define.o: $(RBUILD_BASE_)define.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
|
||||
$(ECHO_CC)
|
||||
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
|
||||
|
|
Loading…
Reference in a new issue