electron/atom/app/atom_library_main.mm
Robo a24ad6bc14 build: define compile time features with buildflag header (#14840)
* build: define compile time features with buildflag header

* refactor: switch to BUILDFLAG(ENABLE_DESKTOP_CAPTURER)

* refactor: switch to BUILDFLAG(ENABLE_RUN_AS_NODE)

* refactor: switch to BUILDFLAG(ENABLE_OSR)

* refactor: switch to BUILDFLAG(ENABLE_VIEW_API)

* refactor: switch to BUILDFLAG(ENABLE_PEPPER_FLASH)

* refactor: switch to BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)

* refactor: switch to BUILDFLAG(ENABLE_PDF_VIEWER)
2018-10-01 16:00:53 -04:00

38 lines
1.3 KiB
Text

// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_library_main.h"
#include "atom/app/atom_main_delegate.h"
#include "atom/app/node_main.h"
#include "atom/common/atom_command_line.h"
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/app/content_main.h"
int AtomMain(int argc, char* argv[]) {
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = const_cast<const char**>(argv);
atom::AtomCommandLine::Init(argc, argv);
return content::ContentMain(params);
}
#if BUILDFLAG(ENABLE_RUN_AS_NODE)
int AtomInitializeICUandStartNode(int argc, char* argv[]) {
base::AtExitManager atexit_manager;
base::mac::ScopedNSAutoreleasePool pool;
base::mac::SetOverrideFrameworkBundlePath(
brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
.Append(ATOM_PRODUCT_NAME " Framework.framework"));
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
}
#endif