diff options
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 17 |
3 files changed, 25 insertions, 9 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index c19e17bc0e..57955dc456 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -405,9 +405,14 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t) } if (!rc_file.isEmpty()) { + + ProString defines = varGlue("RC_DEFINES", " -D", " -D", ""); + if (defines.isEmpty()) + defines = ProString(" $(DEFINES)"); + t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t" << var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE") - << incPathStr << " $(DEFINES)\n\n"; + << incPathStr << defines << "\n\n"; } } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index fd2fc2eb94..b8f9c8135d 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1224,7 +1224,12 @@ void VcprojGenerator::initLinkerTool() void VcprojGenerator::initResourceTool() { VCConfiguration &conf = vcProject.Configuration; - conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; + + ProStringList rcDefines = project->values("RC_DEFINES"); + if (rcDefines.size() > 0) + conf.resource.PreprocessorDefinitions = rcDefines.toQStringList(); + else + conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; foreach (const ProString &path, project->values("RC_INCLUDEPATH")) { QString fixedPath = fileFixify(path.toQString()); @@ -1380,8 +1385,7 @@ void VcprojGenerator::initDeploymentTool() } } - // foreach item in DEPLOYMENT - foreach (const ProString &item, project->values("DEPLOYMENT")) { + foreach (const ProString &item, project->values("INSTALLS")) { // get item.path QString devicePath = project->first(ProKey(item + ".path")).toQString(); if (!conf.WinRT) { diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 386e2865fa..0d761b08a2 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -755,10 +755,6 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) if(!project->values("RC_FILE").isEmpty()) { const ProString res_file = project->first("RES_FILE"); const QString rc_file = fileFixify(project->first("RC_FILE").toQString()); - // The resource tool needs to have the same defines passed in as the compiler, since you may - // use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually - // since the compiler defines this symbol by itself, and we use it in the automatically - // created rc file when VERSION is define the .pro file. const ProStringList rcIncPaths = project->values("RC_INCLUDEPATH"); QString incPathStr; @@ -770,9 +766,20 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) incPathStr += escapeFilePath(path); } + // The resource tool may use defines. This might be the same defines passed in as the + // compiler, since you may use these defines in the .rc file itself. + // As the escape syntax for the command line defines for RC is different from that for CL, + // we might have to set specific defines for RC. + ProString defines = varGlue("RC_DEFINES", " -D", " -D", ""); + if (defines.isEmpty()) + defines = ProString(" $(DEFINES)"); + + // Also, we need to add the _DEBUG define manually since the compiler defines this symbol + // by itself, and we use it in the automatically created rc file when VERSION is defined + // in the .pro file. t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t" << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") - << " $(DEFINES)" << incPathStr << " -fo " << escapeFilePath(res_file) + << defines << incPathStr << " -fo " << escapeFilePath(res_file) << ' ' << escapeFilePath(rc_file); t << endl << endl; } |