diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-03 13:53:58 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-03 17:19:46 +0000 |
commit | 6e39b6e65eff9442587bcdfba1c39564a6c83320 (patch) | |
tree | 7eaedf26adca6505fe1afdddfcccab29e5bf549f | |
parent | 0f62e829be66816831e1f04247dfb850912c3d50 (diff) |
cpp module: Fix mingw support
The output format is not ELF for Windows targets.
Change-Id: I04d98379763924229393d82da4057dbe0e99beb5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 6 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index b99ca24c7..a48c830ba 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -57,11 +57,11 @@ CppModule { } targetLinkerFlags: Gcc.targetFlags("linker", false, - target, targetArch, machineType) + target, targetArch, machineType, qbs.targetOS) targetAssemblerFlags: Gcc.targetFlags("assembler", assemblerHasTargetOption, - target, targetArch, machineType) + target, targetArch, machineType, qbs.targetOS) targetDriverFlags: Gcc.targetFlags("compiler", compilerHasTargetOption, - target, targetArch, machineType) + target, targetArch, machineType, qbs.targetOS) Probe { id: nmProbe diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 4cd863e06..e6bff6273 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -1144,7 +1144,7 @@ function dumpDefaultPaths(env, compilerFilePath, args, nullDevice, pathListSepar } } -function targetFlags(tool, hasTargetOption, target, targetArch, machineType) { +function targetFlags(tool, hasTargetOption, target, targetArch, machineType, targetOS) { var args = []; if (hasTargetOption) { if (target) @@ -1156,8 +1156,8 @@ function targetFlags(tool, hasTargetOption, target, targetArch, machineType) { "x86_64": ["-m64"], }, "linker": { - "i386": ["-m", "elf_i386"], - "x86_64": ["-m", "elf_x86_64"], + "i386": ["-m", targetOS.contains("windows") ? "i386pe" : "elf_i386"], + "x86_64": ["-m", targetOS.contains("windows") ? "i386pep" : "elf_x86_64"], }, "assembler": { "i386": ["--32"], |