summaryrefslogtreecommitdiff
path: root/python/build/meson.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/build/meson.py')
-rw-r--r--python/build/meson.py46
1 files changed, 21 insertions, 25 deletions
diff --git a/python/build/meson.py b/python/build/meson.py
index 377969b28..049b52251 100644
--- a/python/build/meson.py
+++ b/python/build/meson.py
@@ -34,41 +34,37 @@ def make_cross_file(toolchain):
path = os.path.join(toolchain.build_path, 'meson.cross')
os.makedirs(toolchain.build_path, exist_ok=True)
with open(path, 'w') as f:
- f.write("""
+ f.write(f"""
[binaries]
-c = '%s'
-cpp = '%s'
-ar = '%s'
-strip = '%s'
-pkgconfig = '%s'
-%s
+c = '{toolchain.cc}'
+cpp = '{toolchain.cxx}'
+ar = '{toolchain.ar}'
+strip = '{toolchain.strip}'
+pkgconfig = '{toolchain.pkg_config}'
+""")
+ if toolchain.is_windows:
+ f.write(f"windres = '{toolchain.windres}'\n")
+
+ f.write(f"""
[properties]
-root = '%s'
+root = '{toolchain.install_prefix}'
-c_args = %s
-c_link_args = %s
+c_args = {repr((toolchain.cppflags + ' ' + toolchain.cflags).split())}
+c_link_args = {repr(toolchain.ldflags.split() + toolchain.libs.split())}
-cpp_args = %s
-cpp_link_args = %s
+cpp_args = {repr((toolchain.cppflags + ' ' + toolchain.cxxflags).split())}
+cpp_link_args = {repr(toolchain.ldflags.split() + toolchain.libs.split())}
# Keep Meson from executing Android-x86 test binariees
needs_exe_wrapper = true
[host_machine]
-system = '%s'
-cpu_family = '%s'
-cpu = '%s'
-endian = '%s'
- """ % (toolchain.cc, toolchain.cxx, toolchain.ar, toolchain.strip,
- toolchain.pkg_config,
- windres,
- toolchain.install_prefix,
- repr((toolchain.cppflags + ' ' + toolchain.cflags).split()),
- repr(toolchain.ldflags.split() + toolchain.libs.split()),
- repr((toolchain.cppflags + ' ' + toolchain.cxxflags).split()),
- repr(toolchain.ldflags.split() + toolchain.libs.split()),
- system, cpu_family, cpu, endian))
+system = '{system}'
+cpu_family = '{cpu_family}'
+cpu = '{cpu}'
+endian = '{endian}'
+""")
return path
def configure(toolchain, src, build, args=()):