mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
23 lines
1.1 KiB
Python
23 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Build the standalone CFHost cancellation regression probe."""
|
|
from pathlib import Path
|
|
import shlex
|
|
import subprocess
|
|
|
|
project = Path(__file__).resolve().parent.parent
|
|
framework = project / 'build/darling-src/build/src/external/cfnetwork/src'
|
|
flags = {}
|
|
for line in (framework / 'CMakeFiles/CFNetwork.dir/flags.make').read_text().splitlines():
|
|
if line.startswith('C_') and ' = ' in line:
|
|
name, value = line.split(' = ', 1)
|
|
flags[name] = shlex.split(value)
|
|
name = 'riot-cfhost-cancel-check'
|
|
obj = project / ('build/' + name + '.o')
|
|
subprocess.run(['clang', *flags['C_DEFINES'], *flags['C_INCLUDES'], *flags['C_FLAGS'],
|
|
'-O2', '-Wno-macro-redefined', '-c', str(project / ('tools/' + name + '.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', '-framework', 'CFNetwork',
|
|
'-framework', 'CoreFoundation', '-framework', 'Foundation',
|
|
'-o', str(project / ('build/' + name))], check=True)
|