Skip to content

Commit e627c09

Browse files
authored
Merge pull request DOCGroup#150 from mitza-oci/qt5-static
Updated Qt5 base projects for -static builds
2 parents 652cd97 + 1774ba1 commit e627c09

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

config/qt5_core.mpb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ project {
2222
requires += qt5
2323
includes += $(QT5_INCDIR)
2424
libpaths += $(QT5_LIBDIR)
25-
libs += Qt5Core
25+
26+
// Use lit_libs instead of libs for qt5's libraries.
27+
// When generating -static projects of a type that uses lib_modifier,
28+
// the lib_modifier will have an "s" in it (s for Release, sd for Debug).
29+
// However, the libraries produced by the Qt project never have an "s" suffix.
30+
// When MPC generates -static projects, the Qt being used may or may not be
31+
// static (it doesn't matter for project generation).
32+
// Since the Qt projects do use a "d" suffix for Debug whether or not the
33+
// libs are static, we need to account for that with $(QT5_LIBSUFFIX).
34+
lit_libs += Qt5Core$(QT5_LIBSUFFIX)
2635

2736
// On Linux at least, Qt5 by default requires position independent code
2837
specific (gnuace) {
@@ -34,6 +43,7 @@ project {
3443
// which will conflict with winsock2.h. This makes windows.h not include
3544
// winsock.h
3645
macros += WIN32_LEAN_AND_MEAN
46+
Debug::QT5_LIBSUFFIX = d
3747
}
3848

3949
Define_Custom(UIC) {

config/qt5_gui.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_core {
2-
libs += Qt5Gui
2+
lit_libs += Qt5Gui$(QT5_LIBSUFFIX)
33
}
44

config/qt5_network.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_core {
2-
libs += Qt5Network
2+
lit_libs += Qt5Network$(QT5_LIBSUFFIX)
33
}
44

config/qt5_opengl.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_widgets {
2-
libs += Qt5OpenGL
2+
lit_libs += Qt5OpenGL$(QT5_LIBSUFFIX)
33
}
44

config/qt5_sql.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_core {
2-
libs += Qt5Sql
2+
lit_libs += Qt5Sql$(QT5_LIBSUFFIX)
33
}
44

config/qt5_test.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_core {
2-
libs += Qt5Test
2+
lit_libs += Qt5Test$(QT5_LIBSUFFIX)
33
}
44

config/qt5_widgets.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_gui {
2-
libs += Qt5Widgets
2+
lit_libs += Qt5Widgets$(QT5_LIBSUFFIX)
33
}
44

config/qt5_xml.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
project: qt5_core {
2-
libs += Qt5Xml
2+
lit_libs += Qt5Xml$(QT5_LIBSUFFIX)
33
}
44

0 commit comments

Comments
 (0)