makefiles: Allow modules to link to their own import library.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-11-19 11:40:26 +01:00
parent 27b20c1db5
commit be8a81b54c
1 changed files with 5 additions and 5 deletions

View File

@ -2218,9 +2218,6 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
const char *name = get_base_name( imports.str[i] );
const char *lib = NULL;
/* skip module's own importlib, its object files will be linked directly */
if (make->importlib && !strcmp( make->importlib, imports.str[i] )) continue;
for (j = 0; j < subdirs.count; j++)
{
if (submakes[j]->importlib && !strcmp( submakes[j]->importlib, name ))
@ -3117,7 +3114,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
{
if ((source->file->flags & FLAG_C_UNIX) && *dll_ext)
strarray_add( &make->unixobj_files, strmake( "%s.o", obj ));
else if (!is_dll_src && (!(source->file->flags & FLAG_C_IMPLIB) || (make->importlib && strarray_exists( &make->imports, make->importlib ))))
else if (!is_dll_src && !(source->file->flags & FLAG_C_IMPLIB))
strarray_add( &make->object_files, strmake( "%s.o", obj ));
else
strarray_add( &make->clean_files, strmake( "%s.o", obj ));
@ -3136,7 +3133,10 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
}
if (need_cross)
{
strarray_add( is_dll_src ? &make->clean_files : &make->crossobj_files, strmake( "%s.cross.o", obj ));
if (!is_dll_src && !(source->file->flags & FLAG_C_IMPLIB))
strarray_add( &make->crossobj_files, strmake( "%s.cross.o", obj ));
else
strarray_add( &make->clean_files, strmake( "%s.cross.o", obj ));
output( "%s.cross.o: %s\n", obj_dir_path( make, obj ), source->filename );
output( "\t$(CROSSCC) -c -o $@ %s", source->filename );
output_filenames( defines );