mirror of https://github.com/mgba-emu/mgba.git
Python: Don't bake rpath into executable
This commit is contained in:
parent
65a7233d5f
commit
bbb74a47a1
|
@ -40,7 +40,15 @@ add_custom_target(${BINARY_NAME}-py ALL
|
|||
|
||||
file(GLOB TESTS ${CMAKE_CURRENT_SOURCE_DIR}/test_*.py)
|
||||
foreach(TEST IN LISTS TESTS)
|
||||
if(APPLE)
|
||||
set(PATH DYLD_LIBRARY_PATH)
|
||||
elseif(WIN32)
|
||||
set(PATH PATH)
|
||||
else()
|
||||
set(PATH LD_LIBRARY_PATH)
|
||||
endif()
|
||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/test_" "" TEST_NAME "${TEST}")
|
||||
string(REPLACE ".py" "" TEST_NAME "${TEST_NAME}")
|
||||
add_test(python-${TEST_NAME} ${PYTHON} ${CMAKE_CURRENT_BINARY_DIR}/setup.py pytest --addopts ${TEST})
|
||||
set_tests_properties(python-${TEST_NAME} PROPERTIES ${PATH} "${BINDIR}")
|
||||
endforeach()
|
||||
|
|
|
@ -12,11 +12,8 @@ bindir = os.environ.get("BINDIR", os.path.join(os.getcwd(), ".."))
|
|||
|
||||
cpp = shlex.split(os.environ.get("CPP", "cc -E"))
|
||||
cppflags = shlex.split(os.environ.get("CPPFLAGS", ""))
|
||||
ldflags = shlex.split(os.environ.get("LDFLAGS", ""))
|
||||
if __name__ == "__main__":
|
||||
cppflags.extend(sys.argv[1:])
|
||||
if sys.platform == 'darwin':
|
||||
ldflags.append('-Wl,-rpath,' + bindir)
|
||||
cppflags.extend(["-I" + incdir, "-I" + srcdir, "-I" + bindir])
|
||||
|
||||
ffi.set_source("mgba._pylib", """
|
||||
|
@ -49,7 +46,6 @@ ffi.set_source("mgba._pylib", """
|
|||
#undef PYEXPORT
|
||||
""", include_dirs=[incdir, srcdir],
|
||||
extra_compile_args=cppflags,
|
||||
extra_link_args=ldflags,
|
||||
libraries=["mgba"],
|
||||
library_dirs=[bindir],
|
||||
sources=[os.path.join(pydir, path) for path in ["vfs-py.c", "core.c", "log.c", "sio.c"]])
|
||||
|
|
Loading…
Reference in New Issue