Pass configured Python interpreter in to use for BOM plugins

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8594
This commit is contained in:
Jon Evans 2021-06-15 22:52:16 -04:00
parent 8f9800f760
commit 27932883d9
2 changed files with 10 additions and 1 deletions

View File

@ -99,4 +99,7 @@
/// When pkg-config config is not available for ngspice, use ngspice/config.h for version.
#cmakedefine NGSPICE_HAVE_CONFIG_H
/// Path to the python executable that should be used by KiCad
#define PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@"
#endif // CONFIG_H_

View File

@ -23,6 +23,7 @@
*/
#include "bom_plugins.h"
#include <config.h>
#include <paths.h>
#include <wx/ffile.h>
#include <wx/log.h>
@ -70,7 +71,12 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile )
m_file.GetPath(), m_file.GetFullName(),
getOutputExtension( m_info ) );
#else
m_cmd = wxString::Format( "python \"%s\" \"%%I\" \"%%O%s\"", m_file.GetFullPath(),
wxString interpreter = wxString::FromUTF8Unchecked( PYTHON_EXECUTABLE );
if( interpreter.IsEmpty() )
interpreter = wxT( "python" );
m_cmd = wxString::Format( "%s \"%s\" \"%%I\" \"%%O%s\"", interpreter, m_file.GetFullPath(),
getOutputExtension( m_info ) );
#endif
}