escape literal backslashes in qmake files
Task-number: QTBUG-70765 Change-Id: I56abbf19be88d01b2964980fb741567f28e4f0fa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
2c6ec2c653
commit
bccb964b9a
@ -110,7 +110,7 @@
|
||||
# Backwards compatibility
|
||||
for (bundle_data, QMAKE_BUNDLE_DATA) {
|
||||
for (bundle_file, $${bundle_data}.files) {
|
||||
!contains(bundle_file, .*\.xcassets$): next()
|
||||
!contains(bundle_file, .*\\.xcassets$): next()
|
||||
warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.")
|
||||
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
|
||||
|
||||
|
@ -21,7 +21,7 @@ contains(TEMPLATE, .*app) {
|
||||
!isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
|
||||
CONFIG += sdk_no_version_check
|
||||
|
||||
QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\d+)(\.\d+)(\.\d+)?", \1\2)
|
||||
QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1\\2)
|
||||
|
||||
!sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
|
||||
warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
|
||||
|
@ -38,7 +38,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP
|
||||
} else: error("Oops, I messed up")
|
||||
moc_predefs.output = $$MOC_DIR/moc_predefs.h
|
||||
moc_predefs.input = MOC_PREDEF_FILE
|
||||
silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands
|
||||
silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\\n\\t)@$$moc_predefs.commands
|
||||
QMAKE_EXTRA_COMPILERS += moc_predefs
|
||||
MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp
|
||||
}
|
||||
|
@ -1196,9 +1196,9 @@ defineTest(qtConfTest_files) {
|
||||
for(i, $${1}.files._KEYS_) {
|
||||
f = $$eval($${1}.files.$${i})
|
||||
qtLog("Searching for file $${f}.")
|
||||
contains(f, ".*\.h") {
|
||||
contains(f, ".*\\.h") {
|
||||
file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS)
|
||||
} else: contains(f, ".*\.(lib|so|a)") {
|
||||
} else: contains(f, ".*\\.(lib|so|a)") {
|
||||
file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
|
||||
} else {
|
||||
# assume we're looking for an executable
|
||||
@ -1399,7 +1399,7 @@ defineReplace(qtConfEvaluate) {
|
||||
1 ~= s/$$escape_expand(\\n) */ /g
|
||||
expr = $${1}
|
||||
expr ~= s/&&/ && /g
|
||||
expr ~= s/\|\|/ || /g
|
||||
expr ~= s/\\|\\|/ || /g
|
||||
expr ~= s/!/ ! /g
|
||||
expr ~= s/\\(/ ( /g
|
||||
expr ~= s/\\)/ ) /g
|
||||
@ -1422,7 +1422,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
} else: contains(e, "^'.*'$") {
|
||||
# quoted literals
|
||||
result = $$replace(e, "^'(.*)'$", "\\1")
|
||||
} else: contains(e, "^tests\..*") {
|
||||
} else: contains(e, "^tests\\..*") {
|
||||
!qt_conf_tests_allowed: \
|
||||
error("Expression '$${1}' refers to a test, which is not allowed at this stage of configuring.")
|
||||
test = $$section(e, ".", 1, 1)
|
||||
@ -1433,7 +1433,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
error("Unknown test object $${test} in expression '$${1}'.")
|
||||
qtRunSingleTest($$test)
|
||||
result = $$eval($${currentConfig}.tests.$${test}.$${var})
|
||||
} else: contains(e, "^libs\..*") {
|
||||
} else: contains(e, "^libs\\..*") {
|
||||
!qt_conf_tests_allowed: \
|
||||
error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.")
|
||||
lib = $$section(e, ".", 1, 1)
|
||||
@ -1446,7 +1446,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
!defined($${currentConfig}.libraries.$${lib}.$${var}, var): \
|
||||
var = sources.$$eval($${currentConfig}.libraries.$${lib}.source).$$var
|
||||
result = $$eval($${currentConfig}.libraries.$${lib}.$${var})
|
||||
} else: contains(e, "^features\..*") {
|
||||
} else: contains(e, "^features\\..*") {
|
||||
feature = $$section(e, ".", 1, 1)
|
||||
var = $$section(e, ".", 2, -1)
|
||||
isEmpty(var): \
|
||||
@ -1470,33 +1470,33 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
!qtConfCheckFeature($$feature): \
|
||||
error("Expression '$$1' is accessing non-emitted feature $${feature}.")
|
||||
result = $$eval($${currentConfig}.features.$${feature}.$${var})
|
||||
} else: contains(e, "^config\..*") {
|
||||
var = $$replace(e, "^config\.", "")
|
||||
} else: contains(e, "^config\\..*") {
|
||||
var = $$replace(e, "^config\\.", "")
|
||||
result = false
|
||||
contains(CONFIG, $$var): result = true
|
||||
} else: contains(e, "^module\..*") {
|
||||
var = $$replace(e, "^module\.", "")
|
||||
} else: contains(e, "^module\\..*") {
|
||||
var = $$replace(e, "^module\\.", "")
|
||||
result = false
|
||||
qtConfHaveModule($$var): result = true
|
||||
} else: contains(e, "^arch\..*") {
|
||||
var = $$replace(e, "^arch\.", "")
|
||||
} else: contains(e, "^arch\\..*") {
|
||||
var = $$replace(e, "^arch\\.", "")
|
||||
result = false
|
||||
isEmpty(QT_ARCH): \
|
||||
qtConfCheckFeature(architecture)
|
||||
contains(QT_ARCH, $$var): result = true
|
||||
} else: contains(e, "^subarch\..*") {
|
||||
var = $$replace(e, "^subarch\.", "")
|
||||
} else: contains(e, "^subarch\\..*") {
|
||||
var = $$replace(e, "^subarch\\.", "")
|
||||
result = false
|
||||
isEmpty(QT_ARCH): \
|
||||
qtConfCheckFeature(architecture)
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, $$var): result = true
|
||||
} else: contains(e, "^input\..*") {
|
||||
} else: contains(e, "^input\\..*") {
|
||||
result = $$eval(config.$$e)
|
||||
} else: contains(e, "^var\..*") {
|
||||
var = $$replace(e, "^var\.", "")
|
||||
} else: contains(e, "^var\\..*") {
|
||||
var = $$replace(e, "^var\\.", "")
|
||||
result = $$eval($$var)
|
||||
} else: contains(e, "^call\..*") {
|
||||
call = $$replace(e, "^call\.", "qtConfFunc_")
|
||||
} else: contains(e, "^call\\..*") {
|
||||
call = $$replace(e, "^call\\.", "qtConfFunc_")
|
||||
!defined($$call, replace): \
|
||||
error("Call $$call referenced in expression '$${1}' does not exist")
|
||||
eval(result = \$\$"$$call"())
|
||||
|
@ -18,7 +18,7 @@ isEmpty(qtver.value): error("No version for documentation specified.")
|
||||
qtmver.name = QT_VER
|
||||
qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
|
||||
qtvertag.name = QT_VERSION_TAG
|
||||
qtvertag.value = $$replace(qtver.value, \.,)
|
||||
qtvertag.value = $$replace(qtver.value, \\.,)
|
||||
qtdocs.name = QT_INSTALL_DOCS
|
||||
qtdocs.value = $$[QT_INSTALL_DOCS/src]
|
||||
builddir.name = BUILDDIR
|
||||
|
@ -1,7 +1,7 @@
|
||||
msvc {
|
||||
# -MD becomes -MT, -MDd becomes -MTd
|
||||
QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\1,g
|
||||
QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\1,g
|
||||
QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\\1,g
|
||||
QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\\1,g
|
||||
} else: mingw {
|
||||
QMAKE_LFLAGS += -static
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user