Commit 2b467e8e authored by Kai Koehne's avatar Kai Koehne
Browse files

Fix compilation breakage with mingw / windres



The replacement of string defines in the .rc file that was introduced
in commit b5703bcd029fd does not work with windres. Here the string
literals have to be explicitly quoted by STRINGIFY. Also, we need to
replace literal spaces with \x20.

Task-number: QTCREATORBUG-18635
Change-Id: Ie01886ea680c3c07c4e0a031f12b6fe60e896263
Reviewed-by: Oswald Buddenhagen's avatarOswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent bb145847
......@@ -23,9 +23,11 @@ win32 {
# We need the version in two separate formats for the .rc file
# RC_VERSION=4,3,82,0 (quadruple)
# RC_VERSION_STRING="4.4.0-beta1" (free text)
# Also, we need to replace space with \x20 to be able to work with both rc and windres
COPYRIGHT = "2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd"
DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \
RC_VERSION_STRING=\\\"$${QTCREATOR_DISPLAY_VERSION}\\\" \
RC_COPYRIGHT='"\\\"2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd\\\""'
RC_VERSION_STRING=\"$${QTCREATOR_DISPLAY_VERSION}\" \
RC_COPYRIGHT=\"$$replace(COPYRIGHT, " ", "\\x20")\"
RC_FILE = qtcreator.rc
} else:macx {
LIBS += -framework CoreFoundation
......
......@@ -54,9 +54,11 @@ QtcProduct {
// We need the version in two separate formats for the .rc file
// RC_VERSION=4,3,82,0 (quadruple)
// RC_VERSION_STRING="4.4.0-beta1" (free text)
// Also, we need to replace space with \x20 to be able to work with both rc and windres
cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
"RC_VERSION_STRING=\"" + qtc.qtcreator_display_version + "\"",
"RC_COPYRIGHT=\"2008-" + qtc.qtcreator_copyright_year + " The Qt Company Ltd\""])
"RC_VERSION_STRING=" + qtc.qtcreator_display_version,
"RC_COPYRIGHT=2008-" + qtc.qtcreator_copyright_year
+ " The Qt Company Ltd".replace(/ /g, "\\x20")])
files: "qtcreator.rc"
}
......
#include <windows.h>
#define STRINGIFY1(x) #x
#define STRINGIFY(x) STRINGIFY1(x)
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
......@@ -19,10 +22,10 @@ VS_VERSION_INFO VERSIONINFO
BLOCK "040904E4"
{
VALUE "FileDescription", "Qt Creator"
VALUE "FileVersion", RC_VERSION_STRING
VALUE "FileVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "ProductName", "Qt Creator"
VALUE "ProductVersion", RC_VERSION_STRING
VALUE "LegalCopyright", RC_COPYRIGHT
VALUE "ProductVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "LegalCopyright", STRINGIFY(RC_COPYRIGHT)
}
}
BLOCK "VarFileInfo"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment