mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 13:21:05 +00:00
build script: support cross-compilation of zdoom based targets
This commit is contained in:
parent
0bd145ac7c
commit
328e783819
1 changed files with 20 additions and 0 deletions
20
build.py
20
build.py
|
@ -425,6 +425,10 @@ class ZDoomBaseTarget(CMakeTarget):
|
|||
def __init__(self, name=None):
|
||||
super().__init__(name)
|
||||
|
||||
def initialize(self, builder: 'Builder'):
|
||||
super().initialize(builder)
|
||||
self.prefix = builder.output_path + self.name
|
||||
|
||||
def configure(self, builder: 'Builder'):
|
||||
opts = self.options
|
||||
opts['CMAKE_EXE_LINKER_FLAGS'] = builder.run_pkg_config('--libs', 'fluidsynth', 'libmpg123')
|
||||
|
@ -434,8 +438,24 @@ class ZDoomBaseTarget(CMakeTarget):
|
|||
opts['OPENAL_INCLUDE_DIR'] = builder.include_path + 'AL'
|
||||
opts['OPENAL_LIBRARY'] = builder.lib_path + 'libopenal.a'
|
||||
|
||||
if builder.architecture() != machine():
|
||||
opts['FORCE_CROSSCOMPILE'] = 'YES'
|
||||
opts['IMPORT_EXECUTABLES'] = builder.native_build_path + 'ImportExecutables.cmake'
|
||||
|
||||
super().configure(builder)
|
||||
|
||||
def post_build(self, builder: 'Builder'):
|
||||
if builder.xcode:
|
||||
return
|
||||
|
||||
if os.path.exists(self.prefix):
|
||||
shutil.rmtree(self.prefix)
|
||||
|
||||
os.makedirs(self.prefix)
|
||||
|
||||
bundle_name = self.name + '.app'
|
||||
shutil.copytree(builder.build_path + bundle_name, self.prefix + os.sep + bundle_name)
|
||||
|
||||
|
||||
class GZDoomTarget(ZDoomBaseTarget):
|
||||
def __init__(self, name='gzdoom'):
|
||||
|
|
Loading…
Reference in a new issue