mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-01-21 07:30:47 +00:00
build script: simplify quakespasm target
This commit is contained in:
parent
95b45db335
commit
3209ba2639
1 changed files with 6 additions and 28 deletions
34
build.py
34
build.py
|
@ -565,15 +565,6 @@ class QuakespasmTarget(MakeTarget):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
self.src_root = 'Quake'
|
self.src_root = 'Quake'
|
||||||
|
|
||||||
def prepare_source(self, builder: 'Builder'):
|
|
||||||
builder.checkout_git('https://git.code.sf.net/p/quakespasm/quakespasm')
|
|
||||||
|
|
||||||
def detect(self, builder: 'Builder') -> bool:
|
|
||||||
return os.path.exists(builder.source_path + os.sep + 'Quakespasm.txt')
|
|
||||||
|
|
||||||
def initialize(self, builder: 'Builder'):
|
|
||||||
super().initialize(builder)
|
|
||||||
|
|
||||||
# TODO: Use macOS specific Makefile which requires manual application bundle creation
|
# TODO: Use macOS specific Makefile which requires manual application bundle creation
|
||||||
opts = self.options
|
opts = self.options
|
||||||
opts['USE_SDL2'] = '1'
|
opts['USE_SDL2'] = '1'
|
||||||
|
@ -581,27 +572,14 @@ class QuakespasmTarget(MakeTarget):
|
||||||
opts['USE_CODEC_OPUS'] = '1'
|
opts['USE_CODEC_OPUS'] = '1'
|
||||||
opts['USE_CODEC_MIKMOD'] = '1'
|
opts['USE_CODEC_MIKMOD'] = '1'
|
||||||
opts['USE_CODEC_UMX'] = '1'
|
opts['USE_CODEC_UMX'] = '1'
|
||||||
# TODO: Setup sdl2-config
|
# Add main() alias to workaround executable linking without macOS launcher
|
||||||
opts['SDL_CFLAGS'] = f'-I{builder.include_path}SDL2'
|
opts['COMMON_LIBS'] = '-framework OpenGL -Wl,-alias -Wl,_SDL_main -Wl,_main'
|
||||||
opts['SDL_LIBS'] = f'{builder.lib_path}libSDL2.a'
|
|
||||||
opts['COMMON_LIBS'] = '-framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio' \
|
|
||||||
' -framework CoreVideo -framework ForceFeedback -framework IOKit -framework OpenGL'
|
|
||||||
|
|
||||||
self._update_env('CFLAGS', f'-I{builder.include_path}opus')
|
def prepare_source(self, builder: 'Builder'):
|
||||||
# Use main() alias to workaround executable linking without macOS launcher
|
builder.checkout_git('https://git.code.sf.net/p/quakespasm/quakespasm')
|
||||||
self._update_env('LDFLAGS', f'-Wl,-alias -Wl,_SDL_main -Wl,_main')
|
|
||||||
|
|
||||||
for name in ('opus', 'opusfile'):
|
def detect(self, builder: 'Builder') -> bool:
|
||||||
self._update_env('LDFLAGS', f'{builder.lib_path}lib{name}.a')
|
return os.path.exists(builder.source_path + os.sep + 'Quakespasm.txt')
|
||||||
|
|
||||||
# TODO: Specify full paths for remaining libraries
|
|
||||||
|
|
||||||
def configure(self, builder: 'Builder'):
|
|
||||||
super().configure(builder)
|
|
||||||
|
|
||||||
# Copy linker flags from environment to command line argument, they would be overridden by Makefile otherwise
|
|
||||||
ldflags = 'LDFLAGS'
|
|
||||||
self.options[ldflags] = self.environment[ldflags]
|
|
||||||
|
|
||||||
|
|
||||||
class Bzip2Target(MakeTarget):
|
class Bzip2Target(MakeTarget):
|
||||||
|
|
Loading…
Reference in a new issue