Merge pull request #12196 from electron/fix_run_as_node

Fixed Mac build when enable_run_as_node==false
This commit is contained in:
John Kleinschmidt 2018-03-09 09:22:42 -05:00 committed by GitHub
commit f685e389d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -12,8 +12,10 @@ extern "C" {
__attribute__((visibility("default")))
int AtomMain(int argc, char* argv[]);
#ifdef ENABLE_RUN_AS_NODE
__attribute__((visibility("default")))
int AtomInitializeICUandStartNode(int argc, char *argv[]);
#endif
}
#endif // OS_MACOSX

View file

@ -14,7 +14,6 @@
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/app/content_main.h"
#if defined(OS_MACOSX)
int AtomMain(int argc, char* argv[]) {
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
@ -24,6 +23,7 @@ int AtomMain(int argc, char* argv[]) {
return content::ContentMain(params);
}
#ifdef ENABLE_RUN_AS_NODE
int AtomInitializeICUandStartNode(int argc, char *argv[]) {
base::AtExitManager atexit_manager;
base::mac::ScopedNSAutoreleasePool pool;
@ -35,4 +35,4 @@ int AtomInitializeICUandStartNode(int argc, char *argv[]) {
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
}
#endif // OS_MACOSX
#endif

View file

@ -42,6 +42,7 @@ namespace {
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE";
#endif
#if defined(ENABLE_RUN_AS_NODE) || defined(OS_WIN)
bool IsEnvSet(const char* name) {
#if defined(OS_WIN)
size_t required_size;
@ -52,6 +53,7 @@ bool IsEnvSet(const char* name) {
return indicator && indicator[0] != '\0';
#endif
}
#endif
} // namespace