mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
add mingw, mingw-common and msvcrt libs where needed
svn path=/trunk/; revision=24821
This commit is contained in:
parent
5b88a78c5b
commit
95433bb0e5
|
@ -96,6 +96,7 @@ void CBBackend::ProcessModules()
|
||||||
for(size_t i = 0; i < ProjectNode.modules.size(); i++)
|
for(size_t i = 0; i < ProjectNode.modules.size(); i++)
|
||||||
{
|
{
|
||||||
Module &module = *ProjectNode.modules[i];
|
Module &module = *ProjectNode.modules[i];
|
||||||
|
MingwAddImplicitLibraries( module );
|
||||||
_generate_cbproj ( module );
|
_generate_cbproj ( module );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -431,6 +432,22 @@ CBBackend::_generate_cbproj ( const Module& module )
|
||||||
if ( !module.allowWarnings )
|
if ( !module.allowWarnings )
|
||||||
compiler_flags.push_back ( "-Werror" );
|
compiler_flags.push_back ( "-Werror" );
|
||||||
|
|
||||||
|
///* implicit libraries */
|
||||||
|
//libraries.push_back ( "mingw_common" );
|
||||||
|
//libpaths.push_back ( module.project.LocateModule("mingw_common") );
|
||||||
|
|
||||||
|
//if ( !Module.IsDll )
|
||||||
|
//{
|
||||||
|
// libraries.push_back ( "%s", module.isUnicode ? "mingw_wmain" : "mingw_main" );
|
||||||
|
// libpaths.push_back ( module.project.LocateModule("%s"), module.isUnicode ? "mingw_wmain" : "mingw_main" );
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if ( module.name != "msvcrt" )
|
||||||
|
//{
|
||||||
|
// libraries.push_back ( "msvcrt" );
|
||||||
|
// libpaths.push_back ( module.project.LocateModule("msvcrt") );
|
||||||
|
//}
|
||||||
|
|
||||||
FILE* OUT = fopen ( cbproj_file.c_str(), "wb" );
|
FILE* OUT = fopen ( cbproj_file.c_str(), "wb" );
|
||||||
|
|
||||||
fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" );
|
fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" );
|
||||||
|
@ -570,7 +587,6 @@ CBBackend::_generate_cbproj ( const Module& module )
|
||||||
if ( dll )
|
if ( dll )
|
||||||
fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s.temp.exp\" />\r\n", module.name.c_str() );
|
fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s.temp.exp\" />\r\n", module.name.c_str() );
|
||||||
|
|
||||||
|
|
||||||
/* libraries */
|
/* libraries */
|
||||||
for ( i = 0; i < libraries.size(); i++ )
|
for ( i = 0; i < libraries.size(); i++ )
|
||||||
{
|
{
|
||||||
|
@ -587,7 +603,7 @@ CBBackend::_generate_cbproj ( const Module& module )
|
||||||
if ( dll )
|
if ( dll )
|
||||||
{
|
{
|
||||||
fprintf ( OUT, "\t\t\t\t<ExtraCommands>\r\n" );
|
fprintf ( OUT, "\t\t\t\t<ExtraCommands>\r\n" );
|
||||||
fprintf ( OUT, "<Add before=\"dlltool --dllname %s.%s --def %s.def --output-exp %s.temp.exp --kill-at\" />\r\n", module.name.c_str(), module_type.c_str(), module.name.c_str(), module.name.c_str() );
|
fprintf ( OUT, "<Add before=\"dlltool --dllname %s%s --def %s.def --output-exp %s.temp.exp --kill-at\" />\r\n", module.name.c_str(), module_type.c_str(), module.name.c_str(), module.name.c_str() );
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
fprintf ( OUT, "\t\t\t\t\t<Add after=\"cmd /c del %s.temp.exp 2>NUL\" />\r\n", module.name.c_str() );
|
fprintf ( OUT, "\t\t\t\t\t<Add after=\"cmd /c del %s.temp.exp 2>NUL\" />\r\n", module.name.c_str() );
|
||||||
#else
|
#else
|
||||||
|
@ -715,3 +731,33 @@ CBBackend::GenerateProjectLinkerFlags() const
|
||||||
}
|
}
|
||||||
return lflags;
|
return lflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CBBackend::MingwAddImplicitLibraries( Module &module )
|
||||||
|
{
|
||||||
|
Library* pLibrary;
|
||||||
|
|
||||||
|
if ( !module.isDefaultEntryPoint )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( module.IsDLL () )
|
||||||
|
{
|
||||||
|
//pLibrary = new Library ( module, "__mingw_dllmain" );
|
||||||
|
//module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pLibrary = new Library ( module, module.isUnicode ? "mingw_wmain" : "mingw_main" );
|
||||||
|
module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary );
|
||||||
|
}
|
||||||
|
|
||||||
|
pLibrary = new Library ( module, "mingw_common" );
|
||||||
|
module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin() + 1, pLibrary );
|
||||||
|
|
||||||
|
if ( module.name != "msvcrt" )
|
||||||
|
{
|
||||||
|
// always link in msvcrt to get the basic routines
|
||||||
|
pLibrary = new Library ( module, "msvcrt" );
|
||||||
|
module.non_if_data.libraries.push_back ( pLibrary );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ class CBBackend : public Backend
|
||||||
std::string LayoutFileName ( const Module& module ) const;
|
std::string LayoutFileName ( const Module& module ) const;
|
||||||
std::string DependFileName ( const Module& module ) const;
|
std::string DependFileName ( const Module& module ) const;
|
||||||
std::string GenerateProjectLinkerFlags () const;
|
std::string GenerateProjectLinkerFlags () const;
|
||||||
|
void MingwAddImplicitLibraries( Module &module );
|
||||||
std::vector<CBConfiguration*> m_configurations;
|
std::vector<CBConfiguration*> m_configurations;
|
||||||
|
|
||||||
std::vector<FileUnit> m_fileUnits;
|
std::vector<FileUnit> m_fileUnits;
|
||||||
|
@ -97,5 +98,6 @@ class CBBackend : public Backend
|
||||||
const Property* _lookup_property ( const Module& module, const std::string& name ) const;
|
const Property* _lookup_property ( const Module& module, const std::string& name ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // __MSVC_H__
|
#endif // __MSVC_H__
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue