Place .h files generated from .idl definitions in the intermediate directory

svn path=/trunk/; revision=27269
This commit is contained in:
Thomas Bluemel 2007-06-24 12:54:54 +00:00
parent caa55436f4
commit a5b5d59762
4 changed files with 46 additions and 22 deletions

View file

@ -62,6 +62,7 @@
<include>.</include> <include>.</include>
<include>include</include> <include>include</include>
<include>include/psdk</include> <include>include/psdk</include>
<include base="__intermediate">include/psdk</include>
<include>include/dxsdk</include> <include>include/dxsdk</include>
<include>include/crt</include> <include>include/crt</include>
<include>include/ddk</include> <include>include/ddk</include>

View file

@ -323,6 +323,8 @@ MingwModuleHandler::GetActualSourceFilename (
else //if ( module.type == IdlHeader ) else //if ( module.type == IdlHeader )
{ {
newname = basename + ".h"; newname = basename + ".h";
PassThruCacheDirectory ( NormalizeFilename ( newname ),
backend->intermediateDirectory );
return new FileLocation ( fileLocation->directory, filename ); return new FileLocation ( fileLocation->directory, filename );
} }
} }
@ -341,7 +343,7 @@ MingwModuleHandler::GetExtraDependencies (
if ( (module.type == RpcServer) || (module.type == RpcClient) ) if ( (module.type == RpcServer) || (module.type == RpcClient) )
return GetRpcServerHeaderFilename ( basename ) + " " + GetRpcClientHeaderFilename ( basename ); return GetRpcServerHeaderFilename ( basename ) + " " + GetRpcClientHeaderFilename ( basename );
else else
return GetIdlHeaderFilename ( basename ); return GetIdlHeaderFilename ( basename );
} }
else else
return ""; return "";
@ -522,9 +524,6 @@ MingwModuleHandler::GetObjectFilename (
else else
directoryTree = backend->intermediateDirectory; directoryTree = backend->intermediateDirectory;
if (newExtension == ".h")
directoryTree = NULL;
string obj_file = PassThruCacheDirectory ( string obj_file = PassThruCacheDirectory (
NormalizeFilename ( ReplaceExtension ( NormalizeFilename ( ReplaceExtension (
RemoveVariables ( sourceFilename ), RemoveVariables ( sourceFilename ),
@ -679,13 +678,20 @@ MingwModuleHandler::ConcatenatePaths (
/* static */ string /* static */ string
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes ) MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes )
{ {
string parameters; string parameters, path_prefix;
for ( size_t i = 0; i < includes.size (); i++ ) for ( size_t i = 0; i < includes.size (); i++ )
{ {
Include& include = *includes[i]; Include& include = *includes[i];
if ( parameters.length () > 0 ) if ( parameters.length () > 0 )
parameters += " "; 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; return parameters;
} }
@ -1234,7 +1240,8 @@ MingwModuleHandler::GetRpcClientHeaderFilename ( string basename ) const
string string
MingwModuleHandler::GetIdlHeaderFilename ( string basename ) const MingwModuleHandler::GetIdlHeaderFilename ( string basename ) const
{ {
return basename + ".h"; return PassThruCacheDirectory ( basename + ".h",
backend->intermediateDirectory );
} }
void void

View file

@ -52,6 +52,7 @@ Include::Include ( const Project& project,
{ {
this->directory = NormalizeFilename ( basePath + sSep + directory ); this->directory = NormalizeFilename ( basePath + sSep + directory );
this->basePath = NormalizeFilename ( basePath ); this->basePath = NormalizeFilename ( basePath );
this->baseValue = basePath;
} }
Include::~Include () Include::~Include ()
@ -65,26 +66,40 @@ Include::ProcessXML()
att = node->GetAttribute ( "base", false ); att = node->GetAttribute ( "base", false );
if ( att ) if ( att )
{ {
if ( !module )
throw XMLInvalidBuildFileException (
node->location,
"'base' attribute illegal from global <include>" );
bool referenceResolved = false; bool referenceResolved = false;
if ( att->value == project.name ) baseValue = att->value;
if ( !module )
{ {
basePath = "."; if ( att->value == "__intermediate" || att->value == "__output" )
referenceResolved = true;
}
else
{
const Module* base = project.LocateModule ( att->value );
if ( base != NULL )
{
baseModule = base;
basePath = base->GetBasePath ();
referenceResolved = true; referenceResolved = true;
else
{
throw XMLInvalidBuildFileException (
node->location,
"'base' attribute illegal from global <include>" );
} }
} }
if ( !referenceResolved )
{
if ( att->value == project.name )
{
basePath = ".";
referenceResolved = true;
}
else
{
const Module* base = project.LocateModule ( att->value );
if ( base != NULL )
{
baseModule = base;
basePath = base->GetBasePath ();
referenceResolved = true;
}
}
}
if ( !referenceResolved ) if ( !referenceResolved )
throw XMLInvalidBuildFileException ( throw XMLInvalidBuildFileException (
node->location, node->location,

View file

@ -366,6 +366,7 @@ public:
const Module* baseModule; const Module* baseModule;
std::string directory; std::string directory;
std::string basePath; std::string basePath;
std::string baseValue;
Include ( const Project& project, Include ( const Project& project,
const XMLElement* includeNode ); const XMLElement* includeNode );