Changeset 992


Ignore:
Timestamp:
Aug 16, 2011, 6:51:56 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: Reverted r976 and reapplied r804.

Adding dependencies to Makefiles themselves doesn't solve all
problems since sometimes the proper .prl file is created not at
the relevant subdir target's Makefile generation time but at a later
stage, when that subdir is built (which may also involve nested
subdirs). So we simply disable parallelism for subdirs Makefiles
at all again.

Location:
trunk/qmake/generators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/generators/makefile.cpp

    r978 r992  
    24652465    }
    24662466
    2467     QString prev_mkfile;
    2468 
    24692467    // generate target rules
    24702468    for(int target = 0; target < targets.size(); ++target) {
     
    25132511            if(out.startsWith(out_directory))
    25142512                out = out.mid(out_directory.length());
    2515             t << mkfile << ": ";
    2516             if(flags & SubTargetOrdered) {
    2517                 // ensure Makefile generation order as the dependent project may
    2518                 // need a .prl file from the one it depends on in order to
    2519                 // generate a correct library name if version suffixes are used
    2520                 if (!prev_mkfile.isEmpty())
    2521                     t << prev_mkfile;
    2522                 prev_mkfile = mkfile;
    2523             }
    2524             t << "\n\t";
     2513            t << mkfile << ": " << "\n\t";
    25252514            if(!in_directory.isEmpty()) {
    25262515                t << mkdir_p_asstring(out_directory)
     
    25322521            }
    25332522            t << subtarget->target << "-qmake_all: ";
    2534             if(flags & SubTargetOrdered) {
    2535                 // ensure Makefile generation order, see above
    2536                 if(target)
    2537                     t << targets.at(target-1)->target << "-qmake_all";
    2538             }
    25392523            if(project->isEmpty("QMAKE_NOFORCE"))
    25402524                t <<  " FORCE";
  • trunk/qmake/generators/os2/gnumake.cpp

    r977 r992  
    360360    else if(project->first("TEMPLATE") == "subdirs") {
    361361        writeSubDirs(t);
     362        if (project->isActiveConfig("ordered")) {
     363            // Ordered builds are usually used when one sub-project links to
     364            // another sub-project's library. Sometimes detecting the proper
     365            // library name (e.g. the version suffix) requires at least a .prl
     366            // for that library to exist. The .prl is created by qmake at Makefile
     367            // generation time and these qmake calls are not actually ordered at
     368            // dependency level so in case of parallel builds they may get
     369            // executed simultaneously which breaks the build. It is not really
     370            // possible to order them using dependencies because there are usually
     371            // several target's flavors all depending on its Makefile and it's
     372            // impossible to detect which flavor of the "parent" target this
     373            // make file should depend on (depending on the "parent"'s Makefile
     374            // is not enough because the required libraries may be generated by
     375            // its own sub-projects at a later stage). One case showing this
     376            // behavior is designer.exe depending on QtDesignerComponents.lib.
     377            //
     378            // The only solution to this is to disable parallelism for subdirs
     379            // Makefiles completely. Which is not a big deal since "ordered"
     380            // implies sequential building any way.
     381            t << ".NOTPARALLEL:" << endl << endl;
     382        }
    362383        return true;
    363384    }
Note: See TracChangeset for help on using the changeset viewer.