mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-21 11:00:56 +00:00
build script: add ninja target
This commit is contained in:
parent
23522ec45d
commit
4cec1b0463
2 changed files with 23 additions and 0 deletions
23
build.py
23
build.py
|
@ -726,6 +726,28 @@ class OggTarget(ConfigureMakeStaticDependencyTarget):
|
||||||
return os.path.exists(builder.source_path + 'ogg.pc.in')
|
return os.path.exists(builder.source_path + 'ogg.pc.in')
|
||||||
|
|
||||||
|
|
||||||
|
class NinjaTarget(MakeTarget):
|
||||||
|
def __init__(self, name='ninja'):
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
def prepare_source(self, builder: 'Builder'):
|
||||||
|
builder.download_source(
|
||||||
|
'https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz',
|
||||||
|
'ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed')
|
||||||
|
|
||||||
|
def detect(self, builder: 'Builder') -> bool:
|
||||||
|
return os.path.exists(builder.source_path + 'src/ninja.cc')
|
||||||
|
|
||||||
|
def build(self, builder: 'Builder'):
|
||||||
|
args = ('python3', './configure.py', '--bootstrap', '--verbose')
|
||||||
|
subprocess.check_call(args, cwd=builder.build_path)
|
||||||
|
|
||||||
|
def post_build(self, builder: 'Builder'):
|
||||||
|
dest_path = builder.deps_path + self.name + os.sep + 'bin'
|
||||||
|
os.makedirs(dest_path, exist_ok=True)
|
||||||
|
shutil.copy(builder.build_path + self.name, dest_path)
|
||||||
|
|
||||||
|
|
||||||
class OpenALTarget(CMakeStaticDependencyTarget):
|
class OpenALTarget(CMakeStaticDependencyTarget):
|
||||||
def __init__(self, name='openal'):
|
def __init__(self, name='openal'):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
|
@ -1021,6 +1043,7 @@ class Builder(object):
|
||||||
JpegTurboTarget(),
|
JpegTurboTarget(),
|
||||||
Mpg123Target(),
|
Mpg123Target(),
|
||||||
NasmTarget(),
|
NasmTarget(),
|
||||||
|
NinjaTarget(),
|
||||||
OggTarget(),
|
OggTarget(),
|
||||||
OpenALTarget(),
|
OpenALTarget(),
|
||||||
OpusTarget(),
|
OpusTarget(),
|
||||||
|
|
BIN
deps/ninja/bin/ninja
vendored
Executable file
BIN
deps/ninja/bin/ninja
vendored
Executable file
Binary file not shown.
Loading…
Reference in a new issue