diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-03-13 17:31:44 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-03-22 20:12:56 +0000 |
commit | 6909d0dd1ce59d93071ce24ebd12c7c6436b93d1 (patch) | |
tree | 1156298a1075d101b1ba1cb340b952aab4fe323a /share/qbs/modules/cpp/gcc.js | |
parent | 6ca71e5b61c5b1e4ec4c931665a2f3f34709cc23 (diff) |
Add support for QNX and the QCC toolchain
[ChangeLog] Added support for QNX and the QCC toolchain
Change-Id: Id5b1c451d3ca7c3a1445f2481af3bc4caf90798f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/gcc.js')
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 178541cde..fbcca23b0 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -248,7 +248,9 @@ function linkerFlags(project, product, inputs, output) { var sysroot = product.cpp.sysroot; if (sysroot) { - if (isDarwin) + if (product.qbs.toolchain.contains("qcc")) + args = args.concat(escapeLinkerFlags(product, inputs, ["--sysroot=" + sysroot])); + else if (isDarwin) args = args.concat(escapeLinkerFlags(product, inputs, ["-syslibroot", sysroot])); else args.push("--sysroot=" + sysroot); // do not escape, compiler-as-linker also needs it @@ -480,7 +482,9 @@ function compilerFlags(project, product, input, output) { var sysroot = product.cpp.sysroot; if (sysroot) { - if (product.qbs.targetOS.contains("darwin")) + if (product.qbs.toolchain.contains("qcc")) + args.push("-I" + FileInfo.joinPaths(sysroot, "usr", "include")); + else if (product.qbs.targetOS.contains("darwin")) args.push("-isysroot", sysroot); else args.push("--sysroot=" + sysroot); @@ -507,7 +511,9 @@ function compilerFlags(project, product, input, output) { args.push('-Werror'); args = args.concat(configFlags(input)); - args.push('-pipe'); + + if (!input.qbs.toolchain.contains("qcc")) + args.push('-pipe'); if (input.cpp.enableReproducibleBuilds) { var toolchain = product.qbs.toolchain; @@ -1064,7 +1070,9 @@ function dumpMacros(env, compilerFilePath, args, nullDevice) { p.setEnv("LC_ALL", "C"); for (var key in env) p.setEnv(key, env[key]); - p.exec(compilerFilePath, (args || []).concat(["-dM", "-E", "-x", "c", nullDevice]), true); + // qcc NEEDS the explicit -Wp, prefix to -dM; clang and gcc do not but all three accept it + p.exec(compilerFilePath, + (args || []).concat(["-Wp,-dM", "-E", "-x", "c", nullDevice]), true); var map = {}; p.readStdOut().trim().split("\n").map(function (line) { var parts = line.split(" ", 3); |