Skip to content

Commit

Permalink
fix xcode gyp build
Browse files Browse the repository at this point in the history
  • Loading branch information
博然 committed Jun 28, 2020
1 parent 956512e commit 1e45eb1
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 21 deletions.
1 change: 1 addition & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

# change to real android NDK path
export NDK_ROOT=/d/android-ndk-r10b

export PROJECT_ROOT=`pwd`
Expand Down
2 changes: 0 additions & 2 deletions demos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 zhang jipeng. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key>
Expand Down
24 changes: 16 additions & 8 deletions demos/demos.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@
],
}],
['OS=="macosx" or OS=="ios"', {
'mac_bundle': 1,
'sources': [
'platform_apple.m',
'Info.plist',
'Main.storyboard',
],
'defines':[
'UNIX',
],
'xcode_settings': {
'INFOPLIST_FILE': 'demos/Info.plist',
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
Expand Down Expand Up @@ -100,14 +102,16 @@
],
}],
['OS=="macosx" or OS=="ios"', {
'mac_bundle': 1,
'sources': [
'platform_apple.m',
'Info.plist',
'Main.storyboard',
],
'defines':[
'UNIX',
],
'xcode_settings': {
'INFOPLIST_FILE': 'demos/Info.plist',
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
Expand Down Expand Up @@ -158,14 +162,16 @@
],
}],
['OS=="macosx" or OS=="ios"', {
'mac_bundle': 1,
'sources': [
'platform_apple.m',
'Info.plist',
'Main.storyboard',
],
'defines':[
'UNIX',
],
'xcode_settings': {
'INFOPLIST_FILE': 'demos/Info.plist',
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
Expand Down Expand Up @@ -216,14 +222,16 @@
],
}],
['OS=="macosx" or OS=="ios"', {
'mac_bundle': 1,
'sources': [
'platform_apple.m',
'Info.plist',
'Main.storyboard',
],
'defines':[
'UNIX',
],
'xcode_settings': {
'INFOPLIST_FILE': 'demos/Info.plist',
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
Expand Down
13 changes: 10 additions & 3 deletions demos/platform_apple.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// platform_apple
//
// Created by zhangjipeng on 2019/10/25.
// Copyright © 2019 zhang jipeng. All rights reserved.

Expand All @@ -11,13 +9,19 @@ @interface AppDelegate : NSObject <NSApplicationDelegate>
@end

@interface AppDelegate ()

@property NSWindow* mainWindow;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSRect rc = NSMakeRect(0, 0, 640, 480);
NSWindowStyleMask style = NSWindowStyleMaskClosable | NSWindowStyleMaskTitled | NSWindowStyleMaskResizable;
_mainWindow = [[NSWindow alloc] initWithContentRect:rc styleMask:style backing:NSBackingStoreBuffered defer:NO];
[_mainWindow setTitle:@"Picasso demos"];
[_mainWindow makeKeyAndOrderFront:_mainWindow];
[_mainWindow makeKeyWindow];
}


Expand Down Expand Up @@ -48,6 +52,9 @@ int main(int argc, const char * argv[])
{
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
AppDelegate * delegate = [[AppDelegate alloc] init];
NSApplication * application = [NSApplication sharedApplication];
[application setDelegate:delegate];
}
return NSApplicationMain(argc, argv);
}
36 changes: 36 additions & 0 deletions test/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 zhang jipeng. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
</dict>
</plist>
Loading

0 comments on commit 1e45eb1

Please sign in to comment.