mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-27 05:30:50 +00:00
wip
[skip test]
This commit is contained in:
parent
3fa275aaf0
commit
6271f75898
3 changed files with 56 additions and 51 deletions
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
@ -14,9 +14,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- GZDoom
|
- glib
|
||||||
- Raze
|
|
||||||
- PrBoom-Plus
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -25,10 +23,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
./build.py --target ${{ matrix.target }}
|
./build.py --target ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Generate Xcode project
|
|
||||||
run: |
|
|
||||||
./build.py --target ${{ matrix.target }} --xcode
|
|
||||||
|
|
||||||
- name: List Build Directory
|
- name: List Build Directory
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -502,3 +502,55 @@ class SingleExeCTarget(MakeTarget):
|
||||||
|
|
||||||
def post_build(self, state: BuildState):
|
def post_build(self, state: BuildState):
|
||||||
self.copy_to_bin(state)
|
self.copy_to_bin(state)
|
||||||
|
|
||||||
|
|
||||||
|
class MesonTarget(BuildTarget):
|
||||||
|
def __init__(self, name=None):
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
def configure(self, state: BuildState):
|
||||||
|
super().configure(state)
|
||||||
|
|
||||||
|
c_compiler = state.c_compiler()
|
||||||
|
assert c_compiler
|
||||||
|
|
||||||
|
cxx_compiler = state.cxx_compiler()
|
||||||
|
assert cxx_compiler
|
||||||
|
|
||||||
|
cpu = state.architecture()
|
||||||
|
cpu_family = 'arm' if 'arm64' == cpu else cpu
|
||||||
|
|
||||||
|
cross_file = state.build_path / (state.architecture() + '.txt')
|
||||||
|
with open(cross_file, 'w') as f:
|
||||||
|
f.write(f'''
|
||||||
|
[binaries]
|
||||||
|
c = '{c_compiler}'
|
||||||
|
cpp = '{cxx_compiler}'
|
||||||
|
objc = '{c_compiler}'
|
||||||
|
objcpp = '{cxx_compiler}'
|
||||||
|
pkgconfig = '{state.prefix_path}/bin/pkg-config'
|
||||||
|
strip = '/usr/bin/strip'
|
||||||
|
|
||||||
|
[host_machine]
|
||||||
|
system = 'darwin'
|
||||||
|
cpu_family = '{cpu_family}'
|
||||||
|
cpu = '{cpu}'
|
||||||
|
endian = 'little'
|
||||||
|
''')
|
||||||
|
|
||||||
|
args = (
|
||||||
|
state.bin_path / 'meson',
|
||||||
|
f'--prefix={state.install_path}',
|
||||||
|
'--buildtype=release',
|
||||||
|
'--default-library=static',
|
||||||
|
f'--cross-file={cross_file}',
|
||||||
|
state.source
|
||||||
|
)
|
||||||
|
subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)
|
||||||
|
|
||||||
|
def build(self, state: BuildState):
|
||||||
|
args = ('ninja',)
|
||||||
|
subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)
|
||||||
|
|
||||||
|
def post_build(self, state: BuildState):
|
||||||
|
self.install(state, tool='ninja')
|
||||||
|
|
|
@ -136,7 +136,7 @@ class GettextTarget(base.ConfigureMakeStaticDependencyTarget):
|
||||||
super().configure(state)
|
super().configure(state)
|
||||||
|
|
||||||
|
|
||||||
class GlibTarget(base.BuildTarget):
|
class GlibTarget(base.MesonTarget):
|
||||||
def __init__(self, name='glib'):
|
def __init__(self, name='glib'):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
|
|
||||||
|
@ -150,54 +150,13 @@ class GlibTarget(base.BuildTarget):
|
||||||
return state.has_source_file('glib.doap')
|
return state.has_source_file('glib.doap')
|
||||||
|
|
||||||
def configure(self, state: BuildState):
|
def configure(self, state: BuildState):
|
||||||
super().configure(state)
|
|
||||||
|
|
||||||
environment = state.environment
|
environment = state.environment
|
||||||
environment['LDFLAGS'] += ' -framework CoreFoundation -framework Foundation'
|
environment['LDFLAGS'] += ' -framework CoreFoundation -framework Foundation'
|
||||||
|
|
||||||
c_compiler = state.c_compiler()
|
super().configure(state)
|
||||||
assert c_compiler
|
|
||||||
|
|
||||||
cxx_compiler = state.cxx_compiler()
|
|
||||||
assert cxx_compiler
|
|
||||||
|
|
||||||
cpu = state.architecture()
|
|
||||||
cpu_family = 'arm' if 'arm64' == cpu else cpu
|
|
||||||
|
|
||||||
cross_file = state.build_path / (state.architecture() + '.txt')
|
|
||||||
with open(cross_file, 'w') as f:
|
|
||||||
f.write(f'''
|
|
||||||
[binaries]
|
|
||||||
c = '{c_compiler}'
|
|
||||||
cpp = '{cxx_compiler}'
|
|
||||||
objc = '{c_compiler}'
|
|
||||||
objcpp = '{cxx_compiler}'
|
|
||||||
pkgconfig = '{state.prefix_path}/bin/pkg-config'
|
|
||||||
strip = '/usr/bin/strip'
|
|
||||||
|
|
||||||
[host_machine]
|
|
||||||
system = 'darwin'
|
|
||||||
cpu_family = '{cpu_family}'
|
|
||||||
cpu = '{cpu}'
|
|
||||||
endian = 'little'
|
|
||||||
''')
|
|
||||||
|
|
||||||
args = (
|
|
||||||
state.bin_path / 'meson',
|
|
||||||
f'--prefix={state.install_path}',
|
|
||||||
'--buildtype=release',
|
|
||||||
'--default-library=static',
|
|
||||||
f'--cross-file={cross_file}',
|
|
||||||
state.source
|
|
||||||
)
|
|
||||||
subprocess.run(args, check=True, cwd=state.build_path, env=environment)
|
|
||||||
|
|
||||||
def build(self, state: BuildState):
|
|
||||||
args = ('ninja',)
|
|
||||||
subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)
|
|
||||||
|
|
||||||
def post_build(self, state: BuildState):
|
def post_build(self, state: BuildState):
|
||||||
self.install(state, tool='ninja')
|
super().post_build(state)
|
||||||
self.make_platform_header(state, '../lib/glib-2.0/include/glibconfig.h')
|
self.make_platform_header(state, '../lib/glib-2.0/include/glibconfig.h')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue