From f087ad801b19ffa32a538269cd1475ead963f013 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 17 Aug 2010 16:00:17 +0200 Subject: qmake: fix assertion on Windows when DESTDIR is empty in static libs Basically replacing project->values("foo").first() with project->first("foo") which does a null check. Task-number: QTBUG-12851 Reviewed-by: ossi --- qmake/generators/win32/winmakefile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index c36cc9c..4944d06 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -472,10 +472,13 @@ void Win32MakefileGenerator::processRcFileVar() resFile.replace(".rc", Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); if (!project->values("OBJECTS_DIR").isEmpty()) { - if(project->isActiveConfig("staticlib")) - project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); + QString resDestDir; + if (project->isActiveConfig("staticlib")) + resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath(); else - project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); + resDestDir = project->first("OBJECTS_DIR"); + resDestDir.append(Option::dir_sep); + project->values("RES_FILE").first().prepend(resDestDir); } project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); project->values("POST_TARGETDEPS") += project->values("RES_FILE"); -- cgit v0.12