From 71c52d9ee4c2282cc9876e2c763c7d70c358a06d Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 14 Apr 2017 14:04:37 +0200 Subject: [PATCH] Use the system declared in the cross-env in the cmake_cross_file template. Cmake use the 'Windows' name to detect we are building to Windows but meson use the lowered 'windows' string. So we need to lower the system declared in the cross-env when generating the meson cross_file. --- kiwix-build.py | 4 +++- templates/cmake_cross_file.txt | 4 ++-- templates/meson_cross_file.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kiwix-build.py b/kiwix-build.py index d54923f..d8b594b 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -116,7 +116,8 @@ class TargetInfo: 'extra_libs': ['-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr90'], 'extra_cflags': ['-DWIN32'], 'host_machine': { - 'system': 'windows', + 'system': 'Windows', + 'lsystem': 'windows', 'cpu_family': 'x86', 'cpu': 'i686', 'endian': 'little' @@ -148,6 +149,7 @@ class AndroidTargetInfo(TargetInfo): 'extra_cflags': [], 'host_machine': { 'system': 'Android', + 'lsystem': 'android', 'cpu_family': self.arch, 'cpu': self.cpu, 'endian': 'little' diff --git a/templates/cmake_cross_file.txt b/templates/cmake_cross_file.txt index 75a98a0..70184cf 100644 --- a/templates/cmake_cross_file.txt +++ b/templates/cmake_cross_file.txt @@ -1,5 +1,5 @@ -SET(CMAKE_SYSTEM_NAME Windows) -SET(CMAKE_SYSTEM_PROCESSOR x86) +SET(CMAKE_SYSTEM_NAME {host_machine[system]}) +SET(CMAKE_SYSTEM_PROCESSOR {host_machine[cpu_family]}) # specify the cross compiler SET(CMAKE_C_COMPILER "{toolchain.binaries[CC]}") diff --git a/templates/meson_cross_file.txt b/templates/meson_cross_file.txt index 9ea717f..dcc66ad 100644 --- a/templates/meson_cross_file.txt +++ b/templates/meson_cross_file.txt @@ -14,5 +14,5 @@ cpp_args = {extra_cflags!r} [host_machine] cpu_family = '{host_machine[cpu_family]}' cpu = '{host_machine[cpu]}' -system = '{host_machine[system]}' +system = '{host_machine[lsystem]}' endian = '{host_machine[endian]}'