Skip to content

Commit 274d26a

Browse files
author
Stanislas Polu
committed
Build errors OSX
1 parent 81e35da commit 274d26a

17 files changed

+237
-425
lines changed

exo_shell.gyp

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'variables': {
66
'project_name': 'exo_shell',
77
'product_name': 'ExoShell',
8+
'framework_name': 'ExoShell Framework',
89
'app_sources': [
910
'src/browser/resources/win/exo_shell.rc',
1011
'src/browser/resources/win/resource.h',
@@ -138,6 +139,18 @@
138139
'includes': [
139140
'vendor/brightray/brightray.gypi',
140141
],
142+
'target_defaults': {
143+
'includes': [
144+
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
145+
'filename_rules.gypi',
146+
],
147+
'configurations': {
148+
'Debug': {
149+
'defines': [ 'DEBUG' ],
150+
'cflags': [ '-g', '-O0' ],
151+
},
152+
},
153+
},
141154
'targets': [
142155
{
143156
'target_name': '<(project_name)',
@@ -168,7 +181,7 @@
168181
'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Frameworks',
169182
'files': [
170183
'<(PRODUCT_DIR)/<(product_name) Helper.app',
171-
'<(PRODUCT_DIR)/<(product_name).framework',
184+
'<(PRODUCT_DIR)/<(framework_name).framework',
172185
],
173186
},
174187
],
@@ -240,6 +253,8 @@
240253
],
241254
'include_dirs': [
242255
'.',
256+
'chromium_src',
257+
'vendor/brightray',
243258
],
244259
'direct_dependent_settings': {
245260
'include_dirs': [
@@ -250,28 +265,17 @@
250265
'vendor/brightray/brightray.gyp:brightray',
251266
],
252267
'conditions': [
253-
['OS!="linux"', {
254-
'sources/': [
255-
['exclude', '/linux/'],
256-
['exclude', '_linux\.(cc|h)$'],
257-
],
258-
}],
259-
['OS!="mac"', {
260-
'sources/': [
261-
['exclude', '/mac/'],
262-
['exclude', '_mac\.(mm|h)$'],
263-
],
264-
},{
265-
'sources/': [
266-
['exclude', '/views/'],
267-
['exclude', '_views\.(cc|h)$'],
268-
],
269-
}],
270-
['OS!="win"', {
271-
'sources/': [
272-
['exclude', '/win/'],
273-
['exclude', '_win\.(cc|h)$'],
274-
],
268+
['OS=="linux"', {
269+
'link_settings': {
270+
'ldflags': [
271+
# Make binary search for libraries under current directory, so we
272+
# don't have to manually set $LD_LIBRARY_PATH:
273+
# http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
274+
'-rpath \$$ORIGIN',
275+
# Make native module dynamic loading work.
276+
'-rdynamic',
277+
],
278+
},
275279
}],
276280
],
277281
},
@@ -299,30 +303,49 @@
299303
'targets': [
300304
{
301305
'target_name': '<(project_name)_framework',
302-
'product_name': '<(product_name)',
306+
'product_name': '<(framework_name)',
303307
'type': 'shared_library',
304308
'dependencies': [
305309
'<(project_name)_lib',
306310
],
307311
'sources': [
308312
'<@(framework_sources)',
309313
],
314+
'include_dirs': [
315+
'.',
316+
'vendor',
317+
'<(libchromiumcontent_include_dir)',
318+
],
319+
'export_dependent_settings': [
320+
'<(project_name)_lib',
321+
],
322+
'link_settings': {
323+
'libraries': [
324+
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
325+
'$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
326+
],
327+
},
310328
'mac_bundle': 1,
311329
'mac_bundle_resources': [
312330
'<(libchromiumcontent_resources_dir)/content_shell.pak',
313331
'<(libchromiumcontent_resources_dir)/icudtl.dat',
314332
],
315333
'xcode_settings': {
316-
'LIBRARY_SEARCH_PATHS': '<(libchromiumcontent_library_dir)',
317-
'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name).framework/<(product_name)',
318-
'LD_RUNPATH_SEARCH_PATHS': '@loader_path/Libraries',
334+
'INFOPLIST_FILE': 'src/common/resources/mac/Info.plist',
335+
'LIBRARY_SEARCH_PATHS': [
336+
'<(libchromiumcontent_library_dir)',
337+
],
338+
'LD_DYLIB_INSTALL_NAME': '@rpath/<(framework_name).framework/<(framework_name)',
339+
'LD_RUNPATH_SEARCH_PATHS': [
340+
'@loader_path/Libraries',
341+
],
319342
'OTHER_LDFLAGS': [
320343
'-ObjC',
321344
],
322345
},
323346
'copies': [
324347
{
325-
'destination': '<(PRODUCT_DIR)/<(product_name).framework/Versions/A/Libraries',
348+
'destination': '<(PRODUCT_DIR)/<(framework_name).framework/Versions/A/Libraries',
326349
'files': [
327350
'<(libchromiumcontent_library_dir)/ffmpegsumo.so',
328351
'<(libchromiumcontent_library_dir)/libchromiumcontent.dylib',
@@ -334,15 +357,12 @@
334357
'postbuild_name': 'Add symlinks for framework subdirectories',
335358
'action': [
336359
'tools/mac/create-framework-subdir-symlinks.sh',
337-
'<(product_name)',
360+
'<(framework_name)',
338361
'Libraries',
339362
'Frameworks',
340363
],
341364
},
342365
],
343-
'export_dependent_settings': [
344-
'<(project_name)_lib',
345-
],
346366
},
347367
{
348368
'target_name': '<(project_name)_helper',
@@ -354,10 +374,15 @@
354374
'sources': [
355375
'<@(app_sources)',
356376
],
377+
'include_dirs': [
378+
'.',
379+
],
357380
'mac_bundle': 1,
358381
'xcode_settings': {
359382
'INFOPLIST_FILE': 'src/renderer/resources/mac/Info.plist',
360-
'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../../../../Frameworks',
383+
'LD_RUNPATH_SEARCH_PATHS': [
384+
'@executable_path/../../..',
385+
],
361386
},
362387
},
363388
],

filename_rules.gypi

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
# This gypi file defines the patterns used for determining whether a
6+
# file is excluded from the build on a given platform. It is
7+
# included by common.gypi for chromium_code.
8+
9+
{
10+
'target_conditions': [
11+
['OS!="win"', {
12+
'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'],
13+
['exclude', '(^|/)win/'],
14+
['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ],
15+
}],
16+
['OS!="mac"', {
17+
'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc|mm?)$'],
18+
['exclude', '(^|/)(cocoa|mac)/'] ],
19+
}],
20+
['OS!="ios"', {
21+
'sources/': [ ['exclude', '_ios(_unittest)?\\.(h|cc|mm?)$'],
22+
['exclude', '(^|/)ios/'] ],
23+
}],
24+
['OS!="mac" and OS!="ios"', {
25+
'sources/': [ ['exclude', '\\.mm?$' ] ],
26+
}],
27+
# Do not exclude the linux files on *BSD since most of them can be
28+
# shared at this point.
29+
# In case a file is not needed, it is going to be excluded later on.
30+
# TODO(evan): the above is not correct; we shouldn't build _linux
31+
# files on non-linux.
32+
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
33+
'sources/': [
34+
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
35+
['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'],
36+
['exclude', '(^|/)linux/'],
37+
['exclude', '_x11(_unittest)?\\.(h|cc)$'],
38+
['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'],
39+
['exclude', '(^|/)x11/'],
40+
],
41+
}],
42+
['OS!="android"', {
43+
'sources/': [
44+
['exclude', '_android(_unittest)?\\.cc$'],
45+
['exclude', '(^|/)android/'],
46+
],
47+
}],
48+
['OS=="win"', {
49+
'sources/': [
50+
['exclude', '_posix(_unittest)?\\.(h|cc)$'],
51+
['exclude', '(^|/)posix/'],
52+
],
53+
}],
54+
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
55+
'sources/': [
56+
['exclude', '_xdg(_unittest)?\\.(h|cc)$'],
57+
],
58+
}],
59+
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
60+
'sources/': [
61+
['exclude', '_gtk(_browsertest|_unittest)?\\.(h|cc)$'],
62+
['exclude', '(^|/)gtk/'],
63+
['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'],
64+
['exclude', '(^|/)libgtk2ui/'],
65+
['exclude', '(^|/)x/'],
66+
],
67+
}],
68+
['OS=="mac"', {
69+
'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'],
70+
['exclude', '(^|/)aura/'],
71+
['exclude', '_views\\.(h|cc)$'],
72+
['exclude', '(^|/)views/'],
73+
],
74+
}],
75+
]
76+
}

