Skip to content

Commit

Permalink
Use a specific cross_file on iOS cross compilation.
Browse files Browse the repository at this point in the history
We need to set the property `needs_exe_wrapper` to true for
x86_64 cross compilation.

Else, meson will try to detect if we could run the cross
compiled executable, and because it is the same arch, it will
assume we can. So it will try to sanity check and execute the
cross compiled binary. Then fails.
  • Loading branch information
mgautierfr committed Feb 21, 2020
1 parent 1d290e0 commit 2938927
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kiwixbuild/platforms/ios.py
Expand Up @@ -28,7 +28,7 @@ def __str__(self):
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_ios_cross_file.txt')
self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
self.buildEnv.meson_crossfile = self._gen_crossfile('meson_ios_cross_file.txt')

def get_cross_config(self):
return {
Expand Down
21 changes: 21 additions & 0 deletions kiwixbuild/templates/meson_ios_cross_file.txt
@@ -0,0 +1,21 @@
[binaries]
pkgconfig = '{binaries[PKGCONFIG]}'
c = '{binaries[CC]}'
ar = '{binaries[AR]}'
cpp = '{binaries[CXX]}'
strip = '{binaries[STRIP]}'
ranlib = '{binaries[RANLIB]}'
{exe_wrapper_def}

[properties]
c_link_args = {extra_libs!r}
cpp_link_args = {extra_libs!r}
c_args = {extra_cflags!r}
cpp_args = {extra_cflags!r}
needs_exe_wrapper = true

[host_machine]
cpu_family = '{host_machine[cpu_family]}'
cpu = '{host_machine[cpu]}'
system = '{host_machine[lsystem]}'
endian = '{host_machine[endian]}'

0 comments on commit 2938927

Please sign in to comment.