diff --git a/src/platform/python/_builder.py b/src/platform/python/_builder.py index ad380e10f..8d3ba8825 100644 --- a/src/platform/python/_builder.py +++ b/src/platform/python/_builder.py @@ -9,6 +9,7 @@ pydir = os.path.dirname(os.path.abspath(__file__)) srcdir = os.path.join(pydir, "..", "..") incdir = os.path.join(pydir, "..", "..", "..", "include") bindir = os.environ.get("BINDIR", os.path.join(os.getcwd(), "..")) +libdir = os.environ.get("LIBDIR") cpp = shlex.split(os.environ.get("CPP", "cc -E")) cppflags = shlex.split(os.environ.get("CPPFLAGS", "")) @@ -52,6 +53,7 @@ ffi.set_source("mgba._pylib", """ extra_compile_args=cppflags, libraries=["mgba"], library_dirs=[bindir], + runtime_library_dirs=[libdir], sources=[os.path.join(pydir, path) for path in ["vfs-py.c", "core.c", "log.c", "sio.c"]]) preprocessed = subprocess.check_output(cpp + ["-fno-inline", "-P"] + cppflags + [os.path.join(pydir, "_builder.h")], universal_newlines=True) diff --git a/src/platform/python/setup.py.in b/src/platform/python/setup.py.in index a66e70e3c..3546cb876 100644 --- a/src/platform/python/setup.py.in +++ b/src/platform/python/setup.py.in @@ -4,6 +4,7 @@ import os import sys os.environ["BINDIR"] = "${CMAKE_BINARY_DIR}" +os.environ["LIBDIR"] = "${CMAKE_INSTALL_PREFIX}/${LIBDIR}" os.environ["CPPFLAGS"] = " ".join([d for d in "${INCLUDE_FLAGS}".split(";") if d]) classifiers = [