Skip to content

Commit

Permalink
Build errors OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Aug 5, 2014
1 parent 81e35da commit 274d26a
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 425 deletions.
91 changes: 58 additions & 33 deletions exo_shell.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'variables': {
'project_name': 'exo_shell',
'product_name': 'ExoShell',
'framework_name': 'ExoShell Framework',
'app_sources': [
'src/browser/resources/win/exo_shell.rc',
'src/browser/resources/win/resource.h',
Expand Down Expand Up @@ -138,6 +139,18 @@
'includes': [
'vendor/brightray/brightray.gypi',
],
'target_defaults': {
'includes': [
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
'filename_rules.gypi',
],
'configurations': {
'Debug': {
'defines': [ 'DEBUG' ],
'cflags': [ '-g', '-O0' ],
},
},
},
'targets': [
{
'target_name': '<(project_name)',
Expand Down Expand Up @@ -168,7 +181,7 @@
'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Frameworks',
'files': [
'<(PRODUCT_DIR)/<(product_name) Helper.app',
'<(PRODUCT_DIR)/<(product_name).framework',
'<(PRODUCT_DIR)/<(framework_name).framework',
],
},
],
Expand Down Expand Up @@ -240,6 +253,8 @@
],
'include_dirs': [
'.',
'chromium_src',
'vendor/brightray',
],
'direct_dependent_settings': {
'include_dirs': [
Expand All @@ -250,28 +265,17 @@
'vendor/brightray/brightray.gyp:brightray',
],
'conditions': [
['OS!="linux"', {
'sources/': [
['exclude', '/linux/'],
['exclude', '_linux\.(cc|h)$'],
],
}],
['OS!="mac"', {
'sources/': [
['exclude', '/mac/'],
['exclude', '_mac\.(mm|h)$'],
],
},{
'sources/': [
['exclude', '/views/'],
['exclude', '_views\.(cc|h)$'],
],
}],
['OS!="win"', {
'sources/': [
['exclude', '/win/'],
['exclude', '_win\.(cc|h)$'],
],
['OS=="linux"', {
'link_settings': {
'ldflags': [
# Make binary search for libraries under current directory, so we
# don't have to manually set $LD_LIBRARY_PATH:
# http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
'-rpath \$$ORIGIN',
# Make native module dynamic loading work.
'-rdynamic',
],
},
}],
],
},
Expand Down Expand Up @@ -299,30 +303,49 @@
'targets': [
{
'target_name': '<(project_name)_framework',
'product_name': '<(product_name)',
'product_name': '<(framework_name)',
'type': 'shared_library',
'dependencies': [
'<(project_name)_lib',
],
'sources': [
'<@(framework_sources)',
],
'include_dirs': [
'.',
'vendor',
'<(libchromiumcontent_include_dir)',
],
'export_dependent_settings': [
'<(project_name)_lib',
],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
'$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
],
},
'mac_bundle': 1,
'mac_bundle_resources': [
'<(libchromiumcontent_resources_dir)/content_shell.pak',
'<(libchromiumcontent_resources_dir)/icudtl.dat',
],
'xcode_settings': {
'LIBRARY_SEARCH_PATHS': '<(libchromiumcontent_library_dir)',
'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name).framework/<(product_name)',
'LD_RUNPATH_SEARCH_PATHS': '@loader_path/Libraries',
'INFOPLIST_FILE': 'src/common/resources/mac/Info.plist',
'LIBRARY_SEARCH_PATHS': [
'<(libchromiumcontent_library_dir)',
],
'LD_DYLIB_INSTALL_NAME': '@rpath/<(framework_name).framework/<(framework_name)',
'LD_RUNPATH_SEARCH_PATHS': [
'@loader_path/Libraries',
],
'OTHER_LDFLAGS': [
'-ObjC',
],
},
'copies': [
{
'destination': '<(PRODUCT_DIR)/<(product_name).framework/Versions/A/Libraries',
'destination': '<(PRODUCT_DIR)/<(framework_name).framework/Versions/A/Libraries',
'files': [
'<(libchromiumcontent_library_dir)/ffmpegsumo.so',
'<(libchromiumcontent_library_dir)/libchromiumcontent.dylib',
Expand All @@ -334,15 +357,12 @@
'postbuild_name': 'Add symlinks for framework subdirectories',
'action': [
'tools/mac/create-framework-subdir-symlinks.sh',
'<(product_name)',
'<(framework_name)',
'Libraries',
'Frameworks',
],
},
],
'export_dependent_settings': [
'<(project_name)_lib',
],
},
{
'target_name': '<(project_name)_helper',
Expand All @@ -354,10 +374,15 @@
'sources': [
'<@(app_sources)',
],
'include_dirs': [
'.',
],
'mac_bundle': 1,
'xcode_settings': {
'INFOPLIST_FILE': 'src/renderer/resources/mac/Info.plist',
'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../../../../Frameworks',
'LD_RUNPATH_SEARCH_PATHS': [
'@executable_path/../../..',
],
},
},
],
Expand Down
76 changes: 76 additions & 0 deletions filename_rules.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This gypi file defines the patterns used for determining whether a
# file is excluded from the build on a given platform. It is
# included by common.gypi for chromium_code.

{
'target_conditions': [
['OS!="win"', {
'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)win/'],
['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ],
}],
['OS!="mac"', {
'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc|mm?)$'],
['exclude', '(^|/)(cocoa|mac)/'] ],
}],
['OS!="ios"', {
'sources/': [ ['exclude', '_ios(_unittest)?\\.(h|cc|mm?)$'],
['exclude', '(^|/)ios/'] ],
}],
['OS!="mac" and OS!="ios"', {
'sources/': [ ['exclude', '\\.mm?$' ] ],
}],
# Do not exclude the linux files on *BSD since most of them can be
# shared at this point.
# In case a file is not needed, it is going to be excluded later on.
# TODO(evan): the above is not correct; we shouldn't build _linux
# files on non-linux.
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
'sources/': [
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'],
['exclude', '(^|/)linux/'],
['exclude', '_x11(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'],
['exclude', '(^|/)x11/'],
],
}],
['OS!="android"', {
'sources/': [
['exclude', '_android(_unittest)?\\.cc$'],
['exclude', '(^|/)android/'],
],
}],
['OS=="win"', {
'sources/': [
['exclude', '_posix(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)posix/'],
],
}],
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
'sources/': [
['exclude', '_xdg(_unittest)?\\.(h|cc)$'],
],
}],
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
'sources/': [
['exclude', '_gtk(_browsertest|_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)gtk/'],
['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'],
['exclude', '(^|/)libgtk2ui/'],
['exclude', '(^|/)x/'],
],
}],
['OS=="mac"', {
'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)aura/'],
['exclude', '_views\\.(h|cc)$'],
['exclude', '(^|/)views/'],
],
}],
]
}
3 changes: 3 additions & 0 deletions src/api/api_binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#ifndef EXO_SHELL_API_API_BINDING_H_
#define EXO_SHELL_API_API_BINDING_H_

