diff --git a/CMakeLists.txt b/CMakeLists.txt index b8dc1c38c7..70c4c763a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,11 @@ cmake_dependent_option( BUILD_SMALL_DEBUG_FILES "In debug build: create smaller # so that build option settings can be included in bug reports. # +option( KICAD_SCRIPTING_WXPYTHON + "Build wxPython implementation for wx interface building in Python and py.shell (default ON)." + ON ) +mark_as_advanced( KICAD_SCRIPTING_WXPYTHON ) + option( KICAD_USE_OCE "Build tools and plugins related to OpenCascade Community Edition (default ON)" ON ) @@ -449,6 +454,10 @@ if( MSVC ) endif() endif() +if( KICAD_SCRIPTING_WXPYTHON ) + add_definitions( -DKICAD_SCRIPTING_WXPYTHON ) +endif() + if( KICAD_SPICE ) add_definitions( -DKICAD_SPICE ) endif() diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 600ac561c8..39f81e02c7 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -406,8 +407,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb ); update->Enable( !Kiface().IsSingle() ); - toolsMenu->AppendSeparator(); - toolsMenu->Add( PCB_ACTIONS::showPythonConsole ); + if( SCRIPTING::IsWxAvailable() ) + { + toolsMenu->AppendSeparator(); + toolsMenu->Add( PCB_ACTIONS::showPythonConsole ); + } ACTION_MENU* submenuActionPlugins = new ACTION_MENU( false, selTool ); submenuActionPlugins->SetTitle( _( "External Plugins" ) ); diff --git a/scripting/python_scripting.cpp b/scripting/python_scripting.cpp index 8cdf4d30b8..3d7027d7b9 100644 --- a/scripting/python_scripting.cpp +++ b/scripting/python_scripting.cpp @@ -93,7 +93,11 @@ SCRIPTING::~SCRIPTING() bool SCRIPTING::IsWxAvailable() { +#ifdef KICAD_SCRIPTING_WXPYTHON return true; +#else + return false; +#endif } bool SCRIPTING::scriptingSetup()