aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/msvc.js
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2012-02-28 14:42:05 +0100
committerJoerg Bornemann <joerg.bornemann@nokia.com>2012-02-28 16:02:44 +0100
commit926a109eef82f456756c4ceca25680dfd19b4a1b (patch)
tree1593db01635578b00ea0f1ff7b920a4c59800382 /share/qbs/modules/cpp/msvc.js
parentca54e76bdf6e8c0668f791fd03fd6e641197f10d (diff)
properties for overring C/C++ compiler and linker args
In the cpp module we introduce the properties: cppflags, cflags, cxxflags and linkerFlags. The property compilerFlags was removed Change-Id: Ia883633936b9b638f397d121077714c3f811e6ec Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Diffstat (limited to 'share/qbs/modules/cpp/msvc.js')
-rw-r--r--share/qbs/modules/cpp/msvc.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index 791b2e115..e39223515 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -1,4 +1,4 @@
-function prepareCompiler(product, input, outputs, defines, includePaths, compilerFlags)
+function prepareCompiler(product, input, outputs, defines, includePaths, cFlags, cxxFlags)
{
var i;
var optimization = input.module.optimization
@@ -9,7 +9,9 @@ function prepareCompiler(product, input, outputs, defines, includePaths, compile
var args = ['/nologo', '/c', '/Zm200', '/Zc:wchar_t-']
// C or C++
+ var isCxx = true;
if (input.fileTags.indexOf('c') >= 0) {
+ isCxx = false;
args.push('/TC')
}
@@ -67,8 +69,12 @@ function prepareCompiler(product, input, outputs, defines, includePaths, compile
clPath += 'amd64/'
clPath += 'cl.exe'
- for (i in compilerFlags) {
- args.push(compilerFlags[i])
+ if (isCxx) {
+ if (cxxFlags)
+ args = args.concat(cxxFlags);
+ } else {
+ if (cFlags)
+ args = args.concat(cFlags);
}
var cmd = new Command(clPath, args)
@@ -84,7 +90,7 @@ function prepareCompiler(product, input, outputs, defines, includePaths, compile
return cmd;
}
-function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries, staticLibraries)
+function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries, staticLibraries, linkerFlags)
{
var i;
var linkDLL = (outputs.dynamiclibrary ? true : false)