From 6f8feb9cccbf130339cf118a61512feb8a0424c8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 18 Nov 2019 16:16:20 +0100 Subject: Fix building 32-bit x86 binaries with clang-cl Fixes: QBS-1509 Change-Id: I8ff042bf2006fb989c05490b6a7a3f61aa896920 Reviewed-by: Ivan Komissarov Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- share/qbs/modules/cpp/msvc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index b67ab811f..5ede90840 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -135,6 +135,13 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli break; } + if (input.qbs.toolchain.contains("clang-cl")) { + if (input.cpp.architecture === "x86") + args.push("-m32"); + else if (input.cpp.architecture === "x86_64") + args.push("-m64"); + } + if (debugInformation) { if (product.cpp.separateDebugInformation) args.push('/Zi'); -- cgit v1.2.3