mirror of https://github.com/YosysHQ/yosys.git
The share directory cannot be searched when used as a Python library, only in shell mode
This commit is contained in:
parent
6d18837d62
commit
d41c68ee5a
|
@ -110,6 +110,10 @@ int main(int argc, char **argv)
|
||||||
log_error_stderr = true;
|
log_error_stderr = true;
|
||||||
yosys_banner();
|
yosys_banner();
|
||||||
yosys_setup();
|
yosys_setup();
|
||||||
|
#ifdef WITH_PYTHON
|
||||||
|
PyRun_SimpleString(("sys.path.append(\""+proc_self_dirname()+"\")").c_str());
|
||||||
|
PyRun_SimpleString(("sys.path.append(\""+proc_share_dirname()+"plugins\")").c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
{
|
{
|
||||||
|
@ -462,6 +466,10 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
yosys_setup();
|
yosys_setup();
|
||||||
|
#ifdef WITH_PYTHON
|
||||||
|
PyRun_SimpleString(("sys.path.append(\""+proc_self_dirname()+"\")").c_str());
|
||||||
|
PyRun_SimpleString(("sys.path.append(\""+proc_share_dirname()+"plugins\")").c_str());
|
||||||
|
#endif
|
||||||
log_error_atexit = yosys_atexit;
|
log_error_atexit = yosys_atexit;
|
||||||
|
|
||||||
for (auto &fn : plugin_filenames)
|
for (auto &fn : plugin_filenames)
|
||||||
|
|
|
@ -495,7 +495,6 @@ void yosys_setup()
|
||||||
PyImport_AppendInittab((char*)"libyosys", INIT_MODULE);
|
PyImport_AppendInittab((char*)"libyosys", INIT_MODULE);
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
PyRun_SimpleString("import sys");
|
PyRun_SimpleString("import sys");
|
||||||
PyRun_SimpleString(("sys.path.append(\""+proc_share_dirname()+"plugins\")").c_str());
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Pass::init_register();
|
Pass::init_register();
|
||||||
|
|
Loading…
Reference in New Issue