Fix linking with -whole-module-optimization enabled

This commit is contained in:
NanoTech
2017-02-15 22:40:47 -06:00
parent d244d0293d
commit 01fd35818c
4 changed files with 45 additions and 39 deletions
-9
View File
@@ -37,15 +37,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
@_cdecl("runNSApplication")
func runNSApplication() {
let app = NSApplication.shared()
var topObjects: NSArray = []
NSNib.init(nibNamed: "MainMenu", bundle: Bundle(for: AppDelegate.self))!
.instantiate(withOwner: app, topLevelObjects: &topObjects)
app.run()
}
// Swift to Haskell ByteString Example
+13
View File
@@ -0,0 +1,13 @@
#import "SwiftAppLibrary.h"
@interface AClassInThisFramework : NSObject @end
@implementation AClassInThisFramework @end
void runNSApplication(void) {
NSApplication *app = [NSApplication sharedApplication];
NSBundle *bundle = [NSBundle bundleForClass:[AClassInThisFramework class]];
NSArray *topObjects;
[[[NSNib alloc] initWithNibNamed:@"MainMenu" bundle:bundle]
instantiateWithOwner:app topLevelObjects:&topObjects];
[app run];
}