mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-27 19:54:38 +00:00
23 lines
1.1 KiB
Python
23 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Build the CoreGraphics display and cursor compatibility override."""
|
|
from pathlib import Path
|
|
import shlex
|
|
import subprocess
|
|
root = Path(__file__).resolve().parent.parent
|
|
folder = root / 'build/darling-src/build/src/external/cocotron/CoreGraphics'
|
|
flags = {}
|
|
for line in (folder / 'CMakeFiles/CoreGraphics.dir/flags.make').read_text().splitlines():
|
|
if line.startswith('C_') and ' = ' in line:
|
|
key, value = line.split(' = ', 1)
|
|
flags[key] = shlex.split(value)
|
|
link = shlex.split((folder / 'CMakeFiles/CoreGraphics.dir/link.txt').read_text())
|
|
for name in ('CGDirectDisplay', 'CGSubWindow'):
|
|
obj = root / f'build/riot-{name}.o'
|
|
subprocess.run(['clang', *flags['C_DEFINES'], *flags['C_INCLUDES'], *flags['C_FLAGS'],
|
|
'-O2', '-Wno-macro-redefined', '-c',
|
|
str(root / f'build/darling-src/src/external/cocotron/CoreGraphics/{name}.m'),
|
|
'-o', str(obj)], check=True)
|
|
link[link.index(f'CMakeFiles/CoreGraphics.dir/{name}.m.o')] = str(obj)
|
|
link[link.index('-o') + 1] = str(root / 'build/riot-CoreGraphics')
|
|
subprocess.run(link, cwd=folder, check=True)
|