mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 21:31:25 +00:00
build script: generalize cross-compilation with cmake
This commit is contained in:
parent
0099490350
commit
6241664404
1 changed files with 6 additions and 10 deletions
16
build.py
16
build.py
|
@ -408,6 +408,12 @@ class CMakeTarget(Target):
|
||||||
'-DCMAKE_PREFIX_PATH=' + builder.prefix_path,
|
'-DCMAKE_PREFIX_PATH=' + builder.prefix_path,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if not builder.xcode:
|
||||||
|
architecture = builder.architecture()
|
||||||
|
if architecture != machine():
|
||||||
|
args.append('-DCMAKE_SYSTEM_NAME=Darwin')
|
||||||
|
args.append('-DCMAKE_SYSTEM_PROCESSOR=' + 'aarch64' if architecture == 'arm64' else architecture)
|
||||||
|
|
||||||
os_version = builder.os_version()
|
os_version = builder.os_version()
|
||||||
if os_version:
|
if os_version:
|
||||||
args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=' + os_version)
|
args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=' + os_version)
|
||||||
|
@ -982,16 +988,6 @@ class JpegTurboTarget(CMakeStaticDependencyTarget):
|
||||||
'https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6.tar.gz',
|
'https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6.tar.gz',
|
||||||
'd74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb')
|
'd74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb')
|
||||||
|
|
||||||
def configure(self, builder: 'Builder'):
|
|
||||||
architecture = builder.architecture()
|
|
||||||
|
|
||||||
if architecture != machine():
|
|
||||||
opts = self.options
|
|
||||||
opts['CMAKE_SYSTEM_NAME'] = 'Darwin'
|
|
||||||
opts['CMAKE_SYSTEM_PROCESSOR'] = 'aarch64' if architecture == 'arm64' else architecture
|
|
||||||
|
|
||||||
super().configure(builder)
|
|
||||||
|
|
||||||
def detect(self, builder: 'Builder') -> bool:
|
def detect(self, builder: 'Builder') -> bool:
|
||||||
return os.path.exists(builder.source_path + 'turbojpeg.h')
|
return os.path.exists(builder.source_path + 'turbojpeg.h')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue