Move ios sdk in toolchains module.

This commit is contained in:
Matthieu Gautier 2018-05-21 19:35:39 +02:00
parent 363bdf74ed
commit ac83dec674
3 changed files with 39 additions and 41 deletions

View File

@ -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:
def __init__(self, options, targetsDict):
self.source_dir = pj(options.working_dir, "SOURCE")
@ -445,41 +440,6 @@ class BuildEnv:
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:
def __init__(self, options):
self.options = options

View File

@ -1,4 +1,37 @@
from .base_toolchain import Toolchain
from kiwixbuild.utils import pj, xrun_find
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']

View File

@ -21,6 +21,11 @@ def which(name):
output = subprocess.check_output(command, shell=True)
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):
global g_print_progress