]> khamidou — GitHub mirrors - electron.git/commitdiff
Implement main function on Windows.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 1 Jul 2013 14:21:31 +0000 (22:21 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 1 Jul 2013 14:21:31 +0000 (22:21 +0800)
app/atom_library_main.cc
app/atom_library_main.h
app/atom_main.cc
atom.gyp

index 459bb724ffaed4d981ab92cb3d397492cd2d183f..6b78a63bf8555d10d843cca09f6d880ee349b4b3 100644 (file)
@@ -7,7 +7,9 @@
 #include "app/atom_main_delegate.h"
 #include "content/public/app/content_main.h"
 
+#if defined(OS_MACOSX)
 int AtomMain(int argc, const char* argv[]) {
   atom::AtomMainDelegate delegate;
   return content::ContentMain(argc, argv, &delegate);
 }
+#endif  // OS_MACOSX
index b9aa32511b266c4d2fdec24b3520cf050e9f01d6..d5d7dd9f443c187eeb150a3686ecc361d91f5c89 100644 (file)
@@ -5,9 +5,13 @@
 #ifndef ATOM_APP_ATOM_LIBRARY_MAIN_
 #define ATOM_APP_ATOM_LIBRARY_MAIN_
 
+#include "base/basictypes.h"
+
+#if defined(OS_MACOSX)
 extern "C" {
 __attribute__((visibility("default")))
 int AtomMain(int argc, const char* argv[]);
 }
+#endif  // OS_MACOSX
 
 #endif  // ATOM_APP_ATOM_LIBRARY_MAIN_
index 01dbdf03b9a2c2eef3e27bd8fdfd1401c2d436c6..1811a4054ba57d877275d78c9eb0de341d5cf040 100644 (file)
@@ -2,8 +2,27 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "content/public/app/content_main.h"
+
+#if defined(OS_WIN)
+
+#include "app/atom_main_delegate.h"
+#include "content/public/app/startup_helper_win.h"
+#include "sandbox/win/src/sandbox_types.h"
+
+int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {
+  sandbox::SandboxInterfaceInfo sandbox_info = {0};
+  content::InitializeSandboxInfo(&sandbox_info);
+  atom::AtomMainDelegate delegate;
+  return content::ContentMain(instance, &sandbox_info, &delegate);
+}
+
+#else
+
 #include "app/atom_library_main.h"
 
 int main(int argc, const char* argv[]) {
   return AtomMain(argc, argv);
 }
+
+#endif  // OS_WIN
index 1a87591ad8fff07138b8ba040c3ada59317c821c..b53bbfc6783a55cb172a7a36a60277d0dd67cf2d 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
         '.',
         'vendor',
       ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '.',
+        ],
+      },
+      'export_dependent_settings': [
+        'vendor/brightray/brightray.gyp:brightray',
+      ],
     },
     {
       'target_name': 'generated_sources',
             'vendor',
             '<(libchromiumcontent_include_dir)',
           ],
+          'export_dependent_settings': [
+            '<(project_name)_lib',
+          ],
           'link_settings': {
             'libraries': [
               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',