mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-23 20:00:54 +00:00
wip
This commit is contained in:
parent
d42667dd35
commit
844ffaefa5
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
|
||||
matrix:
|
||||
target:
|
||||
- GZDoom
|
||||
- Raze
|
||||
- PrBoom-Plus
|
||||
- glib
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -25,10 +23,6 @@ jobs:
|
|||
run: |
|
||||
./build.py --target ${{ matrix.target }}
|
||||
|
||||
- name: Generate Xcode project
|
||||
run: |
|
||||
./build.py --target ${{ matrix.target }} --xcode
|
||||
|
||||
- name: List Build Directory
|
||||
if: always()
|
||||
shell: bash
|
||||
|
|
|
@ -509,3 +509,55 @@ class SingleExeCTarget(MakeTarget):
|
|||
|
||||
def post_build(self, state: BuildState):
|
||||
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')
|
||||
|
|
|
@ -135,7 +135,7 @@ class GettextTarget(base.ConfigureMakeStaticDependencyTarget):
|
|||
super().configure(state)
|
||||
|
||||
|
||||
class GlibTarget(base.BuildTarget):
|
||||
class GlibTarget(base.MesonTarget):
|
||||
def __init__(self, name='glib'):
|
||||
super().__init__(name)
|
||||
|
||||
|
@ -149,54 +149,13 @@ class GlibTarget(base.BuildTarget):
|
|||
return state.has_source_file('glib.doap')
|
||||
|
||||
def configure(self, state: BuildState):
|
||||
super().configure(state)
|
||||
|
||||
environment = state.environment
|
||||
environment['LDFLAGS'] += ' -framework CoreFoundation -framework Foundation'
|
||||
|
||||
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=environment)
|
||||
|
||||
def build(self, state: BuildState):
|
||||
args = ('ninja',)
|
||||
subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)
|
||||
super().configure(state)
|
||||
|
||||
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')
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue