aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-03-18 15:31:03 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-03-18 16:52:56 +0100
commitcbea4ec2b7e7464743677f59d45b4d0021ff48a9 (patch)
tree762610fe26309602370831d42362f7e0afa82ea1 /share
parentdf54de2c1a582e17e95d57286fd0573e7de87ecd (diff)
simplify language selection in GenericGCC.qbs
Preparation for objcxxFlags. Change-Id: I8fbe71fa1a26db4fa034cd622a0a9bd0b0ae1998 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs39
1 files changed, 14 insertions, 25 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index 130ca7a0a..da916564d 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -263,8 +263,7 @@ CppModule {
var objcFlags = ModUtils.moduleProperties(input, 'objcFlags');
var visibility = ModUtils.moduleProperty(product, 'visibility');
var args = Gcc.configFlags(input);
- var isCxx = true;
- var isObjC = false;
+ var i, c;
args.push('-pipe');
@@ -292,31 +291,21 @@ CppModule {
if (!pchPathIncluded)
args.push('-I' + pchPath)
}
- if (input.fileTags.indexOf("c") >= 0) {
- isCxx = false;
- isObjC = false;
- args.push('-x')
- args.push('c')
- } else if (input.fileTags.indexOf("objc") >= 0) {
- isObjC = true;
- isCxx = false;
- args.push('-x');
- args.push('objective-c');
- } else if (input.fileTags.indexOf("objcpp") >= 0) {
- isObjC = true;
- isCxx = true;
- args.push('-x');
- args.push('objective-c++');
- }
- if (isObjC) {
- if (objcFlags)
- args = args.concat(objcFlags);
- } else if (isCxx) {
- if (cxxFlags)
+ for (i = 0, c = input.fileTags.length; i < c; ++i) {
+ if (input.fileTags[i] === "cpp") {
args = args.concat(cxxFlags);
- } else {
- if (cFlags)
+ break;
+ } else if (input.fileTags[i] === "c") {
+ args.push('-x');
+ args.push('c');
args = args.concat(cFlags);
+ break;
+ } else if (input.fileTags[i] === "objc") {
+ args.push('-x');
+ args.push('objective-c');
+ args = args.concat(objcFlags);
+ break;
+ }
}
args = args.concat(Gcc.additionalFlags(product, includePaths, frameworkPaths, systemIncludePaths, systemFrameworkPaths, input.fileName, output))
var cmd = new Command(ModUtils.moduleProperty(product, "compilerPath"), args);