upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 9f7e34e..99e63d4 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -5,7 +5,11 @@
5#include <csignal> 5#include <csignal>
6#endif 6#endif
7 7
8// BITFLASH_NO_GUI builds the same entry point without ImGui, GLFW or OpenGL,
9// so the binary does not need libGL present just to start. See headless.cpp.
10#ifndef BITFLASH_NO_GUI
8int RunGUI(int argc, char* argv[]); 11int RunGUI(int argc, char* argv[]);
12#endif
9 13
10// Global definitions (were in ui.cpp, now here) 14// Global definitions (were in ui.cpp, now here)
11map<string,string> mapAddressBook; 15map<string,string> mapAddressBook;
@@ -186,8 +190,13 @@ int main(int argc, char* argv[])
186 if (_beginthread(ThreadBitcoinMiner, 0, NULL) == (uintptr_t)-1) 190 if (_beginthread(ThreadBitcoinMiner, 0, NULL) == (uintptr_t)-1)
187 printf("Error: _beginthread(ThreadBitcoinMiner) failed\n"); 191 printf("Error: _beginthread(ThreadBitcoinMiner) failed\n");
188 192
193#ifdef BITFLASH_NO_GUI
194 // Nothing else this binary can do; /nogui is accepted and redundant.
195 bool fHeadless = true;
196#else
189 bool fHeadless = arg(argc,argv,"/nogui") || arg(argc,argv,"-nogui") || 197 bool fHeadless = arg(argc,argv,"/nogui") || arg(argc,argv,"-nogui") ||
190 arg(argc,argv,"/daemon") || arg(argc,argv,"-daemon"); 198 arg(argc,argv,"/daemon") || arg(argc,argv,"-daemon");
199#endif
191 200
192 if (fHeadless) { 201 if (fHeadless) {
193#ifndef _WIN32 202#ifndef _WIN32
@@ -200,8 +209,12 @@ int main(int argc, char* argv[])
200 return 0; 209 return 0;
201 } 210 }
202 211
212#ifdef BITFLASH_NO_GUI
213 return 0; // unreachable: fHeadless is always true in this build
214#else
203 int ret = RunGUI(argc, argv); 215 int ret = RunGUI(argc, argv);
204 fShutdown = true; 216 fShutdown = true;
205 StopNode(); 217 StopNode();
206 return ret; 218 return ret;
219#endif
207} 220}