From 065115bbe30ddea89d542a4fb816aac4ae3fb788 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Thu, 20 Dec 2007 14:00:35 +0000 Subject: [PATCH] Use ADDITIONAL_GUI_LIBS, not ADDITIONAL_LDFLAGS, to specify libraries to link git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@25767 72102866-910b-0410-8b05-ffd578937521 --- Documentation/ChangeLog | 9 +++++++++ Framework/PCMakefileFactory.m | 37 +++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index c894507..4242786 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,3 +1,12 @@ +2007-12-20 Nicola Pero + + * PCMakefileFactory.m ([-createPreambleForProject:]): Output the + -l flags in the ADDITIONAL_GUI_LIBS variable, not the + ADDITIONAL_LDFLAGS one. This should fix linking applications on + Windows, but will not work well for linking non-GUI libraries. + ProjectCenter needs to be extended to allow specifying + ADDITIONAL_TOOL_LIBS and ADDITIONAL_OBJC_LIBS on the gui. + 2007-12-13 Nicola Pero * GNUmakefile.preamble (ADDITIONAL_LIB_DIRS): Improved linking to diff --git a/Framework/PCMakefileFactory.m b/Framework/PCMakefileFactory.m index 91c11f5..d6139d0 100644 --- a/Framework/PCMakefileFactory.m +++ b/Framework/PCMakefileFactory.m @@ -139,21 +139,6 @@ static PCMakefileFactory *_factory = nil; [mfp appendString: [NSString stringWithFormat:@"ADDITIONAL_LDFLAGS += %@ ", [projectDict objectForKey:PCLinkerOptions]]]; - array = [projectDict objectForKey:PCLibraries]; - if (array && [array count]) - { - NSString *tmp; - NSEnumerator *enumerator = [array objectEnumerator]; - - while ((tmp = [enumerator nextObject])) - { - if (![tmp isEqualToString:@"gnustep-base"] && - ![tmp isEqualToString:@"gnustep-gui"]) - { - [mfp appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; - } - } - } [mfp appendString:@"\n\n"]; // Directories where to search headers @@ -192,6 +177,28 @@ static PCMakefileFactory *_factory = nil; // [mfp appendString:[projectDict objectForKey:PCLibraries]]; + // Additional GUI libraries + // TODO: Let the user select objc, base, gui libraries/frameworks + // on the gui - the following works well for GUI stuff only. + [mfp appendString:@"# Additional GUI libraries to link\n"]; + [mfp appendString: @"ADDITIONAL_GUI_LIBS += "]; + array = [projectDict objectForKey:PCLibraries]; + if (array && [array count]) + { + NSString *tmp; + NSEnumerator *enumerator = [array objectEnumerator]; + + while ((tmp = [enumerator nextObject])) + { + if (![tmp isEqualToString:@"gnustep-base"] && + ![tmp isEqualToString:@"gnustep-gui"]) + { + [mfp appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + } + } + } + [mfp appendString:@"\n\n"]; + // Write the new file to disc! mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile.preamble"]; if ([mfp writeToFile:mfl atomically:YES])