Skip to content

Commit

Permalink
qmake: define BUILD_XXX_LIB for static build
Browse files Browse the repository at this point in the history
it should be always defined. otherwise there are warnings about
deprecated apis
  • Loading branch information
wang-bin committed Oct 22, 2015
1 parent b883fd4 commit c25e452
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions examples/common/libcommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ DEPENDPATH *= $$PROJECT_SRCPATH
#}
} else {
#Add your additional configuration first. e.g.

# win32: LIBS += -lUser32
# The following may not need to change
!CONFIG(plugin) {
Expand All @@ -107,11 +106,11 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
TARGET = $$PROJECT_TARGETNAME ##I commented out this before, why?
CONFIG *= create_prl #
isEqual(STATICLINK, 1) {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
isEqual(STATICLINK, 1) {
CONFIG -= shared dll ##otherwise the following shared is true, why?
CONFIG *= staticlib
} else {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
CONFIG *= shared #shared includes dll
}

Expand Down
5 changes: 2 additions & 3 deletions qml/libQmlAV.pri
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
} else {
#Add your additional configuration first. e.g.

# win32: LIBS += -lUser32
# The following may not need to change
!CONFIG(plugin) {
Expand All @@ -102,11 +101,11 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
TARGET = $$PROJECT_TARGETNAME ##I commented out this before, why?
CONFIG *= create_prl #
isEqual(STATICLINK, 1) {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
isEqual(STATICLINK, 1) {
CONFIG -= shared dll ##otherwise the following shared is true, why?
CONFIG *= staticlib
} else {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
CONFIG *= shared #shared includes dll
}

Expand Down
5 changes: 2 additions & 3 deletions src/libQtAV.pri
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
} else {
#Add your additional configuration first. e.g.

# win32: LIBS += -lUser32
# The following may not need to change
!CONFIG(plugin) {
Expand All @@ -108,11 +107,11 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
TARGET = $$PROJECT_TARGETNAME ##I commented out this before, why?
CONFIG *= create_prl #
isEqual(STATICLINK, 1) {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
isEqual(STATICLINK, 1) {
CONFIG -= shared dll ##otherwise the following shared is true, why?
CONFIG *= staticlib
} else {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
CONFIG *= shared #shared includes dll
}

Expand Down
5 changes: 2 additions & 3 deletions widgets/libQtAVWidgets.pri
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
} else {
#Add your additional configuration first. e.g.

# win32: LIBS += -lUser32
# The following may not need to change
!CONFIG(plugin) {
Expand All @@ -106,11 +105,11 @@ DEPENDPATH *= $$PROJECT_SRCPATH
}
TARGET = $$PROJECT_TARGETNAME ##I commented out this before, why?
CONFIG *= create_prl #
isEqual(STATICLINK, 1) {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
isEqual(STATICLINK, 1) {
CONFIG -= shared dll ##otherwise the following shared is true, why?
CONFIG *= staticlib
} else {
DEFINES += BUILD_$$upper($$NAME)_LIB #win32-msvc*
CONFIG *= shared #shared includes dll
}

Expand Down

0 comments on commit c25e452

Please sign in to comment.