Changeset 844 for branches/vendor/nokia/qt/current/qmake/option.cpp
- Timestamp:
- May 3, 2011, 4:49:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vendor/nokia/qt/current/qmake/option.cpp
r767 r844 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 85 85 //all modes 86 86 QString Option::qmake_abslocation; 87 int Option::warn_level = WarnLogic ;87 int Option::warn_level = WarnLogic; 88 88 int Option::debug_level = 0; 89 89 QFile Option::output; 90 90 QString Option::output_dir; 91 bool Option::recursive = false;91 ; 92 92 QStringList Option::before_user_vars; 93 93 QStringList Option::after_user_vars; … … 97 97 QString Option::user_template_prefix; 98 98 QStringList Option::shellPath; 99 #if defined(Q_OS_WIN32) 100 Option::TARG_MODE Option::target_mode = Option::TARG_WIN_MODE; 101 #elif defined(Q_OS_MAC) 102 Option::TARG_MODE Option::target_mode = Option::TARG_MACX_MODE; 103 #else 104 Option::TARG_MODE Option::target_mode = Option::TARG_UNIX_MODE; 105 #endif 99 Option::HOST_MODE Option::host_mode = Option::HOST_UNKNOWN_MODE; 100 Option::TARG_MODE Option::target_mode = Option::TARG_UNKNOWN_MODE; 101 bool Option::target_mode_overridden = false; 106 102 107 103 //QMAKE_*_PROPERTY stuff … … 127 123 static Option::QMAKE_MODE default_mode(QString progname) 128 124 { 129 int s = progname.lastIndexOf( Option::dir_sep);125 int s = progname.lastIndexOf(); 130 126 if(s != -1) 131 127 progname = progname.right(progname.length() - (s + 1)); … … 135 131 return Option::QMAKE_QUERY_PROPERTY; 136 132 return Option::QMAKE_GENERATE_MAKEFILE; 133 134 135 136 137 138 139 140 141 142 143 144 145 146 137 147 } 138 148 … … 161 171 "\n" 162 172 "Warnings Options:\n" 163 " -Wnone Turn off all warnings\n" 173 " -Wnone Turn off all warnings; specific ones may be re-enabled by\n" 174 " later -W options\n" 164 175 " -Wall Turn on all warnings\n" 165 176 " -Wparser Turn on parser warnings\n" 166 " -Wlogic Turn on logic warnings\n" 177 " -Wlogic Turn on logic warnings (on by default)\n" 178 " -Wdeprecated Turn on deprecation warnings (on by default)\n" 167 179 "\n" 168 180 "Options:\n" … … 171 183 " * before [files]. *\n" 172 184 " -o file Write output to file\n" 173 " -unix Run in unix mode\n"174 " -win32 Run in win32 mode\n"175 " -macx Run in Mac OS X mode\n"176 185 " -d Increase debug level\n" 177 186 " -t templ Overrides TEMPLATE as templ\n" … … 210 219 bool specified = true; 211 220 if(opt == "project") { 212 Option::recursive = true;221 Option::recursive = ; 213 222 Option::qmake_mode = Option::QMAKE_GENERATE_PROJECT; 214 223 } else if(opt == "prl") { … … 237 246 } else if(opt == "tp" || opt == "template_prefix") { 238 247 Option::user_template_prefix = argv[++x]; 239 } else if(opt == "mac9") {240 Option::target_mode = TARG_MAC9_MODE;241 248 } else if(opt == "macx") { 249 250 242 251 Option::target_mode = TARG_MACX_MODE; 252 243 253 } else if(opt == "unix") { 254 255 244 256 Option::target_mode = TARG_UNIX_MODE; 257 245 258 } else if(opt == "win32") { 259 260 246 261 Option::target_mode = TARG_WIN_MODE; 262 247 263 } else if(opt == "d") { 248 264 Option::debug_level++; … … 265 281 } else if(opt == "Wlogic") { 266 282 Option::warn_level |= WarnLogic; 283 284 267 285 } else if(opt == "Wnone") { 268 286 Option::warn_level = WarnNone; 269 287 } else if(opt == "r" || opt == "recursive") { 270 Option::recursive = true;271 } else if(opt == "n orecursive") {272 Option::recursive = false;288 Option::recursive = ; 289 } else if(opt == "norecursive") { 290 Option::recursive = ; 273 291 } else if(opt == "config") { 274 292 Option::user_configs += argv[++x]; … … 287 305 Option::mkfile::do_dep_heuristics = false; 288 306 } else if(opt == "E") { 307 289 308 Option::mkfile::do_preprocess = true; 290 309 } else if(opt == "cache") { … … 323 342 arg = fi.filePath(); 324 343 if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || 325 Option::qmake_mode == Option::QMAKE_GENERATE_PRL) 344 Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { 345 if(fi.isDir()) { 346 QString proj = detectProjectFile(arg); 347 if (!proj.isNull()) 348 arg = proj; 349 } 326 350 Option::mkfile::project_files.append(arg); 327 else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)351 328 352 Option::projfile::project_dirs.append(arg); 329 else353 330 354 handled = false; 355 331 356 } 332 357 if(!handled) { … … 388 413 Option::dirlist_sep = ";"; 389 414 Option::shellPath = detectShellPath(); 415 390 416 #else 391 417 Option::dirlist_sep = ":"; 418 392 419 #endif 393 420 Option::sysenv_mod = "QMAKE_ENV_"; … … 495 522 //try REALLY hard to do it for them, lazy.. 496 523 if(Option::mkfile::project_files.isEmpty()) { 497 QString pwd = qmake_getpwd(), 498 proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext; 499 if(QFile::exists(proj)) { 524 QString proj = detectProjectFile(qmake_getpwd()); 525 if(!proj.isNull()) 500 526 Option::mkfile::project_files.append(proj); 501 } else { //last try..502 QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext));503 if(profiles.count() == 1)504 Option::mkfile::project_files.append(pwd + "/" + profiles[0]);505 }506 527 #ifndef QT_BUILD_QMAKE_LIBRARY 507 528 if(Option::mkfile::project_files.isEmpty()) { … … 511 532 #endif 512 533 } 534 535 536 537 538 539 540 541 542 543 544 513 545 } 514 546 515 547 //defaults for globals 516 if(Option::target_mode == Option::TARG_WIN_MODE) { 517 Option::dir_sep = "\\"; 518 Option::obj_ext = ".obj"; 519 Option::res_ext = ".res"; 520 } else { 521 if(Option::target_mode == Option::TARG_MAC9_MODE) 522 Option::dir_sep = ":"; 523 else 524 Option::dir_sep = "/"; 525 Option::obj_ext = ".o"; 526 } 527 Option::qmake_abslocation = Option::fixPathToTargetOS(Option::qmake_abslocation); 548 if (Option::host_mode != Option::HOST_UNKNOWN_MODE) 549 applyHostMode(); 528 550 return QMAKE_CMDLINE_SUCCESS; 551 552 553 554 555 556 557 558 559 560 561 529 562 } 530 563 … … 585 618 Option::fixString(QString string, uchar flags) 586 619 { 587 const QString orig_string = string;620 const QString orig_string = string; 588 621 static QHash<FixStringCacheKey, QString> *cache = 0; 589 622 if(!cache) {
Note:
See TracChangeset
for help on using the changeset viewer.
