mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +00:00
Only pass GCC specific options to GCC
svn path=/branches/xmlbuildsystem/; revision=15279
This commit is contained in:
parent
91c4967ba6
commit
1732348d39
4 changed files with 83 additions and 41 deletions
|
@ -383,46 +383,27 @@ MingwBackend::GenerateHeader () const
|
||||||
fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );
|
fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
MingwBackend::GenerateIncludesAndDefines ( IfableData& data ) const
|
||||||
|
{
|
||||||
|
string includeParameters = MingwModuleHandler::GenerateGccIncludeParametersFromVector ( data.includes );
|
||||||
|
string defineParameters = MingwModuleHandler::GenerateGccDefineParametersFromVector ( data.defines );
|
||||||
|
return includeParameters + " " + defineParameters;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,
|
MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,
|
||||||
IfableData& data ) const
|
IfableData& data ) const
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
fprintf (
|
fprintf (
|
||||||
fMakefile,
|
fMakefile,
|
||||||
"PROJECT_CFLAGS %s",
|
"PROJECT_CFLAGS %s",
|
||||||
assignmentOperation );
|
assignmentOperation );
|
||||||
|
|
||||||
for ( i = 0; i < data.compilerFlags.size(); i++ )
|
fprintf ( fMakefile,
|
||||||
{
|
|
||||||
fprintf (
|
|
||||||
fMakefile,
|
|
||||||
" %s",
|
" %s",
|
||||||
data.compilerFlags[i]->flag.c_str() );
|
GenerateIncludesAndDefines ( data ).c_str() );
|
||||||
}
|
|
||||||
|
|
||||||
for ( i = 0; i < data.includes.size(); i++ )
|
|
||||||
{
|
|
||||||
fprintf (
|
|
||||||
fMakefile,
|
|
||||||
" -I%s",
|
|
||||||
data.includes[i]->directory.c_str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( i = 0; i < data.defines.size(); i++ )
|
|
||||||
{
|
|
||||||
Define& d = *data.defines[i];
|
|
||||||
fprintf (
|
|
||||||
fMakefile,
|
|
||||||
" -D%s",
|
|
||||||
d.name.c_str() );
|
|
||||||
if ( d.value.size() )
|
|
||||||
fprintf (
|
|
||||||
fMakefile,
|
|
||||||
"=%s",
|
|
||||||
d.value.c_str() );
|
|
||||||
}
|
|
||||||
fprintf ( fMakefile, "\n" );
|
fprintf ( fMakefile, "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +422,7 @@ MingwBackend::GenerateGlobalCFlagsAndProperties (
|
||||||
prop.value.c_str() );
|
prop.value.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( data.includes.size() || data.defines.size() || data.compilerFlags.size() )
|
if ( data.includes.size() || data.defines.size() )
|
||||||
{
|
{
|
||||||
GenerateProjectCFlagsMacro ( assignmentOperation,
|
GenerateProjectCFlagsMacro ( assignmentOperation,
|
||||||
data );
|
data );
|
||||||
|
@ -452,7 +433,6 @@ MingwBackend::GenerateGlobalCFlagsAndProperties (
|
||||||
If& rIf = *data.ifs[i];
|
If& rIf = *data.ifs[i];
|
||||||
if ( rIf.data.defines.size()
|
if ( rIf.data.defines.size()
|
||||||
|| rIf.data.includes.size()
|
|| rIf.data.includes.size()
|
||||||
|| rIf.data.compilerFlags.size()
|
|
||||||
|| rIf.data.ifs.size() )
|
|| rIf.data.ifs.size() )
|
||||||
{
|
{
|
||||||
fprintf (
|
fprintf (
|
||||||
|
@ -470,6 +450,62 @@ MingwBackend::GenerateGlobalCFlagsAndProperties (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MingwBackend::GenerateProjectGccOptionsMacro ( const char* assignmentOperation,
|
||||||
|
IfableData& data ) const
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
fprintf (
|
||||||
|
fMakefile,
|
||||||
|
"PROJECT_GCCOPTIONS %s",
|
||||||
|
assignmentOperation );
|
||||||
|
|
||||||
|
for ( i = 0; i < data.compilerFlags.size(); i++ )
|
||||||
|
{
|
||||||
|
fprintf (
|
||||||
|
fMakefile,
|
||||||
|
" %s",
|
||||||
|
data.compilerFlags[i]->flag.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf ( fMakefile, "\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MingwBackend::GenerateProjectGccOptions (
|
||||||
|
const char* assignmentOperation,
|
||||||
|
IfableData& data ) const
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if ( data.compilerFlags.size() )
|
||||||
|
{
|
||||||
|
GenerateProjectGccOptionsMacro ( assignmentOperation,
|
||||||
|
data );
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( i = 0; i < data.ifs.size(); i++ )
|
||||||
|
{
|
||||||
|
If& rIf = *data.ifs[i];
|
||||||
|
if ( rIf.data.compilerFlags.size()
|
||||||
|
|| rIf.data.ifs.size() )
|
||||||
|
{
|
||||||
|
fprintf (
|
||||||
|
fMakefile,
|
||||||
|
"ifeq (\"$(%s)\",\"%s\")\n",
|
||||||
|
rIf.property.c_str(),
|
||||||
|
rIf.value.c_str() );
|
||||||
|
GenerateProjectGccOptions (
|
||||||
|
"+=",
|
||||||
|
rIf.data );
|
||||||
|
fprintf (
|
||||||
|
fMakefile,
|
||||||
|
"endif\n\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
MingwBackend::GenerateProjectLFLAGS () const
|
MingwBackend::GenerateProjectLFLAGS () const
|
||||||
{
|
{
|
||||||
|
@ -487,14 +523,14 @@ MingwBackend::GenerateProjectLFLAGS () const
|
||||||
void
|
void
|
||||||
MingwBackend::GenerateGlobalVariables () const
|
MingwBackend::GenerateGlobalVariables () const
|
||||||
{
|
{
|
||||||
GenerateGlobalCFlagsAndProperties (
|
GenerateGlobalCFlagsAndProperties ( "=", ProjectNode.non_if_data );
|
||||||
"=",
|
GenerateProjectGccOptions ( "=", ProjectNode.non_if_data );
|
||||||
ProjectNode.non_if_data );
|
|
||||||
|
|
||||||
fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)\n" );
|
fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)\n" );
|
||||||
fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)\n" );
|
fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)\n" );
|
||||||
fprintf ( fMakefile, "PROJECT_LFLAGS := %s\n",
|
fprintf ( fMakefile, "PROJECT_LFLAGS := %s\n",
|
||||||
GenerateProjectLFLAGS ().c_str () );
|
GenerateProjectLFLAGS ().c_str () );
|
||||||
|
fprintf ( fMakefile, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" );
|
||||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
|
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
|
||||||
fprintf ( fMakefile, "\n" );
|
fprintf ( fMakefile, "\n" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,10 +73,15 @@ private:
|
||||||
void CreateMakefile ();
|
void CreateMakefile ();
|
||||||
void CloseMakefile () const;
|
void CloseMakefile () const;
|
||||||
void GenerateHeader () const;
|
void GenerateHeader () const;
|
||||||
|
std::string GenerateIncludesAndDefines ( IfableData& data ) const;
|
||||||
void GenerateProjectCFlagsMacro ( const char* assignmentOperation,
|
void GenerateProjectCFlagsMacro ( const char* assignmentOperation,
|
||||||
IfableData& data ) const;
|
IfableData& data ) const;
|
||||||
void GenerateGlobalCFlagsAndProperties ( const char* op,
|
void GenerateGlobalCFlagsAndProperties ( const char* op,
|
||||||
IfableData& data ) const;
|
IfableData& data ) const;
|
||||||
|
void GenerateProjectGccOptionsMacro ( const char* assignmentOperation,
|
||||||
|
IfableData& data ) const;
|
||||||
|
void GenerateProjectGccOptions ( const char* assignmentOperation,
|
||||||
|
IfableData& data ) const;
|
||||||
std::string GenerateProjectLFLAGS () const;
|
std::string GenerateProjectLFLAGS () const;
|
||||||
void GenerateDirectories ();
|
void GenerateDirectories ();
|
||||||
void GenerateGlobalVariables () const;
|
void GenerateGlobalVariables () const;
|
||||||
|
|
|
@ -488,9 +488,9 @@ MingwModuleHandler::GetObjectFilenames ()
|
||||||
return objectFilenames;
|
return objectFilenames;
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
/* static */ string
|
||||||
MingwModuleHandler::GenerateGccDefineParametersFromVector (
|
MingwModuleHandler::GenerateGccDefineParametersFromVector (
|
||||||
const vector<Define*>& defines ) const
|
const vector<Define*>& defines )
|
||||||
{
|
{
|
||||||
string parameters;
|
string parameters;
|
||||||
for ( size_t i = 0; i < defines.size (); i++ )
|
for ( size_t i = 0; i < defines.size (); i++ )
|
||||||
|
@ -535,8 +535,8 @@ MingwModuleHandler::ConcatenatePaths (
|
||||||
return path1 + CSEP + path2;
|
return path1 + CSEP + path2;
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
/* static */ string
|
||||||
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes ) const
|
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes )
|
||||||
{
|
{
|
||||||
string parameters;
|
string parameters;
|
||||||
for ( size_t i = 0; i < includes.size (); i++ )
|
for ( size_t i = 0; i < includes.size (); i++ )
|
||||||
|
|
|
@ -40,6 +40,9 @@ public:
|
||||||
const Module& module,
|
const Module& module,
|
||||||
string_list* pclean_files );
|
string_list* pclean_files );
|
||||||
|
|
||||||
|
static std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines );
|
||||||
|
static std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes );
|
||||||
|
|
||||||
std::string GetModuleTargets ( const Module& module );
|
std::string GetModuleTargets ( const Module& module );
|
||||||
void GetObjectsVector ( const IfableData& data,
|
void GetObjectsVector ( const IfableData& data,
|
||||||
std::vector<std::string>& objectFiles ) const;
|
std::vector<std::string>& objectFiles ) const;
|
||||||
|
@ -100,9 +103,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
std::string ConcatenatePaths ( const std::string& path1,
|
std::string ConcatenatePaths ( const std::string& path1,
|
||||||
const std::string& path2 ) const;
|
const std::string& path2 ) const;
|
||||||
std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;
|
|
||||||
std::string GenerateGccDefineParameters () const;
|
std::string GenerateGccDefineParameters () const;
|
||||||
std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;
|
|
||||||
std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;
|
std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;
|
||||||
std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;
|
std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;
|
||||||
std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );
|
std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );
|
||||||
|
|
Loading…
Reference in a new issue