changeset 7: |
315fedf35bc7 |
author: |
ellis <ellis@rwest.io> |
date: |
Sun, 07 May 2023 18:06:13 -0400 |
permissions: |
-rw-r--r-- |
description: |
rust ffi macros, general stuff |
4 print("pip install cffi, included with PyPy") 11 def parse_header(header): 12 h = open(header, "r").read().lstrip() 14 r"^(#|\s*\/*\*|extern).*[\r\n]|.*\"C\"$|^(?:[\t ]*(?:\r?\n|\r))+", 39 def compile(ffi, lib_dir, v): 40 os.environ["LD_RUN_PATH"] = os.path.abspath(lib_dir) 41 ffi.compile(verbose=v) 44 if __name__ == "__main__": 45 build_dir = pathlib.Path(__file__).parent 46 cdef = parse_header(build_dir / "demo.h") 48 compile(init_ffi(cdef), build_dir, True)