提交 82d33bbb 编写于 作者: Z Znunu

renamed shared lib

上级 507b07c2
......@@ -6,9 +6,10 @@ import sys
if __name__ == "__main__":
# Load the shared library into c types.
lib_ext = ".dll" if sys.platform.startswith("win") else ".so"
libname = pathlib.Path() / f"cmult{lib_ext}"
c_lib = ctypes.CDLL(libname.resolve().__str__())
if sys.platform.startswith("win"):
c_lib = ctypes.CDLL("cmult.dll")
else:
c_lib = ctypes.CDLL("libcmult.so")
# Sample data for our call:
x, y = 6, 2.3
......
......@@ -61,7 +61,7 @@ def build_cmult(c, path=None):
print_banner("Building C Library")
cmd = "gcc -c -Wall -Werror -fpic cmult.c -I /usr/include/python3.7"
invoke.run(cmd)
invoke.run("gcc -shared -o cmult.so cmult.o")
invoke.run("gcc -shared -o libcmult.so cmult.o")
print("* Complete")
......@@ -113,11 +113,7 @@ def build_cffi(c):
def test_cffi(c):
""" Run the script to test CFFI """
print_banner("Testing CFFI Module")
# pty and python3 didn't work for me (win).
if on_win:
invoke.run("python cffi_test.py")
else:
invoke.run("python3 cffi_test.py", pty=True)
invoke.run("python cffi_test.py", pty=not on_win)
@invoke.task()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册