summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
af9bc63)
svn path=/branches/xmlbuildsystem/; revision=13917
const string& windresflagsMacro,\r
string_list& clean_files ) const\r
{\r
const string& windresflagsMacro,\r
string_list& clean_files ) const\r
{\r
- if ( module.pch && use_pch )\r
{\r
const string& pch_file = module.pch->header;\r
string gch_file = pch_file + ".gch";\r
CLEAN_FILE(gch_file);\r
{\r
const string& pch_file = module.pch->header;\r
string gch_file = pch_file + ".gch";\r
CLEAN_FILE(gch_file);\r
- fprintf (\r
- fMakefile,\r
- "%s: %s\n",\r
- gch_file.c_str(),\r
- pch_file.c_str() );\r
- fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );\r
- fprintf (\r
- fMakefile,\r
- "\t%s -c %s -o %s %s\n\n",\r
- cc.c_str(),\r
- pch_file.c_str(),\r
- gch_file.c_str(),\r
- cflagsMacro.c_str() );\r
+ if ( use_pch )\r
+ {\r
+ fprintf (\r
+ fMakefile,\r
+ "%s: %s\n",\r
+ gch_file.c_str(),\r
+ pch_file.c_str() );\r
+ fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );\r
+ fprintf (\r
+ fMakefile,\r
+ "\t%s -o %s %s -g %s\n\n",\r
+ ( module.cplusplus ? cppc.c_str() : cc.c_str() ),\r
+ gch_file.c_str(),\r
+ cflagsMacro.c_str(),\r
+ pch_file.c_str() );\r
+ }\r
}\r
\r
GenerateObjectFileTargets ( module,\r
}\r
\r
GenerateObjectFileTargets ( module,\r
return dependencies;\r
}\r
\r
return dependencies;\r
}\r
\r
-// TODO FIXME - check for C++ extensions when parsing XML, and set a\r
-// bool in the Module class\r
bool\r
MingwModuleHandler::IsCPlusPlusModule ( const Module& module ) const\r
{\r
bool\r
MingwModuleHandler::IsCPlusPlusModule ( const Module& module ) const\r
{\r
- if ( module.HasFileWithExtension ( module.non_if_data, ".cc" ) )\r
- return true;\r
- if ( module.HasFileWithExtension ( module.non_if_data, ".cxx" ) )\r
- return true;\r
- if ( module.HasFileWithExtension ( module.non_if_data, ".cpp" ) )\r
- return true;\r
- return false;\r
+ return module.cplusplus;\r
node (moduleNode),\r
importLibrary (NULL),\r
bootstrap (NULL),\r
node (moduleNode),\r
importLibrary (NULL),\r
bootstrap (NULL),\r
+ pch (NULL),\r
+ cplusplus (false)\r
{\r
if ( node.name != "module" )\r
throw Exception ( "internal tool error: Module created with non-<module> node" );\r
{\r
if ( node.name != "module" )\r
throw Exception ( "internal tool error: Module created with non-<module> node" );\r
e.location,\r
"attribute 'first' of <file> element can only be 'true' or 'false'" );\r
}\r
e.location,\r
"attribute 'first' of <file> element can only be 'true' or 'false'" );\r
}\r
+ if ( !cplusplus )\r
+ {\r
+ // check for c++ file\r
+ string ext = GetExtension ( e.value );\r
+ if ( !stricmp ( ext.c_str(), ".cpp" ) )\r
+ cplusplus = true;\r
+ else if ( !stricmp ( ext.c_str(), ".cc" ) )\r
+ cplusplus = true;\r
+ else if ( !stricmp ( ext.c_str(), ".cxx" ) )\r
+ cplusplus = true;\r
+ }\r
File* pFile = new File ( FixSeparator ( path + CSEP + e.value ), first );\r
if ( pIf )\r
pIf->data.files.push_back ( pFile );\r
File* pFile = new File ( FixSeparator ( path + CSEP + e.value ), first );\r
if ( pIf )\r
pIf->data.files.push_back ( pFile );\r
std::vector<CompilerFlag*> compilerFlags;\r
std::vector<LinkerFlag*> linkerFlags;\r
PchFile* pch;\r
std::vector<CompilerFlag*> compilerFlags;\r
std::vector<LinkerFlag*> linkerFlags;\r
PchFile* pch;\r
\r
Module ( const Project& project,\r
const XMLElement& moduleNode,\r
\r
Module ( const Project& project,\r
const XMLElement& moduleNode,\r