From 6a24b3816987146580a45257e4a863f5b651e54d Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 11 Apr 2017 16:57:51 +0200 Subject: [PATCH] Add WIN32 flag definition. When switching to c++11, the WIN32 flags is no more automatically defined. So let's define it in the meson crossfile itself. --- kiwix-build.py | 4 ++++ templates/meson_cross_file.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/kiwix-build.py b/kiwix-build.py index e8d6e11..5f7c08e 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -29,6 +29,7 @@ CROSS_ENV = { 'toolchain_names': ['mingw32_toolchain'], 'root_path': '/usr/i686-w64-mingw32/sys-root/mingw', 'extra_libs': ['-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr90'], + 'extra_cflags': ['-DWIN32'], 'host_machine': { 'system': 'windows', 'cpu_family': 'x86', @@ -39,6 +40,7 @@ CROSS_ENV = { 'fedora_android': { 'toolchain_names': ['android_ndk'], 'extra_libs': [], + 'extra_cflags': [], 'host_machine': { 'system': 'Android', 'cpu_family': 'x86', @@ -50,6 +52,7 @@ CROSS_ENV = { 'toolchain_names': ['mingw32_toolchain'], 'root_path': '/usr/i686-w64-mingw32/', 'extra_libs': ['-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr90'], + 'extra_cflags': ['-DWIN32'], 'host_machine': { 'system': 'windows', 'cpu_family': 'x86', @@ -60,6 +63,7 @@ CROSS_ENV = { 'debian_android': { 'toolchain_names': ['android_ndk'], 'extra_libs': [], + 'extra_cflags': [], 'host_machine': { 'system': 'Android', 'cpu_family': 'x86', diff --git a/templates/meson_cross_file.txt b/templates/meson_cross_file.txt index 6edddf4..9ea717f 100644 --- a/templates/meson_cross_file.txt +++ b/templates/meson_cross_file.txt @@ -8,6 +8,8 @@ strip = '{toolchain.binaries[STRIP]}' [properties] c_link_args = {extra_libs!r} cpp_link_args = {extra_libs!r} +c_args = {extra_cflags!r} +cpp_args = {extra_cflags!r} [host_machine] cpu_family = '{host_machine[cpu_family]}'