mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 21:31:25 +00:00
build script: simplify base zdoom target
This commit is contained in:
parent
75d748df11
commit
190fe30423
1 changed files with 4 additions and 35 deletions
39
build.py
39
build.py
|
@ -355,37 +355,6 @@ class CMakeTarget(Target):
|
||||||
|
|
||||||
subprocess.check_call(args, cwd=builder.build_path, env=self.environment)
|
subprocess.check_call(args, cwd=builder.build_path, env=self.environment)
|
||||||
|
|
||||||
def _link_with_sound_libraries(self, builder: 'Builder'):
|
|
||||||
extra_libs = (
|
|
||||||
'mpg123',
|
|
||||||
|
|
||||||
# FluidSynth with dependencies
|
|
||||||
'fluidsynth',
|
|
||||||
'instpatch-1.0',
|
|
||||||
'glib-2.0',
|
|
||||||
'gobject-2.0',
|
|
||||||
'intl',
|
|
||||||
'iconv',
|
|
||||||
'ffi',
|
|
||||||
'pcre',
|
|
||||||
|
|
||||||
# Sndfile with dependencies
|
|
||||||
'sndfile',
|
|
||||||
'ogg',
|
|
||||||
'vorbis',
|
|
||||||
'vorbisenc',
|
|
||||||
'FLAC',
|
|
||||||
'opus',
|
|
||||||
)
|
|
||||||
|
|
||||||
linker_args = '-framework AudioUnit -framework AudioToolbox -framework Carbon ' \
|
|
||||||
'-framework CoreAudio -framework CoreMIDI -framework CoreVideo'
|
|
||||||
|
|
||||||
for lib in extra_libs:
|
|
||||||
linker_args += f' {builder.lib_path}lib{lib}.a'
|
|
||||||
|
|
||||||
self.options['CMAKE_EXE_LINKER_FLAGS'] = linker_args
|
|
||||||
|
|
||||||
def build(self, builder: 'Builder'):
|
def build(self, builder: 'Builder'):
|
||||||
if builder.xcode:
|
if builder.xcode:
|
||||||
# TODO: support case-sensitive file system
|
# TODO: support case-sensitive file system
|
||||||
|
@ -417,17 +386,17 @@ class ZDoomBaseTarget(CMakeTarget):
|
||||||
def __init__(self, name=None):
|
def __init__(self, name=None):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
|
|
||||||
def initialize(self, builder: 'Builder'):
|
def configure(self, builder: 'Builder'):
|
||||||
super().initialize(builder)
|
|
||||||
self._link_with_sound_libraries(builder)
|
|
||||||
|
|
||||||
opts = self.options
|
opts = self.options
|
||||||
|
opts['CMAKE_EXE_LINKER_FLAGS'] = builder.run_pkg_config('--libs', 'fluidsynth', 'libmpg123')
|
||||||
opts['PK3_QUIET_ZIPDIR'] = 'YES'
|
opts['PK3_QUIET_ZIPDIR'] = 'YES'
|
||||||
opts['DYN_OPENAL'] = 'NO'
|
opts['DYN_OPENAL'] = 'NO'
|
||||||
# Explicit OpenAL configuration to avoid selection of Apple's framework
|
# Explicit OpenAL configuration to avoid selection of Apple's framework
|
||||||
opts['OPENAL_INCLUDE_DIR'] = builder.include_path + 'AL'
|
opts['OPENAL_INCLUDE_DIR'] = builder.include_path + 'AL'
|
||||||
opts['OPENAL_LIBRARY'] = builder.lib_path + 'libopenal.a'
|
opts['OPENAL_LIBRARY'] = builder.lib_path + 'libopenal.a'
|
||||||
|
|
||||||
|
super().configure(builder)
|
||||||
|
|
||||||
|
|
||||||
class GZDoomTarget(ZDoomBaseTarget):
|
class GZDoomTarget(ZDoomBaseTarget):
|
||||||
def __init__(self, name='gzdoom'):
|
def __init__(self, name='gzdoom'):
|
||||||
|
|
Loading…
Reference in a new issue