aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-08-25 10:41:25 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-08-29 09:40:35 +0000
commit65a7c527a6210a751b2b8b5e9e8fe46a14806d28 (patch)
treec9c723d0cffa42ee27329657a97216ae38a08479
parentf2302b034f4441599eaa782fdc3e1b0f9915564e (diff)
MSVC: Escape the percent sign in defines
The percent sign is special to cl.exe in mysterious ways. It has to be escaped with another one. This is indepent of whether the defined value is a string or not. Change-Id: I7bf4a46cea33c29007894566cf38b41d526fd94a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r--share/qbs/modules/cpp/msvc.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index 501197775..43a6a990a 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -123,7 +123,7 @@ function prepareCompiler(project, product, inputs, outputs, input, output) {
if (defines)
allDefines = allDefines.uniqueConcat(defines);
for (i in allDefines)
- args.push('/D' + allDefines[i])
+ args.push('/D' + allDefines[i].replace(/%/g, "%%"));
var minimumWindowsVersion = ModUtils.moduleProperty(product, "minimumWindowsVersion");
if (minimumWindowsVersion) {