mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-16 16:41:42 +00:00
build script: add custom processing for .pc files
This commit is contained in:
parent
b03364a4b1
commit
bf75756d5d
1 changed files with 8 additions and 1 deletions
9
build.py
9
build.py
|
@ -31,6 +31,7 @@ import os
|
|||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import typing
|
||||
import urllib.request
|
||||
import zipapp
|
||||
|
||||
|
@ -141,7 +142,7 @@ class Target(BaseTarget):
|
|||
self.update_pc_files(builder)
|
||||
|
||||
@staticmethod
|
||||
def update_pc_file(path: str, extra_libs: str = None):
|
||||
def update_pc_file(path: str, extra_libs: str = None, processor: typing.Callable = None):
|
||||
with open(path, 'r') as f:
|
||||
content = f.readlines()
|
||||
|
||||
|
@ -159,6 +160,12 @@ class Target(BaseTarget):
|
|||
if extra_libs not in line:
|
||||
patched_line = line.rstrip('\n') + ' ' + extra_libs + os.linesep
|
||||
|
||||
if processor:
|
||||
patched_line = processor(patched_line)
|
||||
|
||||
if not patched_line:
|
||||
continue
|
||||
|
||||
patched_content.append(patched_line)
|
||||
|
||||
with open(path, 'w') as f:
|
||||
|
|
Loading…
Reference in a new issue