mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Generate pre-compiled headers in intermediate directory tree
svn path=/trunk/; revision=16459
This commit is contained in:
parent
c82da07ee2
commit
8a1b2d5c2b
4 changed files with 53 additions and 39 deletions
|
@ -24,7 +24,7 @@
|
||||||
<file>sysinfo.c</file>
|
<file>sysinfo.c</file>
|
||||||
<file>time.c</file>
|
<file>time.c</file>
|
||||||
<file>timer.c</file>
|
<file>timer.c</file>
|
||||||
<pch>../include/hal.h</pch>
|
<pch>../include/hal.h</pch>
|
||||||
</module>
|
</module>
|
||||||
<module name="hal_generic_up" type="objectlibrary">
|
<module name="hal_generic_up" type="objectlibrary">
|
||||||
<include base="hal_generic_up">../include</include>
|
<include base="hal_generic_up">../include</include>
|
||||||
|
|
|
@ -15,5 +15,4 @@
|
||||||
<file>part_xbox.c</file>
|
<file>part_xbox.c</file>
|
||||||
<file>pci_xbox.c</file>
|
<file>pci_xbox.c</file>
|
||||||
<file>halxbox.rc</file>
|
<file>halxbox.rc</file>
|
||||||
<pch>../include/hal.h</pch>
|
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -633,13 +633,24 @@ MingwModuleHandler::GenerateMacro (
|
||||||
const IfableData& data )
|
const IfableData& data )
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
bool generateAssignment;
|
||||||
|
|
||||||
|
generateAssignment = (use_pch && module.pch != NULL ) || data.includes.size () > 0 || data.defines.size () > 0 || data.compilerFlags.size () > 0;
|
||||||
|
if ( generateAssignment )
|
||||||
|
{
|
||||||
|
fprintf ( fMakefile,
|
||||||
|
"%s %s",
|
||||||
|
macro.c_str(),
|
||||||
|
assignmentOperation );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( use_pch && module.pch != NULL )
|
||||||
|
{
|
||||||
|
fprintf ( fMakefile,
|
||||||
|
" -I %s",
|
||||||
|
GetDirectory ( GetPrecompiledHeaderFilename () ).c_str () );
|
||||||
|
}
|
||||||
|
|
||||||
fprintf (
|
|
||||||
fMakefile,
|
|
||||||
"%s %s",
|
|
||||||
macro.c_str(),
|
|
||||||
assignmentOperation );
|
|
||||||
|
|
||||||
string compilerParameters = GenerateCompilerParametersFromVector ( data.compilerFlags );
|
string compilerParameters = GenerateCompilerParametersFromVector ( data.compilerFlags );
|
||||||
if ( compilerParameters.size () > 0 )
|
if ( compilerParameters.size () > 0 )
|
||||||
{
|
{
|
||||||
|
@ -669,7 +680,10 @@ MingwModuleHandler::GenerateMacro (
|
||||||
"=%s",
|
"=%s",
|
||||||
d.value.c_str() );
|
d.value.c_str() );
|
||||||
}
|
}
|
||||||
fprintf ( fMakefile, "\n" );
|
if ( generateAssignment )
|
||||||
|
{
|
||||||
|
fprintf ( fMakefile, "\n" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -680,15 +694,12 @@ MingwModuleHandler::GenerateMacros (
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if ( data.includes.size () > 0 || data.defines.size () > 0 || data.compilerFlags.size () > 0 )
|
GenerateMacro ( assignmentOperation,
|
||||||
{
|
cflagsMacro,
|
||||||
GenerateMacro ( assignmentOperation,
|
data );
|
||||||
cflagsMacro,
|
GenerateMacro ( assignmentOperation,
|
||||||
data );
|
windresflagsMacro,
|
||||||
GenerateMacro ( assignmentOperation,
|
data );
|
||||||
windresflagsMacro,
|
|
||||||
data );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( linkerFlags != NULL )
|
if ( linkerFlags != NULL )
|
||||||
{
|
{
|
||||||
|
@ -844,6 +855,14 @@ MingwModuleHandler::GenerateObjectMacros (
|
||||||
CleanupFileVector ( sourceFiles );
|
CleanupFileVector ( sourceFiles );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
MingwModuleHandler::GetPrecompiledHeaderFilename () const
|
||||||
|
{
|
||||||
|
const string& basePchFilename = module.pch->file.name + ".gch";
|
||||||
|
return PassThruCacheDirectory ( NormalizeFilename ( basePchFilename ),
|
||||||
|
backend->intermediateDirectory );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MingwModuleHandler::GenerateGccCommand (
|
MingwModuleHandler::GenerateGccCommand (
|
||||||
const string& sourceFilename,
|
const string& sourceFilename,
|
||||||
|
@ -852,7 +871,7 @@ MingwModuleHandler::GenerateGccCommand (
|
||||||
{
|
{
|
||||||
string dependencies = sourceFilename;
|
string dependencies = sourceFilename;
|
||||||
if ( module.pch && use_pch )
|
if ( module.pch && use_pch )
|
||||||
dependencies += " " + module.pch->file.name + ".gch";
|
dependencies += " " + GetPrecompiledHeaderFilename ();
|
||||||
|
|
||||||
/* WIDL generated headers may be used */
|
/* WIDL generated headers may be used */
|
||||||
dependencies += " " + GetLinkingDependenciesMacro ();
|
dependencies += " " + GetLinkingDependenciesMacro ();
|
||||||
|
@ -1458,27 +1477,22 @@ MingwModuleHandler::GenerateObjectFileTargets (
|
||||||
const string& windresflagsMacro,
|
const string& windresflagsMacro,
|
||||||
const string& widlflagsMacro )
|
const string& widlflagsMacro )
|
||||||
{
|
{
|
||||||
if ( module.pch )
|
if ( module.pch && use_pch )
|
||||||
{
|
{
|
||||||
const string& pch_file = module.pch->file.name;
|
const string& baseHeaderFilename = module.pch->file.name;
|
||||||
string gch_file = pch_file + ".gch";
|
const string& pchFilename = GetPrecompiledHeaderFilename ();
|
||||||
CLEAN_FILE(gch_file);
|
CLEAN_FILE(pchFilename);
|
||||||
if ( use_pch )
|
fprintf ( fMakefile,
|
||||||
{
|
"%s: %s\n",
|
||||||
fprintf (
|
pchFilename.c_str(),
|
||||||
fMakefile,
|
baseHeaderFilename.c_str() );
|
||||||
"%s: %s\n",
|
fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );
|
||||||
gch_file.c_str(),
|
fprintf ( fMakefile,
|
||||||
pch_file.c_str() );
|
"\t%s -o %s %s -g %s\n\n",
|
||||||
fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );
|
module.cplusplus ? cppc.c_str() : cc.c_str(),
|
||||||
fprintf (
|
pchFilename.c_str(),
|
||||||
fMakefile,
|
cflagsMacro.c_str(),
|
||||||
"\t%s -o %s %s -g %s\n\n",
|
baseHeaderFilename.c_str() );
|
||||||
( module.cplusplus ? cppc.c_str() : cc.c_str() ),
|
|
||||||
gch_file.c_str(),
|
|
||||||
cflagsMacro.c_str(),
|
|
||||||
pch_file.c_str() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GenerateObjectFileTargets ( module.non_if_data,
|
GenerateObjectFileTargets ( module.non_if_data,
|
||||||
|
|
|
@ -124,6 +124,7 @@ private:
|
||||||
std::string GenerateGccIncludeParameters () const;
|
std::string GenerateGccIncludeParameters () const;
|
||||||
std::string GenerateGccParameters () const;
|
std::string GenerateGccParameters () const;
|
||||||
std::string GenerateNasmParameters () const;
|
std::string GenerateNasmParameters () const;
|
||||||
|
std::string MingwModuleHandler::GetPrecompiledHeaderFilename () const;
|
||||||
void GenerateGccCommand ( const std::string& sourceFilename,
|
void GenerateGccCommand ( const std::string& sourceFilename,
|
||||||
const std::string& cc,
|
const std::string& cc,
|
||||||
const std::string& cflagsMacro );
|
const std::string& cflagsMacro );
|
||||||
|
|
Loading…
Reference in a new issue