Move ios sdk in toolchains module.
This commit is contained in:
parent
363bdf74ed
commit
ac83dec674
|
@ -132,11 +132,6 @@ PACKAGE_NAME_MAPPERS = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def xrun_find(name):
|
|
||||||
command = "xcrun -find {}".format(name)
|
|
||||||
output = subprocess.check_output(command, shell=True)
|
|
||||||
return output[:-1].decode()
|
|
||||||
|
|
||||||
class BuildEnv:
|
class BuildEnv:
|
||||||
def __init__(self, options, targetsDict):
|
def __init__(self, options, targetsDict):
|
||||||
self.source_dir = pj(options.working_dir, "SOURCE")
|
self.source_dir = pj(options.working_dir, "SOURCE")
|
||||||
|
@ -445,41 +440,6 @@ class BuildEnv:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class iOS_sdk(Toolchain):
|
|
||||||
@property
|
|
||||||
def root_path(self):
|
|
||||||
return self.buildEnv.platform_info.root_path
|
|
||||||
|
|
||||||
@property
|
|
||||||
def binaries(self):
|
|
||||||
return {
|
|
||||||
'CC': xrun_find('clang'),
|
|
||||||
'CXX': xrun_find('clang++'),
|
|
||||||
'AR': '/usr/bin/ar',
|
|
||||||
'STRIP': '/usr/bin/strip',
|
|
||||||
'RANLIB': '/usr/bin/ranlib',
|
|
||||||
'LD': '/usr/bin/ld',
|
|
||||||
}
|
|
||||||
|
|
||||||
@property
|
|
||||||
def configure_option(self):
|
|
||||||
return '--host=arm-apple-darwin'
|
|
||||||
|
|
||||||
def get_bin_dir(self):
|
|
||||||
return [pj(self.root_path, 'bin')]
|
|
||||||
|
|
||||||
def set_env(self, env):
|
|
||||||
arch = self.buildEnv.platform_info.arch
|
|
||||||
env['CFLAGS'] = " -fembed-bitcode -isysroot {SDKROOT} -arch {arch} -miphoneos-version-min=9.0 ".format(SDKROOT=self.root_path, arch=arch) + env['CFLAGS']
|
|
||||||
env['CXXFLAGS'] = env['CFLAGS'] + " -stdlib=libc++ -std=c++11 "+env['CXXFLAGS']
|
|
||||||
env['LDFLAGS'] = " -arch {arch} -isysroot {SDKROOT} ".format(SDKROOT=self.root_path, arch=arch)
|
|
||||||
env['MACOSX_DEPLOYMENT_TARGET'] = "10.7"
|
|
||||||
|
|
||||||
def set_compiler(self, env):
|
|
||||||
env['CC'] = self.binaries['CC']
|
|
||||||
env['CXX'] = self.binaries['CXX']
|
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
self.options = options
|
self.options = options
|
||||||
|
|
|
@ -1,4 +1,37 @@
|
||||||
from .base_toolchain import Toolchain
|
from .base_toolchain import Toolchain
|
||||||
|
|
||||||
|
from kiwixbuild.utils import pj, xrun_find
|
||||||
|
|
||||||
class iOS_sdk(Toolchain):
|
class iOS_sdk(Toolchain):
|
||||||
pass
|
@property
|
||||||
|
def root_path(self):
|
||||||
|
return self.buildEnv.platform_info.root_path
|
||||||
|
|
||||||
|
@property
|
||||||
|
def binaries(self):
|
||||||
|
return {
|
||||||
|
'CC': xrun_find('clang'),
|
||||||
|
'CXX': xrun_find('clang++'),
|
||||||
|
'AR': '/usr/bin/ar',
|
||||||
|
'STRIP': '/usr/bin/strip',
|
||||||
|
'RANLIB': '/usr/bin/ranlib',
|
||||||
|
'LD': '/usr/bin/ld',
|
||||||
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def configure_option(self):
|
||||||
|
return '--host=arm-apple-darwin'
|
||||||
|
|
||||||
|
def get_bin_dir(self):
|
||||||
|
return [pj(self.root_path, 'bin')]
|
||||||
|
|
||||||
|
def set_env(self, env):
|
||||||
|
arch = self.buildEnv.platform_info.arch
|
||||||
|
env['CFLAGS'] = " -fembed-bitcode -isysroot {SDKROOT} -arch {arch} -miphoneos-version-min=9.0 ".format(SDKROOT=self.root_path, arch=arch) + env['CFLAGS']
|
||||||
|
env['CXXFLAGS'] = env['CFLAGS'] + " -stdlib=libc++ -std=c++11 "+env['CXXFLAGS']
|
||||||
|
env['LDFLAGS'] = " -arch {arch} -isysroot {SDKROOT} ".format(SDKROOT=self.root_path, arch=arch)
|
||||||
|
env['MACOSX_DEPLOYMENT_TARGET'] = "10.7"
|
||||||
|
|
||||||
|
def set_compiler(self, env):
|
||||||
|
env['CC'] = self.binaries['CC']
|
||||||
|
env['CXX'] = self.binaries['CXX']
|
||||||
|
|
|
@ -21,6 +21,11 @@ def which(name):
|
||||||
output = subprocess.check_output(command, shell=True)
|
output = subprocess.check_output(command, shell=True)
|
||||||
return output[:-1].decode()
|
return output[:-1].decode()
|
||||||
|
|
||||||
|
def xrun_find(name):
|
||||||
|
command = "xcrun -find {}".format(name)
|
||||||
|
output = subprocess.check_output(command, shell=True)
|
||||||
|
return output[:-1].decode()
|
||||||
|
|
||||||
|
|
||||||
def setup_print_progress(print_progress):
|
def setup_print_progress(print_progress):
|
||||||
global g_print_progress
|
global g_print_progress
|
||||||
|
|
Loading…
Reference in New Issue