mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 17:06:29 +00:00
Add an option to disable precompiled headers
svn path=/trunk/; revision=34186
This commit is contained in:
parent
b6e4377917
commit
d595a43107
|
@ -118,6 +118,7 @@
|
|||
# -c Clean as you go. Delete generated files as soon as they are not needed anymore.
|
||||
# -dd Disable automatic dependencies.
|
||||
# -dm{module} Check only automatic dependencies for this module.
|
||||
# -hd Disable precompiled headers.
|
||||
# -mi Let make handle creation of install directories. Rbuild will not generate the directories.
|
||||
# -ps Generate proxy makefiles in source tree instead of the output tree.
|
||||
# -ud Disable compilation units.
|
||||
|
|
|
@ -1074,30 +1074,38 @@ MingwBackend::DetectPCHSupport ()
|
|||
{
|
||||
printf ( "Detecting compiler pre-compiled header support..." );
|
||||
|
||||
string path = "tools" + sSep + "rbuild" + sSep + "backend" + sSep + "mingw" + sSep + "pch_detection.h";
|
||||
string cmd = ssprintf (
|
||||
"%s -c %s 1>%s 2>%s",
|
||||
FixSeparatorForSystemCommand(compilerCommand).c_str (),
|
||||
path.c_str (),
|
||||
NUL,
|
||||
NUL );
|
||||
system ( cmd.c_str () );
|
||||
path += ".gch";
|
||||
|
||||
FILE* f = fopen ( path.c_str (), "rb" );
|
||||
if ( f )
|
||||
if ( configuration.PrecompiledHeadersEnabled )
|
||||
{
|
||||
use_pch = true;
|
||||
fclose ( f );
|
||||
unlink ( path.c_str () );
|
||||
string path = "tools" + sSep + "rbuild" + sSep + "backend" + sSep + "mingw" + sSep + "pch_detection.h";
|
||||
string cmd = ssprintf (
|
||||
"%s -c %s 1>%s 2>%s",
|
||||
FixSeparatorForSystemCommand(compilerCommand).c_str (),
|
||||
path.c_str (),
|
||||
NUL,
|
||||
NUL );
|
||||
system ( cmd.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;
|
||||
|
||||
if ( use_pch )
|
||||
printf ( "detected\n" );
|
||||
else
|
||||
printf ( "not detected\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
use_pch = false;
|
||||
|
||||
if ( use_pch )
|
||||
printf ( "detected\n" );
|
||||
else
|
||||
printf ( "not detected\n" );
|
||||
printf ( "disabled\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -27,6 +27,7 @@ Configuration::Configuration ()
|
|||
AutomaticDependencies = true;
|
||||
CheckDependenciesForModuleOnly = false;
|
||||
CompilationUnitsEnabled = true;
|
||||
PrecompiledHeadersEnabled = true;
|
||||
MakeHandlesInstallDirectories = false;
|
||||
GenerateProxyMakefilesInSourceTree = false;
|
||||
InstallFiles = false;
|
||||
|
|
|
@ -82,6 +82,24 @@ ParseCompilationUnitSwitch (
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ParsePrecompiledHeaderSwitch (
|
||||
char switchChar2,
|
||||
char* switchStart )
|
||||
{
|
||||
switch ( switchChar2 )
|
||||
{
|
||||
case 'd':
|
||||
configuration.PrecompiledHeadersEnabled = false;
|
||||
break;
|
||||
default:
|
||||
printf ( "Unknown switch -h%c\n",
|
||||
switchChar2 );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ParseVCProjectSwitch (
|
||||
char switchChar2,
|
||||
|
@ -214,6 +232,11 @@ ParseSwitch ( int argc, char** argv, int index )
|
|||
return ParseAutomaticDependencySwitch (
|
||||
switchChar2,
|
||||
argv[index] );
|
||||
case 'h':
|
||||
return ParsePrecompiledHeaderSwitch (
|
||||
switchChar2,
|
||||
argv[index] );
|
||||
|
||||
case 'u':
|
||||
return ParseCompilationUnitSwitch (
|
||||
switchChar2,
|
||||
|
|
|
@ -160,6 +160,7 @@ public:
|
|||
bool AutomaticDependencies;
|
||||
bool CheckDependenciesForModuleOnly;
|
||||
bool CompilationUnitsEnabled;
|
||||
bool PrecompiledHeadersEnabled;
|
||||
std::string CheckDependenciesForModuleOnlyModule;
|
||||
std::string VSProjectVersion;
|
||||
std::string VSConfigurationType;
|
||||
|
|
Loading…
Reference in a new issue