This commit is contained in:
Richard Smith 2019-05-21 12:00:23 +01:00
parent 4a03e72208
commit 45ff40d510
3 changed files with 9 additions and 2253 deletions

View file

@ -1,15 +1,12 @@
from cffi import FFI
import os
import platform
ffibuilder = FFI()
# cdef() expects a single string declaring the C types, functions and
# globals needed to use the shared object. It must be in valid C syntax.
ffibuilder.cdef(open("raylib_modified.h").read().replace('RLAPI ', ''))
# set_source() gives the name of the python extension module to
# produce, and some C source code as a string. This C code needs
# to make the declarated functions, types and globals available,
# so it is often just the "#include".
ffibuilder.set_source("_raylib_cffi",
"""
#include "raylib.h" // the C header of the library
@ -21,6 +18,11 @@ ffibuilder.set_source("_raylib_cffi",
#libraries=['raylib']
)
# Hack to produce static linked lib
command = "clang -bundle -undefined dynamic_lookup ./_raylib_cffi.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib libraylib.a -F/System/Library/Frameworks -framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo -o ./_raylib_cffi.cpython-37m-darwin.so"
if __name__ == "__main__":
ffibuilder.compile(verbose=True)
os.system("clang -bundle -undefined dynamic_lookup ./_raylib_cffi.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib libraylib.a -F/System/Library/Frameworks -framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo -o ./_raylib_cffi.cpython-37m-darwin.so")
if platform.system()=="Darwin":
print(command)
os.system(command)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff