mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 05:11:49 +00:00
build script: finalize cross-compilation of prboom+
This commit is contained in:
parent
a22a30abc0
commit
e7abec9759
1 changed files with 11 additions and 3 deletions
14
build.py
14
build.py
|
@ -484,6 +484,14 @@ class CMakeOutputTarget(CMakeTarget):
|
||||||
copy_func = shutil.copytree if os.path.isdir(src) else shutil.copy
|
copy_func = shutil.copytree if os.path.isdir(src) else shutil.copy
|
||||||
copy_func(src, dst)
|
copy_func(src, dst)
|
||||||
|
|
||||||
|
def _force_cross_compilation(self, builder: 'Builder'):
|
||||||
|
if builder.architecture() == machine():
|
||||||
|
return
|
||||||
|
|
||||||
|
opts = self.options
|
||||||
|
opts['FORCE_CROSSCOMPILE'] = 'YES'
|
||||||
|
opts['IMPORT_EXECUTABLES'] = builder.native_build_path + 'ImportExecutables.cmake'
|
||||||
|
|
||||||
|
|
||||||
class ZDoomBaseTarget(CMakeOutputTarget):
|
class ZDoomBaseTarget(CMakeOutputTarget):
|
||||||
def __init__(self, name=None):
|
def __init__(self, name=None):
|
||||||
|
@ -498,9 +506,7 @@ class ZDoomBaseTarget(CMakeOutputTarget):
|
||||||
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'
|
||||||
|
|
||||||
if builder.architecture() != machine():
|
self._force_cross_compilation(builder)
|
||||||
opts['FORCE_CROSSCOMPILE'] = 'YES'
|
|
||||||
opts['IMPORT_EXECUTABLES'] = builder.native_build_path + 'ImportExecutables.cmake'
|
|
||||||
|
|
||||||
super().configure(builder)
|
super().configure(builder)
|
||||||
|
|
||||||
|
@ -590,6 +596,8 @@ class PrBoomPlusTarget(CMakeOutputTarget):
|
||||||
opts['CMAKE_EXE_LINKER_FLAGS'] = builder.run_pkg_config('--libs', 'SDL2_mixer', 'SDL2_image')
|
opts['CMAKE_EXE_LINKER_FLAGS'] = builder.run_pkg_config('--libs', 'SDL2_mixer', 'SDL2_image')
|
||||||
opts['CMAKE_POLICY_DEFAULT_CMP0056'] = 'NEW'
|
opts['CMAKE_POLICY_DEFAULT_CMP0056'] = 'NEW'
|
||||||
|
|
||||||
|
self._force_cross_compilation(builder)
|
||||||
|
|
||||||
super().configure(builder)
|
super().configure(builder)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue