mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-23 16:04:37 +00:00
plugins: add search path
This uses the environment variable `YOSYS_PLUGIN_PATH` to provide multiple colon-delimited search paths for native plugins in a similar manner to `PATH` for executables and `PYTHONPATH` for Python modules. This addresses https://github.com/YosysHQ/yosys/issues/2545, allowing Yosys to be better packaged in non-FHS environments such as Nix.
This commit is contained in:
parent
4970ad5a18
commit
e86797f029
3 changed files with 46 additions and 20 deletions
|
|
@ -1,8 +1,12 @@
|
|||
set -e
|
||||
rm -f plugin.so
|
||||
rm -rf plugin_search
|
||||
CXXFLAGS=$(../../yosys-config --cxxflags)
|
||||
DATDIR=$(../../yosys-config --datdir)
|
||||
DATDIR=${DATDIR//\//\\\/}
|
||||
CXXFLAGS=${CXXFLAGS//$DATDIR/..\/..\/share}
|
||||
../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc
|
||||
../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!"
|
||||
mkdir -p plugin_search
|
||||
mv plugin.so plugin_search/plugin.so
|
||||
YOSYS_PLUGIN_PATH=$PWD/plugin_search ../../yosys -m plugin.so -p "test" | grep -q "Plugin test passed!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue