Define _WINDLL when building a DLL

Visual Studio automatically defines _WINDLL when building a DLL,
regardless of project settings
(https://msdn.microsoft.com/en-us/library/8x480de8.aspx). This define
is therefore widely used to detect DLL vs. static library or executable
build target on Windows.

For makefiles, _WINDLL need to be manually defined, which QMake failed
to do so far.

Task-number: QTBUG-55183
Change-Id: Ic62201666c44e730e6881706d568ce9eaf22b7a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Fredrik Orderud 2016-08-08 22:39:00 +02:00
parent 0681e60380
commit b6f5b38f8c

View File

@ -426,6 +426,12 @@ void NmakeMakefileGenerator::init()
if (!defines.contains("NDEBUG"))
defines.append("NDEBUG");
}
if (project->values("QMAKE_APP_FLAG").isEmpty() && project->isActiveConfig("dll")) {
ProStringList &defines = project->values("DEFINES");
if (!defines.contains("_WINDLL"))
defines.append("_WINDLL");
}
}
QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter()