From 5f7287cfb690d9692d319bd617a5bdd6a2f2f26e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 16 Aug 2017 15:40:25 +0200 Subject: Add MSVC manifest backup file to "clean" target The $${TARGET}_manifest.bak file was not removed on "nmake clean". Task-number: QTBUG-59827 Change-Id: Ia5b636f4917f3e7a2df8d753824b72e63d278005 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_nmake.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qmake/generators') diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index ef1eaf095e..21f96e49d9 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -611,6 +611,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) if (generateManifest) { manifest = escapeFilePath(manifest); QString manifest_bak = escapeFilePath(target + "_manifest.bak"); + project->values("QMAKE_CLEAN") << manifest_bak; t << "\n\tif not exist $(DESTDIR_TARGET) if exist " << manifest << " del " << manifest; t << "\n\tif exist " << manifest << " copy /Y " << manifest << ' ' << manifest_bak; -- cgit v1.2.3 From 515b9051505d61af6be0eba87616c7281ee4ce62 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 6 Sep 2016 19:21:50 +0200 Subject: Adapt qmake's raw-string parser to avoid confusion by macros A macro name ending in R might expand to a string; if this precedes a string constant, we're juxtaposing the strings. My first parser for raw strings would mistake it for a raw string instead, ignoring the part of the identifier before R. Re-worked the exploration of what came before the string to catch these cases, too. The backwards parsing would also allow any messy jumble of [RLUu8]* as prefix for the string; but in fact R must (if present) be last in the prefix and *it* can have at most one prefix, [LUu] or u8. Anything else is an identifier that happens to precede the string. Reworked the parsing to allow only one prefix and not treat R specially unless it's immediately (modulo BSNL) before the string's open-quotes. Add link to the cppreference page about string literals, on which the grammar now parsed is based. Added a test for the issue this addresses. Verified that this fails on 5.6, dev and 5.9 without the fix. Expanded the existing test to cover R-with-prefix cases. Task-number: QTBUG-55633 Change-Id: I541486c2ec909cfb42050907c84bee83ead4a2f4 Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefiledeps.cpp | 42 ++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 3140b045a1..c68eeb13d6 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -422,25 +422,53 @@ static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start, /* Advance from an opening quote at buffer[offset] to the matching close quote. */ static int scanPastString(char *buffer, int buffer_len, int offset, int *lines) { + // http://en.cppreference.com/w/cpp/language/string_literal // It might be a C++11 raw string. bool israw = false; if (buffer[offset] == '"' && offset > 0) { int explore = offset - 1; - while (explore > 0 && buffer[explore] != 'R') { - if (buffer[explore] == '8' || buffer[explore] == 'u' || buffer[explore] == 'U') { - explore--; - } else if (explore > 1 && qmake_endOfLine(buffer[explore]) - && buffer[explore - 1] == '\\') { + bool prefix = false; // One of L, U, u or u8 may appear before R + bool saw8 = false; // Partial scan of u8 + while (explore >= 0) { + // Cope with backslash-newline interruptions of the prefix: + if (explore > 0 + && qmake_endOfLine(buffer[explore]) + && buffer[explore - 1] == '\\') { explore -= 2; - } else if (explore > 2 && buffer[explore] == '\n' + } else if (explore > 1 + && buffer[explore] == '\n' && buffer[explore - 1] == '\r' && buffer[explore - 2] == '\\') { explore -= 3; + // Remaining cases can only decrement explore by one at a time: + } else if (saw8 && buffer[explore] == 'u') { + explore--; + saw8 = false; + prefix = true; + } else if (saw8 || prefix) { + break; + } else if (explore > 1 && buffer[explore] == '8') { + explore--; + saw8 = true; + } else if (buffer[explore] == 'L' + || buffer[explore] == 'U' + || buffer[explore] == 'u') { + explore--; + prefix = true; + } else if (buffer[explore] == 'R') { + if (israw) + break; + explore--; + israw = true; } else { break; } } - israw = (buffer[explore] == 'R'); + // Check the R (with possible prefix) isn't just part of an identifier: + if (israw && explore >= 0 + && (isalnum(buffer[explore]) || buffer[explore] == '_')) { + israw = false; + } } if (israw) { -- cgit v1.2.3 From ce5e6876d4a191087969134e489db99cf167ca69 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 11 Aug 2017 12:16:57 +0200 Subject: qmake: make more use of ProString built-ins saves some noisy toQString() uses. Change-Id: I62a9e2725c4baabac311124d19c7d8b40f54c8f7 Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index ab699157ca..63926e7ef0 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1902,7 +1902,7 @@ int ProjectBuilderMakefileGenerator::pbuilderVersion() const { if (!project->isEmpty("QMAKE_PBUILDER_VERSION")) - return project->first("QMAKE_PBUILDER_VERSION").toQString().toInt(); + return project->first("QMAKE_PBUILDER_VERSION").toInt(); return 46; // Xcode 3.2-compatible; default format since that version } -- cgit v1.2.3