From 9a1b5deeef8d8ce6895be86da867eadfe1db4d7a Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 12 Sep 2021 13:07:11 +0300 Subject: [PATCH] fix: meson.build --- meson.build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index cdccb4d..15a65f2 100644 --- a/meson.build +++ b/meson.build @@ -24,7 +24,8 @@ project ( 'default_library=static', 'cpp_eh=none', 'b_vscrt=static_from_buildtype', - 'b_lto=true' + 'b_lto=true', + 'b_lundef=false', ], meson_version: '>=0.56.0') @@ -34,7 +35,7 @@ find_program ('hostname', required: true) cpp = meson.get_compiler ('cpp') sys = host_machine.system () -target = host_machine.cpu_family () +target = build_machine.cpu_family () version = meson.project_version () count = run_command ('git', 'rev-list', '--count', 'HEAD').stdout ().strip () @@ -96,7 +97,7 @@ if clang or gcc if optmize if (clang or gcc) and not mac - if not aarch64 + if not aarch64 and not (clang and win32) ccflags += [ '-fdata-sections', '-ffunction-sections' @@ -108,7 +109,7 @@ if clang or gcc ldflags += '-flto-partition=none' endif - if not aarch64 + if not aarch64 and not (clang and win32) ldflags += [ '-Wl,--version-script=../ldscript.lds', '-Wl,--gc-sections' @@ -219,6 +220,11 @@ elif win32 and (clang or gcc) '-luser32', '-lws2_32' ] + + if clang + ldflags += '-Wl,/MACHINE:X86' + ccflags += '-Wl,/MACHINE:X86' + endif endif add_global_arguments (ccflags, language: 'cpp')