mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-27 19:54:38 +00:00
14 lines
994 B
Python
14 lines
994 B
Python
#!/usr/bin/env python3
|
|
from pathlib import Path
|
|
import shlex, subprocess
|
|
root=Path(__file__).resolve().parent.parent
|
|
import re
|
|
res=subprocess.check_output(['clang','-print-resource-dir'],text=True).strip()
|
|
flags={}
|
|
for line in (root/'build/darling-src/build/src/frameworks/CoreVideo/CMakeFiles/CoreVideo.dir/flags.make').read_text().splitlines():
|
|
if line.startswith('C_') and ' = ' in line:
|
|
key,value=line.split(' = ',1); flags[key]=[re.sub(r'/usr/lib/clang/\d+/include',res+'/include',v) for v in shlex.split(value)]
|
|
obj=root/'build/riot-local-region-check.o'
|
|
subprocess.run(['clang',*flags['C_DEFINES'],*flags['C_INCLUDES'],*flags['C_FLAGS'],'-I'+str(root/'build/darling-src/src/startup/mldr/elfcalls'),'-O2','-c',str(root/'tools/riot-local-region-check.c'),'-o',str(obj)],check=True)
|
|
subprocess.run(['clang','-target','x86_64-apple-macosx11.0','-fuse-ld=lld','-nostdlib','-isysroot','@DARLING_SDK@',str(obj),'-lSystem','-o',str(root/'build/riot-local-region-check')],check=True)
|