Browse Source

Add KICAD_ALLOC_CONSOLE environment variable to show console in GUI apps on Windows.

For debugging purposes, currently.
7.0
Alex 3 years ago
parent
commit
04c82a42eb
  1. 6
      libs/kiplatform/msw/app.cpp

6
libs/kiplatform/msw/app.cpp

@ -59,9 +59,11 @@ bool KIPLATFORM::APP::Init()
SetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT );
// In order to support GUI and CLI
// Let's attach to console when it's possible
// Let's attach to console when it's possible, or allocate if requested.
bool tryAlloc = wxGetEnv( wxS( "KICAD_ALLOC_CONSOLE" ), nullptr );
HANDLE handle;
if( AttachConsole( ATTACH_PARENT_PROCESS ) )
if( AttachConsole( ATTACH_PARENT_PROCESS ) || ( tryAlloc && AllocConsole() ) )
{
#if !defined( __MINGW32__ ) // These redirections create problems on mingw:
// Nothing is printed to the console

Loading…
Cancel
Save