This repository has been archived on 2025-06-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
raylib-python-cffi/raylib/static/build_mac.py
2019-06-05 17:09:28 +01:00

23 lines
925 B
Python

from cffi import FFI
import os
import platform
ffibuilder = FFI()
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', ''))
ffibuilder.set_source("_raylib_cffi",
"""
#include "../raylib.h" // the C header of the library, supplied by us here
"""
)
# Hack to produce static linked lib using static librarylib.a supplied by us
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_mac.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)
if platform.system()=="Darwin":
print(command)
os.system(command)