File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ else()
2222 set (RC_FILES "" )
2323endif ()
2424
25+ if (WIN32 AND (NOT MSVC ))
26+ add_compile_options (-mwindows )
27+ endif ()
28+
2529###############################################################################
2630#C++ compilation
2731add_executable (ngscopeclient
Original file line number Diff line number Diff line change @@ -72,7 +72,13 @@ int main(int argc, char* argv[])
7272 // If on Windows, and not run from a console
7373 // remove the stdout log sink that would otherwise spawn a console on startup
7474 #ifdef _WIN32
75- if (GetConsoleWindow () == NULL )
75+ if (!AttachConsole (ATTACH_PARENT_PROCESS))
76+ {
77+ LogNotice (
78+ " Startup: skipping stdout log sink since not run from a console "
79+ " (AttachConsole reports parent process has no console)\n " );
80+ }
81+ else if (GetConsoleWindow () == NULL )
7682 LogNotice (" Startup: skipping stdout log sink since not run from a console (no console window)\n " );
7783 else if (getenv (" PROMPT" ) != nullptr )
7884 LogNotice (" Startup: skipping stdout log sink since not run from a console (no prompt)\n " );
You can’t perform that action at this time.
0 commit comments