src/api/api_binding.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
#ifndef EXO_SHELL_API_API_BINDING_H_
55
#define EXO_SHELL_API_API_BINDING_H_
66

7+
#include <map>
8+
79
#include "base/memory/scoped_ptr.h"
10+
#include "base/values.h"
811

912
#include "src/api/api_handler.h"
1013

src/api/api_handler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef EXO_SHELL_API_API_HANDLER_H_
55
#define EXO_SHELL_API_API_HANDLER_H_
66

7+
#include <map>
8+
79
#include "base/memory/ref_counted.h"
810
#include "base/memory/scoped_ptr.h"
911

src/browser/browser_main_parts_mac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#include "base/mac/bundle_locations.h"
1010
#include "base/mac/scoped_nsobject.h"
1111

12-
#include "src/browser/mac/browser_application_mac.h"
12+
#include "src/browser/mac/application_mac.h"
1313

1414
namespace exo_shell {
1515

1616
void
1717
ExoShellMainParts::PreMainMessageLoopStart()
1818
{
1919
// Force the NSApplication subclass to be used.
20-
NSApplication* application = [ExoShellApplication sharedApplication];
20+
[ExoShellApplication sharedApplication];
2121

2222
// Prevent Cocoa from turning command-line arguments into
2323
// |-application:openFiles:|, since we already handle them directly.

src/browser/dialog/javascript_dialog_manager.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ ExoShellJavaScriptDialogManager::WebContentsDestroyed(
8181
{
8282
}
8383

84+
/*
8485
void
8586
ExoShellJavaScriptDialogManager::DialogClosed(
8687
JavaScriptDialog* dialog)
8788
{
88-
/* TODO(spolu): Expose to API */
8989
}
90+
*/
9091

9192
} // namespace exo_shell

src/browser/dialog/javascript_dialog_manager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace exo_shell {
1414

15-
class JavaScriptDialog;
15+
//class JavaScriptDialog;
1616

1717
class ExoShellJavaScriptDialogManager :
1818
public content::JavaScriptDialogManager {
@@ -44,7 +44,7 @@ class ExoShellJavaScriptDialogManager :
4444
content::WebContents* web_contents) OVERRIDE;
4545

4646
// Called by the JavaScriptDialog when it closes.
47-
void DialogClosed(JavaScriptDialog* dialog);
47+
// void DialogClosed(JavaScriptDialog* dialog);
4848

4949
// Used for content_browsertests.
5050
void set_dialog_request_callback(const base::Closure& callback) {
@@ -54,7 +54,7 @@ class ExoShellJavaScriptDialogManager :
5454
private:
5555
#if defined(OS_MACOSX) || defined(OS_WIN) || defined(TOOLKIT_GTK)
5656
// The dialog being shown. No queueing.
57-
scoped_ptr<JavaScriptDialog> dialog_;
57+
// scoped_ptr<JavaScriptDialog> dialog_;
5858
#else
5959
/* TODO(spolu): implement JavaScriptDialog for other platforms, */
6060
/* and then drop this #if */

src/browser/exo_frame_mac.mm

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/browser/exo_shell.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "base/strings/string_util.h"
1111
#include "base/strings/stringprintf.h"
1212
#include "base/strings/utf_string_conversions.h"
13+
#include "base/threading/thread_restrictions.h"
1314
#include "ui/gfx/codec/png_codec.h"
1415
#include "content/public/browser/render_view_host.h"
1516
#include "content/public/browser/web_contents.h"

src/browser/exo_shell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "ui/gfx/size.h"
1515
#include "ui/gfx/point.h"
1616
#include "ui/gfx/image/image.h"
17-
#include "ui/views/widget/widget.h"
1817
#include "content/public/browser/web_contents_delegate.h"
1918
#include "content/public/browser/notification_observer.h"
2019
#include "content/public/browser/web_contents_observer.h"
@@ -24,6 +23,7 @@
2423
#include "vendor/brightray/browser/inspectable_web_contents_impl.h"
2524

2625
#if defined(USE_AURA)
26+
#include "ui/views/widget/widget.h"
2727
#include "ui/views/widget/widget_delegate.h"
2828
#include "ui/views/widget/widget_observer.h"
2929
#endif

0 commit comments

Comments
 (0)