NSBundle tests: fix framework linkage with older linkers

This commit is contained in:
Niels Grewe 2020-03-08 13:24:03 +01:00
parent 120e8f5294
commit 62cd15a74c
No known key found for this signature in database
GPG key ID: 003E2A780EE52172
2 changed files with 7 additions and 1 deletions

View file

@ -1,7 +1,7 @@
ADDITIONAL_INCLUDE_DIRS += -I../GenericTests/ -I../../..
ADDITIONAL_OBJCFLAGS += -Wall
resources2_LDFLAGS += -Wl,-rpath -Wl,$(CURDIR)/Resources/TestFramework.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR)
resources2_LIB_DIRS += -L./Resources/TestFramework.framework/$(GNUSTEP_TARGET_LDIR)
resources2_TOOL_LIBS += -lTestFramework

View file

@ -10,6 +10,8 @@
- (NSString*)test;
@end
@interface TestFramework: NSObject
@end
static void _testBundle(NSBundle* bundle, NSString* path, NSString* className)
{
@ -101,6 +103,10 @@ int main()
END_SET("Bundle")
START_SET("Framework")
/* This method call is required to ensure that the linker does not decide to
* elide the framework linkage.
*/
[TestFramework class];
bundle = [NSBundle bundleForClass: NSClassFromString(@"TestFramework")];
path = [bundle bundlePath];
_testBundle(bundle, path, @"TestFramework");