Changeset 846 for trunk/qmake/project.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/qmake/project.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 #include "option.h" 45 45 #include "cachekeys.h" 46 #include "generators/metamakefile.h" 46 47 47 48 #include <qdatetime.h> … … 66 67 67 68 // Included from tools/shared 68 #include <symbian/epocroot .h>69 #include <symbian/epocroot_p.h> 69 70 70 71 #ifdef Q_OS_WIN32 … … 78 79 QT_BEGIN_NAMESPACE 79 80 80 //expand fu cntions81 //expand functions 81 82 enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST, 82 83 E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, … … 124 125 T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE, 125 126 T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_ERROR, 126 T_MESSAGE, T_WARNING, T_IF };127 T_MESSAGE, T_WARNING, T_IF, T_OPTION }; 127 128 QMap<QString, TestFunc> qmake_testFunctions() 128 129 { … … 158 159 qmake_test_functions->insert("message", T_MESSAGE); 159 160 qmake_test_functions->insert("warning", T_WARNING); 161 qmake_test_functions->insert("option", T_OPTION); 160 162 } 161 163 return *qmake_test_functions; … … 187 189 { 188 190 QString ret(x); 189 if(ret.startsWith("TMAKE")) //tmake no more! 190 ret = "QMAKE" + ret.mid(5); 191 else if(ret == "INTERFACES") 191 if(ret == "INTERFACES") 192 192 ret = "FORMS"; 193 193 else if(ret == "QMAKE_POST_BUILD") … … 223 223 else if(ret == "QMAKE_FRAMEWORKDIR_FLAGS") 224 224 ret = "QMAKE_FRAMEWORKPATH_FLAGS"; 225 else 226 return ret; 227 warn_msg(WarnDeprecated, "%s:%d: Variable %s is deprecated; use %s instead.", 228 parser.file.toLatin1().constData(), parser.line_no, 229 x.toLatin1().constData(), ret.toLatin1().constData()); 225 230 return ret; 226 231 } … … 281 286 } 282 287 283 static QStringList split_value_list(const QString &vals , bool do_semicolon=false)288 static QStringList split_value_list(const QString &vals) 284 289 { 285 290 QString build; … … 292 297 const ushort DOUBLEQUOTE = '"'; 293 298 const ushort BACKSLASH = '\\'; 294 const ushort SEMICOLON = ';';295 299 296 300 ushort unicode; … … 312 316 } 313 317 314 if(!parens && quote.isEmpty() && ((do_semicolon && unicode == SEMICOLON) || 315 vals_data[x] == Option::field_sep)) { 318 if(!parens && quote.isEmpty() && (vals_data[x] == Option::field_sep)) { 316 319 ret << build; 317 320 build.clear(); … … 512 515 } 513 516 514 enum isForSymbian_enum {515 isForSymbian_NOT_SET = -1,516 isForSymbian_FALSE = 0,517 isForSymbian_ABLD = 1,518 isForSymbian_SBSV2 = 2,519 };520 521 static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;522 523 // Checking for symbian build is primarily determined from the qmake spec,524 // but if that is not specified, detect if symbian is the default spec525 // by checking the MAKEFILE_GENERATOR variable value.526 static void init_symbian(const QMap<QString, QStringList>& vars)527 {528 if (isForSymbian_value != isForSymbian_NOT_SET)529 return;530 531 QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();532 if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {533 isForSymbian_value = isForSymbian_ABLD;534 } else if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {535 isForSymbian_value = isForSymbian_SBSV2;536 } else {537 QStringList generatorList = vars["MAKEFILE_GENERATOR"];538 539 if (!generatorList.isEmpty()) {540 QString generator = generatorList.first();541 if (generator.startsWith("SYMBIAN_ABLD"))542 isForSymbian_value = isForSymbian_ABLD;543 else if (generator.startsWith("SYMBIAN_SBSV2"))544 isForSymbian_value = isForSymbian_SBSV2;545 else546 isForSymbian_value = isForSymbian_FALSE;547 } else {548 isForSymbian_value = isForSymbian_FALSE;549 }550 }551 552 // Force recursive on Symbian, as non-recursive is not really a viable option there553 if (isForSymbian_value != isForSymbian_FALSE)554 Option::recursive = true;555 }556 557 bool isForSymbian()558 {559 // If isForSymbian_value has not been initialized explicitly yet,560 // call initializer with dummy map to check qmake spec.561 if (isForSymbian_value == isForSymbian_NOT_SET)562 init_symbian(QMap<QString, QStringList>());563 564 return (isForSymbian_value != isForSymbian_FALSE);565 }566 567 bool isForSymbianSbsv2()568 {569 // If isForSymbian_value has not been initialized explicitly yet,570 // call initializer with dummy map to check qmake spec.571 if (isForSymbian_value == isForSymbian_NOT_SET)572 init_symbian(QMap<QString, QStringList>());573 574 return (isForSymbian_value == isForSymbian_SBSV2);575 }576 577 517 /* 578 518 1) environment variable QMAKEFEATURES (as separated by colons) … … 600 540 concat << base_concat + QDir::separator() + "unix"; 601 541 break; 542 default: // Can't happen, just make the compiler shut up 602 543 case Option::TARG_UNIX_MODE: 603 { 604 if (isForSymbian()) 605 concat << base_concat + QDir::separator() + "symbian"; 606 else 607 concat << base_concat + QDir::separator() + "unix"; 608 break; 609 } 544 concat << base_concat + QDir::separator() + "unix"; 545 break; 610 546 case Option::TARG_WIN_MODE: 611 { 612 if (isForSymbian()) 613 concat << base_concat + QDir::separator() + "symbian"; 614 else 615 concat << base_concat + QDir::separator() + "win32"; 616 break; 617 } 547 concat << base_concat + QDir::separator() + "win32"; 548 break; 549 case Option::TARG_SYMBIAN_MODE: 550 concat << base_concat + QDir::separator() + "symbian"; 551 break; 618 552 case Option::TARG_OS2_MODE: 619 553 concat << base_concat + QDir::separator() + "os2"; 620 break;621 case Option::TARG_MAC9_MODE:622 concat << base_concat + QDir::separator() + "mac";623 concat << base_concat + QDir::separator() + "mac9";624 554 break; 625 555 } … … 635 565 if(!Option::mkfile::cachefile.isEmpty()) { 636 566 QString path; 637 int last_slash = Option::mkfile::cachefile.lastIndexOf( Option::dir_sep);567 int last_slash = Option::mkfile::cachefile.lastIndexOf(QDir::separator()); 638 568 if(last_slash != -1) 639 path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash) );569 path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash), false); 640 570 for(QStringList::Iterator concat_it = concat.begin(); 641 571 concat_it != concat.end(); ++concat_it) … … 693 623 } 694 624 695 class QMakeProjectEnv696 {697 QStringList envs;698 public:699 QMakeProjectEnv() { }700 QMakeProjectEnv(QMakeProject *p) { execute(p->variables()); }701 QMakeProjectEnv(const QMap<QString, QStringList> &values) { execute(values); }702 703 void execute(QMakeProject *p) { execute(p->variables()); }704 void execute(const QMap<QString, QStringList> &values) {705 #ifdef Q_OS_UNIX706 for(QMap<QString, QStringList>::ConstIterator it = values.begin(); it != values.end(); ++it) {707 const QString var = it.key(), val = it.value().join(" ");708 if(!var.startsWith(".")) {709 const QString env_var = Option::sysenv_mod + var;710 if(!putenv(strdup(QString(env_var + "=" + val).toAscii().data())))711 envs.append(env_var);712 }713 }714 #else715 Q_UNUSED(values);716 #endif717 }718 ~QMakeProjectEnv() {719 #ifdef Q_OS_UNIX720 for(QStringList::ConstIterator it = envs.begin();it != envs.end(); ++it) {721 putenv(strdup(QString(*it + "=").toAscii().data()));722 }723 #endif724 }725 };726 727 625 QMakeProject::~QMakeProject() 728 626 { … … 754 652 own_prop = false; 755 653 } 654 recursive = false; 756 655 reset(); 757 656 } … … 778 677 iterator = 0; 779 678 function = 0; 679 backslashWarned = false; 780 680 } 781 681 … … 783 683 QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int numLines) 784 684 { 785 QString s = t.simplified(); 685 // To preserve the integrity of any UTF-8 characters in .pro file, temporarily replace the 686 // non-breaking space (0xA0) characters with another non-space character, so that 687 // QString::simplified() call will not replace it with space. 688 // Note: There won't be any two byte characters in .pro files, so 0x10A0 should be a safe 689 // replacement character. 690 static QChar nbsp(0xA0); 691 static QChar nbspFix(0x01A0); 692 QString s; 693 if (t.indexOf(nbsp) != -1) { 694 s = t; 695 s.replace(nbsp, nbspFix); 696 s = s.simplified(); 697 s.replace(nbspFix, nbsp); 698 } else { 699 s = t.simplified(); 700 } 701 786 702 int hash_mark = s.indexOf("#"); 787 703 if(hash_mark != -1) //good bye comments … … 1153 1069 QString vals = s.mid(d_off); // vals now contains the space separated list of values 1154 1070 int rbraces = vals.count('}'), lbraces = vals.count('{'); 1155 if(scope_blocks.count() > 1 && rbraces - lbraces == 1 ) {1071 if(scope_blocks.count() > 1 && rbraces - lbraces == 1 && vals.endsWith('}')) { 1156 1072 debug_msg(1, "Project Parser: %s:%d : Leaving block %d", parser.file.toLatin1().constData(), 1157 1073 parser.line_no, scope_blocks.count()); … … 1169 1085 1170 1086 doVariableReplace(var, place); 1171 var = varMap(var); //backwards compat ability1087 var = varMap(var); //backwards compatibility 1172 1088 if(!var.isEmpty() && Option::mkfile::do_preprocess) { 1173 1089 static QString last_file("*none*"); … … 1180 1096 1181 1097 if(vals.contains('=') && numLines > 1) 1182 warn_msg(WarnParser, " Detected possible line continuation: {%s}%s:%d",1098 warn_msg(WarnParser, "Possible accidental line continuation: {%s} at %s:%d", 1183 1099 var.toLatin1().constData(), parser.file.toLatin1().constData(), parser.line_no); 1184 1100 … … 1233 1149 { 1234 1150 //doVariableReplace(vals, place); 1235 QStringList tmp = split_value_list(vals , (var == "DEPENDPATH" || var == "INCLUDEPATH"));1151 QStringList tmp = split_value_list(vals); 1236 1152 for(int i = 0; i < tmp.size(); ++i) 1237 1153 vallist += doVariableReplaceExpand(tmp[i], place); … … 1323 1239 1324 1240 const QString oldpwd = qmake_getpwd(); 1325 QString filename = Option::fixPathToLocalOS(file); 1326 doVariableReplace(filename, place); 1241 QString filename = Option::fixPathToLocalOS(file, false); 1327 1242 bool ret = false, using_stdin = false; 1328 1243 QFile qfile; … … 1368 1283 { 1369 1284 if(cfile.isEmpty()) { 1370 //find out where qmake (myself) lives1371 if (!base_vars.contains("QMAKE_QMAKE")) {1372 if (!Option::qmake_abslocation.isNull())1373 base_vars["QMAKE_QMAKE"] = QStringList(Option::qmake_abslocation);1374 else1375 base_vars["QMAKE_QMAKE"] = QStringList("qmake");1376 }1377 1378 1285 // hack to get the Option stuff in there 1379 base_vars["QMAKE_EXT_OBJ"] = QStringList(Option::obj_ext);1380 1286 base_vars["QMAKE_EXT_CPP"] = Option::cpp_ext; 1381 1287 base_vars["QMAKE_EXT_C"] = Option::c_ext; … … 1463 1369 qmakespec.truncate(qmakespec.length()-1); 1464 1370 QString spec = qmakespec + QDir::separator() + "qmake.conf"; 1465 if(!QFile::exists(spec) &&1466 QFile::exists(qmakespec + QDir::separator() + "tmake.conf"))1467 spec = qmakespec + QDir::separator() + "tmake.conf";1468 1371 debug_msg(1, "QMAKESPEC conf: reading %s", spec.toLatin1().constData()); 1469 1372 if(!read(spec, base_vars)) { … … 1471 1374 return false; 1472 1375 } 1473 1474 init_symbian(base_vars); 1376 validateModes(); 1475 1377 1476 1378 if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) { … … 1524 1426 if(!read(pfile, vars)) 1525 1427 return false; 1526 }1527 1528 if(cmd & ReadPostFiles) { // parse post files1529 const QStringList l = vars["QMAKE_POST_INCLUDE_FILES"];1530 for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {1531 if(read((*it), vars)) {1532 if(vars["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf((*it)) == -1)1533 vars["QMAKE_INTERNAL_INCLUDED_FILES"].append((*it));1534 }1535 }1536 1428 } 1537 1429 … … 1596 1488 } 1597 1489 1490 void QMakeProject::validateModes() 1491 { 1492 if (Option::host_mode == Option::HOST_UNKNOWN_MODE 1493 || Option::target_mode == Option::TARG_UNKNOWN_MODE) { 1494 Option::HOST_MODE host_mode; 1495 Option::TARG_MODE target_mode; 1496 const QStringList &gen = base_vars.value("MAKEFILE_GENERATOR"); 1497 if (gen.isEmpty()) { 1498 fprintf(stderr, "%s:%d: Using OS scope before setting MAKEFILE_GENERATOR\n", 1499 parser.file.toLatin1().constData(), parser.line_no); 1500 } else if (MetaMakefileGenerator::modesForGenerator(gen.first(), 1501 &host_mode, &target_mode)) { 1502 if (Option::host_mode == Option::HOST_UNKNOWN_MODE) { 1503 Option::host_mode = host_mode; 1504 Option::applyHostMode(); 1505 } 1506 1507 if (Option::target_mode == Option::TARG_UNKNOWN_MODE) { 1508 const QStringList &tgt = base_vars.value("TARGET_PLATFORM"); 1509 if (!tgt.isEmpty()) { 1510 const QString &os = tgt.first(); 1511 if (os == "unix") 1512 Option::target_mode = Option::TARG_UNIX_MODE; 1513 else if (os == "macx") 1514 Option::target_mode = Option::TARG_MACX_MODE; 1515 else if (os == "symbian") 1516 Option::target_mode = Option::TARG_SYMBIAN_MODE; 1517 else if (os == "win32") 1518 Option::target_mode = Option::TARG_WIN_MODE; 1519 else 1520 fprintf(stderr, "Unknown target platform specified: %s\n", 1521 os.toLatin1().constData()); 1522 } else { 1523 Option::target_mode = target_mode; 1524 } 1525 } 1526 } 1527 } 1528 } 1529 1598 1530 bool 1599 1531 QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QStringList> *place) … … 1608 1540 return false; 1609 1541 1542 if (x == "unix") { 1543 validateModes(); 1544 return Option::target_mode == Option::TARG_UNIX_MODE 1545 || Option::target_mode == Option::TARG_MACX_MODE 1546 || Option::target_mode == Option::TARG_SYMBIAN_MODE; 1547 } else if (x == "macx" || x == "mac") { 1548 validateModes(); 1549 return Option::target_mode == Option::TARG_MACX_MODE; 1550 } else if (x == "symbian") { 1551 validateModes(); 1552 return Option::target_mode == Option::TARG_SYMBIAN_MODE; 1553 } else if (x == "win32") { 1554 validateModes(); 1555 return Option::target_mode == Option::TARG_WIN_MODE; 1556 } 1557 1558 //mkspecs 1610 1559 static QString spec; 1611 1560 if(spec.isEmpty()) 1612 1561 spec = QFileInfo(Option::mkfile::qmakespec).fileName(); 1613 1614 // Symbian is an exception to how scopes are resolved. Since we do not1615 // have a separate target mode for Symbian, but we expect the scope to resolve1616 // on other platforms we base it entirely on the mkspec. This means that1617 // using a mkspec starting with 'symbian*' will resolve both the 'symbian'1618 // and the 'unix' (because of Open C) scopes to true.1619 if(isForSymbian() && (x == "symbian" || x == "unix"))1620 return true;1621 1622 //mkspecs1623 if((Option::target_mode == Option::TARG_MACX_MODE ||1624 Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix")1625 return !isForSymbian();1626 else if(Option::target_mode == Option::TARG_MACX_MODE && x == "macx")1627 return !isForSymbian();1628 else if(Option::target_mode == Option::TARG_MAC9_MODE && x == "mac9")1629 return !isForSymbian();1630 else if((Option::target_mode == Option::TARG_MAC9_MODE || Option::target_mode == Option::TARG_MACX_MODE) &&1631 x == "mac")1632 return !isForSymbian();1633 else if(Option::target_mode == Option::TARG_WIN_MODE && x == "win32")1634 return !isForSymbian();1635 1562 else if(Option::target_mode == Option::TARG_OS2_MODE && x == "os2") 1636 1563 return true; … … 1723 1650 static QStringList *feature_roots = 0; 1724 1651 if(!feature_roots) { 1725 init_symbian(base_vars);1652 validateModes(); 1726 1653 feature_roots = new QStringList(qmake_feature_paths(prop)); 1727 1654 qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots); … … 1804 1731 return IncludeFailure; 1805 1732 } 1806 file = file.right(file.length() - di - 1);1807 1733 } 1808 1734 bool parsed = false; … … 1824 1750 proj.doProjectInclude("default", IncludeFlagFeature, proj.variables()); 1825 1751 #endif 1826 parsed = proj.read(file, proj.variables()); 1752 parsed = proj.read(file, proj.variables()); // parse just that file (fromfile, infile) 1827 1753 } else { 1828 parsed = proj.read(file); 1754 parsed = proj.read(file); // parse all aux files (load/include into) 1829 1755 } 1830 1756 place = proj.variables(); … … 1894 1820 args += args_list[i].join(QString(Option::field_sep)); 1895 1821 1896 ExpandFunc func_t = qmake_expandFunctions().value(func.toLower()); 1822 ExpandFunc func_t = qmake_expandFunctions().value(func); 1823 if (!func_t && (func_t = qmake_expandFunctions().value(func.toLower()))) 1824 warn_msg(WarnDeprecated, "%s:%d: Using uppercased builtin functions is deprecated.", 1825 parser.file.toLatin1().constData(), parser.line_no); 1897 1826 debug_msg(1, "Running project expand: %s(%s) [%d]", 1898 1827 func.toLatin1().constData(), args.join("::").toLatin1().constData(), func_t); … … 2148 2077 parser.file.toLatin1().constData(), parser.line_no); 2149 2078 } else { 2150 QMakeProjectEnv env(place);2151 2079 char buff[256]; 2152 2080 bool singleLine = true; … … 2252 2180 for(int d = 0; d < dirs.count(); d++) { 2253 2181 QString dir = dirs[d]; 2254 if(!dir.isEmpty() && !dir.endsWith( Option::dir_sep))2182 if(!dir.isEmpty() && !dir.endsWith(QDir::separator())) 2255 2183 dir += "/"; 2256 2184 … … 2274 2202 fprintf(stderr, "%s:%d prompt(question) requires one argument.\n", 2275 2203 parser.file.toLatin1().constData(), parser.line_no); 2276 } else if(p rojectFile()== "-") {2204 } else if(pfile == "-") { 2277 2205 fprintf(stderr, "%s:%d prompt(question) cannot be used when '-o -' is used.\n", 2278 2206 parser.file.toLatin1().constData(), parser.line_no); … … 2308 2236 parser.file.toLatin1().constData(), parser.line_no); 2309 2237 } else { 2310 //QString target = args[0]; 2311 int size = values(args[0]).size(); 2238 int size = values(args[0], place).size(); 2312 2239 ret += QString::number(size); 2313 2240 } … … 2437 2364 test += *(d+d_off); 2438 2365 if(!test.isEmpty()) { 2439 const bool success = doProjectTest(test, place); 2440 test = ""; 2441 if(or_op) 2442 ret = ret || success; 2443 else 2444 ret = ret && success; 2366 if (or_op != ret) 2367 ret = doProjectTest(test, place); 2368 test.clear(); 2445 2369 } 2446 2370 if(*(d+d_off) == QLatin1Char(':')) { … … 2474 2398 //regular expression I guess 2475 2399 QString dirstr = qmake_getpwd(); 2476 int slsh = file.lastIndexOf( Option::dir_sep);2400 int slsh = file.lastIndexOf(QDir::separator()); 2477 2401 if(slsh != -1) { 2478 2402 dirstr = file.left(slsh+1); … … 2545 2469 } 2546 2470 return false; } 2547 case T_SYSTEM: { 2548 bool setup_env = true; 2471 case T_SYSTEM: 2549 2472 if(args.count() < 1 || args.count() > 2) { 2550 2473 fprintf(stderr, "%s:%d: system(exec) requires one argument.\n", parser.file.toLatin1().constData(), … … 2554 2477 if(args.count() == 2) { 2555 2478 const QString sarg = args[1]; 2556 setup_env = (sarg.toLower() == "true" || sarg.toInt()); 2557 } 2558 QMakeProjectEnv env; 2559 if(setup_env) 2560 env.execute(place); 2561 bool ret = system(args[0].toLatin1().constData()) == 0; 2562 return ret; } 2479 if (sarg.toLower() == "true" || sarg.toInt()) 2480 warn_msg(WarnParser, "%s:%d: system()'s second argument is now hard-wired to false.\n", 2481 parser.file.toLatin1().constData(), parser.line_no); 2482 } 2483 return system(args[0].toLatin1().constData()) == 0; 2563 2484 case T_RETURN: 2564 2485 if(function_blocks.isEmpty()) { … … 2575 2496 if(iterator) 2576 2497 iterator->cause_break = true; 2577 else if(!scope_blocks.isEmpty())2578 scope_blocks.top().ignore = true;2579 2498 else 2580 2499 fprintf(stderr, "%s:%d unexpected break()\n", … … 2791 2710 #endif 2792 2711 return true; } 2712 case T_OPTION: 2713 if (args.count() != 1) { 2714 fprintf(stderr, "%s:%d: option() requires one argument.\n", 2715 parser.file.toLatin1().constData(), parser.line_no); 2716 return false; 2717 } 2718 if (args.first() == "recursive") { 2719 recursive = true; 2720 } else { 2721 fprintf(stderr, "%s:%d: unrecognized option() argument '%s'.\n", 2722 parser.file.toLatin1().constData(), parser.line_no, 2723 args.first().toLatin1().constData()); 2724 return false; 2725 } 2726 return true; 2793 2727 default: 2794 2728 fprintf(stderr, "%s:%d: Unknown test function: %s\n", parser.file.toLatin1().constData(), parser.line_no, … … 3012 2946 break; 3013 2947 } 2948 } 2949 if(!escape && !backslashWarned) { 2950 backslashWarned = true; 2951 warn_msg(WarnDeprecated, "%s:%d: Unescaped backslashes are deprecated.", 2952 parser.file.toLatin1().constData(), parser.line_no); 3014 2953 } 3015 2954 if(escape || !replaced) … … 3090 3029 if(!Option::user_template_prefix.isEmpty() && !orig_template.startsWith(Option::user_template_prefix)) 3091 3030 real_template = Option::user_template_prefix + orig_template; 3092 if(real_template.endsWith(".t"))3093 real_template = real_template.left(real_template.length()-2);3094 3031 if(!real_template.isEmpty()) { 3095 3032 var = ".BUILTIN." + var; … … 3206 3143 if (place[var].isEmpty()) 3207 3144 return values("DIR_SEPARATOR", place); 3145 } else if (var == QLatin1String("QMAKE_EXT_OBJ")) { 3146 if (place[var].isEmpty()) { 3147 var = ".BUILTIN." + var; 3148 place[var] = QStringList(Option::obj_ext); 3149 } 3150 } else if (var == QLatin1String("QMAKE_QMAKE")) { 3151 if (place[var].isEmpty()) 3152 place[var] = QStringList(Option::fixPathToTargetOS( 3153 !Option::qmake_abslocation.isEmpty() 3154 ? Option::qmake_abslocation 3155 : QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake", 3156 false)); 3208 3157 } else if (var == QLatin1String("EPOCROOT")) { 3209 3158 if (place[var].isEmpty()) 3210 place[var] = QStringList(epocRoot()); 3211 } 3159 place[var] = QStringList(qt_epocRoot()); 3160 } 3161 #if defined(Q_OS_WIN32) && defined(Q_CC_MSVC) 3162 else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) { 3163 QString ret, type = var.mid(13); 3164 if(type == "arch") { 3165 QString paths = qgetenv("PATH"); 3166 QString vcBin64 = qgetenv("VCINSTALLDIR").append("\\bin\\amd64"); 3167 QString vcBinX86_64 = qgetenv("VCINSTALLDIR").append("\\bin\\x86_amd64"); 3168 if(paths.contains(vcBin64,Qt::CaseInsensitive) || paths.contains(vcBinX86_64,Qt::CaseInsensitive)) 3169 ret = "x86_64"; 3170 else 3171 ret = "x86"; 3172 } 3173 place[var] = QStringList(ret); 3174 } 3175 #endif 3212 3176 //qDebug("REPLACE [%s]->[%s]", qPrintable(var), qPrintable(place[var].join("::"))); 3213 3177 return place[var]; 3214 3178 } 3215 3179 3180 bool QMakeProject::isEmpty(const QString &v) 3181 { 3182 QMap<QString, QStringList>::ConstIterator it = vars.constFind(varMap(v)); 3183 return it == vars.constEnd() || it->isEmpty(); 3184 } 3185 3216 3186 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.