diff --git a/pylibfdt/meson.build b/pylibfdt/meson.build index 978c53f..6157f8d 100644 --- a/pylibfdt/meson.build +++ b/pylibfdt/meson.build @@ -6,7 +6,7 @@ pylibfdt = custom_target( input: 'libfdt.i', depends: libfdt, output: '_libfdt.so', - command: [setup_py, 'build_ext', '--build-lib=' + meson.current_build_dir()], + command: [setup_py, 'build_ext'], build_by_default: true, ) diff --git a/tests/run_tests.sh b/tests/run_tests.sh index c5d6a88..937b128 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -18,7 +18,9 @@ if [ -n "$NO_PYTHON" ]; then no_python=false fi else - if [ -f ../pylibfdt/_libfdt.so ] || [ -f ../pylibfdt/_libfdt.cpython-3*.so ]; then + if [ -f ../pylibfdt/_libfdt.so ] \ + || [ -f ../pylibfdt/_libfdt.cpython-3*.so ] \ + || [ -f ../build/lib.*/_libfdt.cpython-3*.so ]; then no_python=false else no_python=true @@ -61,6 +63,16 @@ else export LD_LIBRARY_PATH="$TEST_LIBDIR" fi +# Find the python module that distutils builds under a machine-specific path +PYLIBFDT_BUILD=$(echo ../build/lib.*) +if [ -e "$PYLIBFDT_BUILD" ]; then + if [ -n "$PYTHONPATH" ]; then + export PYTHONPATH="$PYTHONPATH:$PYLIBFDT_BUILD" + else + export PYTHONPATH="$PYLIBFDT_BUILD" + fi +fi + export QUIET_TEST=1 STOP_ON_FAIL=0