#include <map>

#include "base/memory/scoped_ptr.h"
#include "base/values.h"

#include "src/api/api_handler.h"

Expand Down
2 changes: 2 additions & 0 deletions src/api/api_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef EXO_SHELL_API_API_HANDLER_H_
#define EXO_SHELL_API_API_HANDLER_H_

#include <map>

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"

Expand Down
4 changes: 2 additions & 2 deletions src/browser/browser_main_parts_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsobject.h"

#include "src/browser/mac/browser_application_mac.h"
#include "src/browser/mac/application_mac.h"

namespace exo_shell {

void
ExoShellMainParts::PreMainMessageLoopStart()
{
// Force the NSApplication subclass to be used.
NSApplication* application = [ExoShellApplication sharedApplication];
[ExoShellApplication sharedApplication];

// Prevent Cocoa from turning command-line arguments into
// |-application:openFiles:|, since we already handle them directly.
Expand Down
3 changes: 2 additions & 1 deletion src/browser/dialog/javascript_dialog_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ ExoShellJavaScriptDialogManager::WebContentsDestroyed(
{
}

/*
void
ExoShellJavaScriptDialogManager::DialogClosed(
JavaScriptDialog* dialog)
{
/* TODO(spolu): Expose to API */
}
*/

} // namespace exo_shell
6 changes: 3 additions & 3 deletions src/browser/dialog/javascript_dialog_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace exo_shell {

class JavaScriptDialog;
//class JavaScriptDialog;

class ExoShellJavaScriptDialogManager :
public content::JavaScriptDialogManager {
Expand Down Expand Up @@ -44,7 +44,7 @@ class ExoShellJavaScriptDialogManager :
content::WebContents* web_contents) OVERRIDE;

// Called by the JavaScriptDialog when it closes.
void DialogClosed(JavaScriptDialog* dialog);
// void DialogClosed(JavaScriptDialog* dialog);

// Used for content_browsertests.
void set_dialog_request_callback(const base::Closure& callback) {
Expand All @@ -54,7 +54,7 @@ class ExoShellJavaScriptDialogManager :
private:
#if defined(OS_MACOSX) || defined(OS_WIN) || defined(TOOLKIT_GTK)
// The dialog being shown. No queueing.
scoped_ptr<JavaScriptDialog> dialog_;
// scoped_ptr<JavaScriptDialog> dialog_;
#else
/* TODO(spolu): implement JavaScriptDialog for other platforms, */
/* and then drop this #if */
Expand Down
29 changes: 0 additions & 29 deletions src/browser/exo_frame_mac.mm

This file was deleted.

1 change: 1 addition & 0 deletions src/browser/exo_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "ui/gfx/codec/png_codec.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
Expand Down
2 changes: 1 addition & 1 deletion src/browser/exo_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "ui/gfx/size.h"
#include "ui/gfx/point.h"
#include "ui/gfx/image/image.h"
#include "ui/views/widget/widget.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/web_contents_observer.h"
Expand All @@ -24,6 +23,7 @@
#include "vendor/brightray/browser/inspectable_web_contents_impl.h"

#if defined(USE_AURA)
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
#endif
Expand Down
Loading

0 comments on commit 274d26a

Please sign in to comment.