mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
Let ImportLibrary class use the FileLocation concept.
I disabled def files in codeblocks and msvc backends, someone will have to update them svn path=/trunk/; revision=28956
This commit is contained in:
parent
f77c414397
commit
252118319f
6 changed files with 50 additions and 47 deletions
|
@ -653,10 +653,12 @@ CBBackend::_generate_cbproj ( const Module& module )
|
|||
|
||||
fprintf ( OUT, "\t\t\t\t<ExtraCommands>\r\n" );
|
||||
|
||||
#if 0
|
||||
if ( module.type == StaticLibrary && module.importLibrary )
|
||||
fprintf ( OUT, "\t\t\t\t\t<Add after=\"dlltool --dllname %s --def %s --output-lib $exe_output; %s -U\" />\r\n", module.importLibrary->dllname.c_str (), module.importLibrary->definition.c_str(), module.mangledSymbols ? "" : "--kill-at" );
|
||||
else if ( module.importLibrary != NULL )
|
||||
fprintf ( OUT, "\t\t\t\t\t<Add after=\"dlltool --dllname %s --def %s --output-lib "$(TARGET_OBJECT_DIR)lib$(TARGET_OUTPUT_BASENAME).a" %s\" />\r\n", module.GetTargetName ().c_str(), module.importLibrary->definition.c_str(), module.mangledSymbols ? "" : "--kill-at" );
|
||||
#endif
|
||||
|
||||
|
||||
for ( i = 0; i < resource_files.size(); i++ )
|
||||
|
@ -671,6 +673,7 @@ CBBackend::_generate_cbproj ( const Module& module )
|
|||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( dll )
|
||||
{
|
||||
if (IsWineModule( module ))
|
||||
|
@ -684,6 +687,7 @@ CBBackend::_generate_cbproj ( const Module& module )
|
|||
#endif
|
||||
fprintf ( OUT, "\t\t\t\t\t<Mode after=\"always\" />\r\n" );
|
||||
}
|
||||
#endif
|
||||
|
||||
fprintf ( OUT, "\t\t\t\t</ExtraCommands>\r\n" );
|
||||
|
||||
|
@ -894,6 +898,6 @@ CBBackend::IsWineModule ( const Module& module ) const
|
|||
if ( module.importLibrary == NULL)
|
||||
return false;
|
||||
|
||||
size_t index = module.importLibrary->definition.rfind ( ".spec.def" );
|
||||
size_t index = module.importLibrary->source->name.rfind ( ".spec.def" );
|
||||
return ( index != string::npos );
|
||||
}
|
||||
|
|
|
@ -2244,7 +2244,7 @@ MingwModuleHandler::IsWineModule () const
|
|||
if ( module.importLibrary == NULL)
|
||||
return false;
|
||||
|
||||
size_t index = module.importLibrary->definition.rfind ( ".spec.def" );
|
||||
size_t index = module.importLibrary->source->name.rfind ( ".spec.def" );
|
||||
return ( index != string::npos );
|
||||
}
|
||||
|
||||
|
@ -2259,19 +2259,9 @@ MingwModuleHandler::GetDefinitionFilename () const
|
|||
else
|
||||
directory = SourceDirectory;
|
||||
|
||||
size_t pos = module.importLibrary->definition.find_last_of ( "/\\" );
|
||||
if ( pos == string::npos )
|
||||
{
|
||||
return new FileLocation ( directory,
|
||||
module.GetBasePath (),
|
||||
module.importLibrary->definition );
|
||||
}
|
||||
|
||||
string dir = module.importLibrary->definition.substr ( 0, pos );
|
||||
string name = module.importLibrary->definition.substr ( pos + 1);
|
||||
return new FileLocation ( directory,
|
||||
NormalizeFilename ( module.GetBasePath () + sSep + dir ),
|
||||
name );
|
||||
return new FileLocation ( directory,
|
||||
module.importLibrary->source->relative_path,
|
||||
module.importLibrary->source->name );
|
||||
}
|
||||
else
|
||||
return new FileLocation ( SourceDirectory, "tools" + sSep + "rbuild", "empty.def" );
|
||||
|
|
|
@ -374,6 +374,7 @@ MSVCBackend::_get_def_files ( const Module& module, vector<string>& out) const
|
|||
{
|
||||
if (module.HasImportLibrary ())
|
||||
{
|
||||
#if 0
|
||||
string modulename = module.GetBasePath ();
|
||||
string file = module.importLibrary->definition;
|
||||
size_t pos = file.find (".def");
|
||||
|
@ -383,6 +384,7 @@ MSVCBackend::_get_def_files ( const Module& module, vector<string>& out) const
|
|||
}
|
||||
modulename += DEF_SSEP + file;
|
||||
out.push_back (modulename);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -436,8 +436,10 @@ MSVCBackend::_generate_vcproj ( const Module& module )
|
|||
fprintf ( OUT, "\t\t\t\tDataExecutionPrevention=\"0\"\r\n" );
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (module.importLibrary != NULL)
|
||||
fprintf ( OUT, "\t\t\t\tModuleDefinitionFile=\"%s\"\r\n", module.importLibrary->definition.c_str());
|
||||
#endif
|
||||
fprintf ( OUT, "\t\t\t\tAdditionalDependencies=\"" );
|
||||
bool use_msvcrt_lib = false;
|
||||
for ( i = 0; i < libraries.size(); i++ )
|
||||
|
|
|
@ -719,7 +719,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
|
|||
e.location,
|
||||
"Only one <importlibrary> is valid per module" );
|
||||
}
|
||||
importLibrary = new ImportLibrary ( e, *this );
|
||||
importLibrary = new ImportLibrary ( project, e, *this );
|
||||
subs_invalid = true;
|
||||
}
|
||||
else if ( e.name == "if" )
|
||||
|
@ -1577,35 +1577,43 @@ Metadata::Metadata ( const XMLElement& _node,
|
|||
}
|
||||
|
||||
|
||||
ImportLibrary::ImportLibrary ( const XMLElement& _node,
|
||||
const Module& _module )
|
||||
: node (_node),
|
||||
module (_module)
|
||||
ImportLibrary::ImportLibrary ( const Project& project,
|
||||
const XMLElement& node,
|
||||
const Module& module )
|
||||
: XmlNode ( project, node ),
|
||||
module (module)
|
||||
{
|
||||
const XMLAttribute* att = _node.GetAttribute ( "basename", false );
|
||||
if (att != NULL)
|
||||
basename = att->value;
|
||||
else
|
||||
basename = module.name;
|
||||
const XMLAttribute* dllname = node.GetAttribute ( "dllname", false );
|
||||
const XMLAttribute* definition = node.GetAttribute ( "definition", true );
|
||||
assert ( definition );
|
||||
|
||||
att = _node.GetAttribute ( "dllname", false );
|
||||
if (att != NULL)
|
||||
dllname = att->value;
|
||||
if ( dllname )
|
||||
this->dllname = dllname->value;
|
||||
else if ( module.type == StaticLibrary )
|
||||
throw XMLInvalidBuildFileException (
|
||||
node.location,
|
||||
"<importlibrary> dllname attribute required." );
|
||||
|
||||
DirectoryLocation directory = SourceDirectory;
|
||||
size_t index = definition->value.rfind ( ".spec.def" );
|
||||
if ( index != string::npos )
|
||||
directory = IntermediateDirectory;
|
||||
|
||||
index = definition->value.find_last_of ( "/\\" );
|
||||
if ( index == string::npos )
|
||||
{
|
||||
source = new FileLocation ( directory,
|
||||
module.GetBasePath (),
|
||||
definition->value );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _module.type == StaticLibrary )
|
||||
{
|
||||
throw XMLInvalidBuildFileException (
|
||||
node.location,
|
||||
"<importlibrary> dllname attribute required." );
|
||||
}
|
||||
|
||||
dllname = "";
|
||||
string dir = definition->value.substr ( 0, index );
|
||||
string name = definition->value.substr ( index + 1);
|
||||
source = new FileLocation ( directory,
|
||||
NormalizeFilename ( module.GetBasePath () + sSep + dir ),
|
||||
name );
|
||||
}
|
||||
|
||||
att = _node.GetAttribute ( "definition", true );
|
||||
assert (att);
|
||||
definition = FixSeparator(att->value);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -542,19 +542,16 @@ public:
|
|||
void ProcessXML();
|
||||
};
|
||||
|
||||
class ImportLibrary
|
||||
class ImportLibrary : public XmlNode
|
||||
{
|
||||
public:
|
||||
const XMLElement& node;
|
||||
const Module& module;
|
||||
std::string basename;
|
||||
std::string definition;
|
||||
std::string dllname;
|
||||
FileLocation *source;
|
||||
|
||||
ImportLibrary ( const XMLElement& _node,
|
||||
ImportLibrary ( const Project& project,
|
||||
const XMLElement& node,
|
||||
const Module& module );
|
||||
|
||||
void ProcessXML ();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue