aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cross/iphone.txt34
-rw-r--r--environment.py2
-rw-r--r--ninjabackend.py27
3 files changed, 59 insertions, 4 deletions
diff --git a/cross/iphone.txt b/cross/iphone.txt
new file mode 100644
index 0000000..9fa4474
--- /dev/null
+++ b/cross/iphone.txt
@@ -0,0 +1,34 @@
+# This is a cross compilation file from OSX Yosemite to iPhone
+# Apple keeps changing the location and names of files so
+# these might not work for you. Use the googels and xcrun.
+
+[binaries]
+c = 'clang'
+cpp = 'clang++'
+ar = 'ar'
+strip = 'strip'
+
+[properties]
+root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'
+
+c_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk']
+cpp_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk']
+c_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk']
+cpp_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk']
+
+sizeof_int = 4
+sizeof_wchar_t = 4
+sizeof_void* = 4
+
+alignment_char = 1
+alignment_void* = 4
+alignment_double = 4 # Don't know if this is correct...
+
+has_function_printf = true
+has_function_hfkerhisadf = false
+
+[host_machine]
+system = 'ios'
+cpu = 'armv7'
+endian = 'little'
+
diff --git a/environment.py b/environment.py
index db6d5a2..41520d1 100644
--- a/environment.py
+++ b/environment.py
@@ -632,7 +632,7 @@ class CrossBuildInfo():
for i in res:
if not self.ok_type(i):
raise EnvironmentException('Malformed value in cross file variable %s.' % varname)
- self.items[varname] = res
+ self.config[s][entry] = res
else:
raise EnvironmentException('Malformed value in cross file variable %s.' % varname)
diff --git a/ninjabackend.py b/ninjabackend.py
index 8e87b13..be4277d 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -815,11 +815,17 @@ class NinjaBackend(backends.Backend):
langname == 'rust' or langname == 'cs':
continue
crstr = ''
+ cross_args = []
if is_cross:
crstr = '_CROSS'
+ try:
+ cross_args = self.environment.cross_info.config['properties'][langname + '_link_args']
+ except KeyError:
+ pass
rule = 'rule %s%s_LINKER\n' % (langname, crstr)
- command = ' command = %s $ARGS %s $in $LINK_ARGS $aliasing\n' % \
+ command = ' command = %s %s $ARGS %s $in $LINK_ARGS $aliasing\n' % \
(' '.join(compiler.get_linker_exelist()),\
+ ' '.join(cross_args),\
' '.join(compiler.get_linker_output_args('$out')))
description = ' description = Linking target $out'
outfile.write(rule)
@@ -940,8 +946,15 @@ rule FORTRAN_DEP_HACK
if d != '$out' and d != '$in':
d = qstr % d
quoted_depargs.append(d)
- command = " command = %s $ARGS %s %s %s $in\n" % \
+ cross_args = []
+ if is_cross:
+ try:
+ cross_args = self.environment.cross_info.config['properties'][langname + '_args']
+ except KeyError:
+ pass
+ command = " command = %s %s $ARGS %s %s %s $in\n" % \
(' '.join(compiler.get_exelist()),\
+ ' '.join(cross_args),
' '.join(quoted_depargs),\
' '.join(compiler.get_output_args('$out')),\
' '.join(compiler.get_compile_only_args()))
@@ -966,6 +979,13 @@ rule FORTRAN_DEP_HACK
crstr = ''
rule = 'rule %s%s_PCH\n' % (langname, crstr)
depargs = compiler.get_dependency_gen_args('$out', '$DEPFILE')
+ cross_args = []
+ if is_cross:
+ try:
+ cross_args = self.environment.cross_info.config['properties'][langname + '_args']
+ except KeyError:
+ pass
+
quoted_depargs = []
for d in depargs:
if d != '$out' and d != '$in':
@@ -975,8 +995,9 @@ rule FORTRAN_DEP_HACK
output = ''
else:
output = ' '.join(compiler.get_output_args('$out'))
- command = " command = %s $ARGS %s %s %s $in\n" % \
+ command = " command = %s %s $ARGS %s %s %s $in\n" % \
(' '.join(compiler.get_exelist()),\
+ ' '.join(cross_args),\
' '.join(quoted_depargs),\
output,\
' '.join(compiler.get_compile_only_args()))