Author: weiden
Date: Sun Jun 24 16:54:54 2007
New Revision: 27269
URL:
http://svn.reactos.org/svn/reactos?rev=27269&view=rev
Log:
Place .h files generated from .idl definitions in the intermediate directory
Modified:
trunk/reactos/ReactOS.rbuild
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/include.cpp
trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/ReactOS.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS.rbuild?rev=27269&a…
==============================================================================
--- trunk/reactos/ReactOS.rbuild (original)
+++ trunk/reactos/ReactOS.rbuild Sun Jun 24 16:54:54 2007
@@ -62,6 +62,7 @@
<include>.</include>
<include>include</include>
<include>include/psdk</include>
+ <include base="__intermediate">include/psdk</include>
<include>include/dxsdk</include>
<include>include/crt</include>
<include>include/ddk</include>
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Sun Jun 24 16:54:54 2007
@@ -323,6 +323,8 @@
else //if ( module.type == IdlHeader )
{
newname = basename + ".h";
+ PassThruCacheDirectory ( NormalizeFilename ( newname ),
+ backend->intermediateDirectory );
return new FileLocation ( fileLocation->directory, filename );
}
}
@@ -341,7 +343,7 @@
if ( (module.type == RpcServer) || (module.type == RpcClient) )
return GetRpcServerHeaderFilename ( basename ) + " " +
GetRpcClientHeaderFilename ( basename );
else
- return GetIdlHeaderFilename ( basename );
+ return GetIdlHeaderFilename ( basename );
}
else
return "";
@@ -522,9 +524,6 @@
else
directoryTree = backend->intermediateDirectory;
- if (newExtension == ".h")
- directoryTree = NULL;
-
string obj_file = PassThruCacheDirectory (
NormalizeFilename ( ReplaceExtension (
RemoveVariables ( sourceFilename ),
@@ -679,13 +678,20 @@
/* static */ string
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const
vector<Include*>& includes )
{
- string parameters;
+ string parameters, path_prefix;
for ( size_t i = 0; i < includes.size (); i++ )
{
Include& include = *includes[i];
if ( parameters.length () > 0 )
parameters += " ";
- parameters += "-I" + include.directory;
+ if ( include.baseValue == "__intermediate" )
+ path_prefix = backend->intermediateDirectory->name + cSep;
+ else if (include.baseValue == "__output" )
+ path_prefix = backend->outputDirectory->name + cSep;
+ else
+ path_prefix = "";
+
+ parameters += "-I" + path_prefix + include.directory;
}
return parameters;
}
@@ -1234,7 +1240,8 @@
string
MingwModuleHandler::GetIdlHeaderFilename ( string basename ) const
{
- return basename + ".h";
+ return PassThruCacheDirectory ( basename + ".h",
+ backend->intermediateDirectory );
}
void
Modified: trunk/reactos/tools/rbuild/include.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/include.cpp?r…
==============================================================================
--- trunk/reactos/tools/rbuild/include.cpp (original)
+++ trunk/reactos/tools/rbuild/include.cpp Sun Jun 24 16:54:54 2007
@@ -52,6 +52,7 @@
{
this->directory = NormalizeFilename ( basePath + sSep + directory );
this->basePath = NormalizeFilename ( basePath );
+ this->baseValue = basePath;
}
Include::~Include ()
@@ -65,26 +66,40 @@
att = node->GetAttribute ( "base", false );
if ( att )
{
+ bool referenceResolved = false;
+ baseValue = att->value;
+
if ( !module )
- throw XMLInvalidBuildFileException (
- node->location,
- "'base' attribute illegal from global <include>" );
- bool referenceResolved = false;
- if ( att->value == project.name )
{
- basePath = ".";
- referenceResolved = true;
+ if ( att->value == "__intermediate" || att->value ==
"__output" )
+ referenceResolved = true;
+ else
+ {
+ throw XMLInvalidBuildFileException (
+ node->location,
+ "'base' attribute illegal from global <include>" );
+ }
}
- else
+
+ if ( !referenceResolved )
{
- const Module* base = project.LocateModule ( att->value );
- if ( base != NULL )
+ if ( att->value == project.name )
{
- baseModule = base;
- basePath = base->GetBasePath ();
+ basePath = ".";
referenceResolved = true;
}
+ else
+ {
+ const Module* base = project.LocateModule ( att->value );
+ if ( base != NULL )
+ {
+ baseModule = base;
+ basePath = base->GetBasePath ();
+ referenceResolved = true;
+ }
+ }
}
+
if ( !referenceResolved )
throw XMLInvalidBuildFileException (
node->location,
Modified: trunk/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Sun Jun 24 16:54:54 2007
@@ -366,6 +366,7 @@
const Module* baseModule;
std::string directory;
std::string basePath;
+ std::string baseValue;
Include ( const Project& project,
const XMLElement* includeNode );