detect PCH support ( not doing anything more than detection yet )

svn path=/branches/xmlbuildsystem/; revision=13878
This commit is contained in:
Royce Mitchell III
2005-03-08 17:14:07 +00:00
parent 79f349c48f
commit 0be0bb57b2
3 changed files with 27 additions and 0 deletions
@@ -26,6 +26,8 @@ MingwBackend::MingwBackend ( Project& project )
void
MingwBackend::Process ()
{
DetectPCHSupport();
CreateMakefile ();
GenerateHeader ();
GenerateGlobalVariables ();
@@ -323,3 +325,24 @@ FixupTargetFilename ( const string& targetFilename )
{
return string("$(ROS_INTERMEDIATE)") + NormalizeFilename ( targetFilename );
}
void
MingwBackend::DetectPCHSupport()
{
string path = "tools" SSEP "rbuild" SSEP "backend" SSEP "mingw" SSEP "pch_detection.h";
system ( ssprintf("gcc -c %s", path.c_str()).c_str() );
path += ".gch";
{
FILE* f = fopen ( path.c_str(), "rb" );
if ( f )
{
use_pch = true;
fclose(f);
unlink ( path.c_str() );
}
else
use_pch = false;
}
// TODO FIXME - eventually check for ROS_USE_PCH env var and
// allow that to override use_pch if true
}
@@ -32,7 +32,10 @@ private:
void GenerateInitTarget () const;
void GenerateXmlBuildFilesMacro() const;
void CheckAutomaticDependencies ();
void DetectPCHSupport();
FILE* fMakefile;
bool use_pch;
};
std::string FixupTargetFilename ( const std::string& targetFilename );
@@ -0,0 +1 @@
// this file is intentionally left empty