Changeset 94


Ignore:
Timestamp:
Jul 29, 2009, 6:57:31 PM (11 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake/OS/2: Added DEFINES_RSP file generation to overcome command line length limitation when calling moc (#23).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mkspecs/features/moc.prf

    r2 r94  
    22#global defaults
    33isEmpty(QMAKE_MOC) {
    4     win32:QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe
     4    win32|os2:QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe
    55    else:QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
    66}
     
    1111# This function on Windows puts the includes into a .inc file which moc will read, if the project
    1212# has more than 30 includes. We do this to overcome a command-line limit on Win < XP
    13 # Otherwise the function simply returns the normal command-line for moc
     13# Otherwise the function simply returns the normal command-line for moc. On OS/2
     14# (where similar command line length restrictions apply) the function does a similar
     15# substitiution using response files defined in mkspecs/os2-*/qmake.conf (which are
     16# also used by the compiler andn other tools)
    1417defineReplace(mocCmd) {
    1518    win32:count($$list($$INCPATH), 40, >) {
     
    3437        RET += $$QMAKE_MOC $(DEFINES) @$$INCLUDETEMP $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$1 -o $$2
    3538        return($$RET)
     39    }
     40    os2 {
     41        isEmpty(QMAKE_INCPATH_RSP_VAR):I = $(INCPATH)
     42        else:I = @$($$QMAKE_INCPATH_RSP_VAR)
     43        isEmpty(QMAKE_DEFINES_RSP_VAR):D = $(INCPATH)
     44        else:D = @$($$QMAKE_DEFINES_RSP_VAR)
     45
     46        return($$QMAKE_MOC $$D $$I $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$1 -o $$2)
    3647    }
    3748    return($$QMAKE_MOC $(DEFINES) $(INCPATH) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$1 -o $$2)
  • trunk/mkspecs/os2-g++/qmake.conf

    r90 r94  
    5959    QMAKE_CFLAGS_RSP_VAR    = CFLAGS_RSP
    6060    QMAKE_CXXFLAGS_RSP_VAR  = CXXFLAGS_RSP
     61    QMAKE_DEFINES_RSP_VAR   = DEFINES_RSP
    6162    QMAKE_INCPATH_RSP_VAR   = INCPATH_RSP
    6263    QMAKE_OBJECTS_RSP_VAR   = OBJECTS_RSP
    63     QMAKE_RUN_CC        = $(CC) -c @$(CFLAGS_RSP) @$(INCPATH_RSP) -o $obj $src
    64     QMAKE_RUN_CC_IMP    = $(CC) -c @$(CFLAGS_RSP) @$(INCPATH_RSP) -o $@ $<
    65     QMAKE_RUN_CXX       = $(CXX) -c @$(CXXFLAGS_RSP) @$(INCPATH_RSP) -o $obj $src
    66     QMAKE_RUN_CXX_IMP   = $(CXX) -c @$(CXXFLAGS_RSP) @$(INCPATH_RSP) -o $@ $<
     64    QMAKE_RUN_CC        = $(CC) -c @$(CFLAGS_RSP) @$(DEFINES_RSP) @$(INCPATH_RSP) -o $obj $src
     65    QMAKE_RUN_CC_IMP    = $(CC) -c @$(CFLAGS_RSP) @$(DEFINES_RSP) @$(INCPATH_RSP) -o $@ $<
     66    QMAKE_RUN_CXX       = $(CXX) -c @$(CXXFLAGS_RSP) @$(DEFINES_RSP) @$(INCPATH_RSP) -o $obj $src
     67    QMAKE_RUN_CXX_IMP   = $(CXX) -c @$(CXXFLAGS_RSP) @$(DEFINES_RSP) @$(INCPATH_RSP) -o $@ $<
    6768    QMAKE_OBJECTS_REF   = @$(OBJECTS_RSP)
    6869}
  • trunk/qmake/generators/os2/gnumake.cpp

    r57 r94  
    535535void GNUMakefileGenerator::createCompilerResponseFiles(QTextStream &t)
    536536{
    537     static const char *vars[] = { "CFLAGS",   /*<=*/ "QMAKE_CFLAGS",
    538                                   "CXXFLAGS", /*<=*/ "QMAKE_CXXFLAGS",
    539                                   "INCPATH",  /*<=*/ "INCLUDEPATH" };
     537    static const char *vars[] = { "CFLAGS", "CXXFLAGS", "DEFINES", "INCPATH" };
    540538
    541539    /* QMAKE_XXX_RSP_VAR is used as a flag whether it is necessary to
     
    546544     * other places of qmake.conf (e.g. rules) */
    547545
    548     for (size_t i = 0; i < sizeof(vars)/sizeof(vars[0]); i+=2) {
     546    for (size_t i = 0; i < sizeof(vars)/sizeof(vars[0]); ++i) {
    549547        QString rspVar =
    550548            project->first(QString().sprintf("QMAKE_%s_RSP_VAR", vars[i]));
     
    555553            if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
    556554                QTextStream rt(&file);
    557                 if (!qstrcmp(vars[i+1], "INCLUDEPATH")) {
     555                if (!qstrcmp(vars[i], "CFLAGS")) {
     556                    rt << varGlue("QMAKE_CFLAGS", QString::null, "\n", "\n");
     557                } else if (!qstrcmp(vars[i], "CXXFLAGS")) {
     558                    rt << varGlue("QMAKE_CXXFLAGS", QString::null, "\n", "\n");
     559                } else if (!qstrcmp(vars[i], "DEFINES")) {
     560                    rt << varGlue("PRL_EXPORT_DEFINES", "-D", "\n-D", "\n")
     561                       << varGlue("DEFINES", "-D", "\n-D", "\n");
     562                } else if (!qstrcmp(vars[i], "INCPATH")) {
    558563                    QString opt = var("QMAKE_CFLAGS_INCDIR");
    559                     rt << varGlue(vars[i+1], opt, "\n" + opt, "\n");
     564                    rt << varGlue("INCLUDEPATH", opt, "\n" + opt, "\n");
    560565                } else {
    561                     rt << varGlue(vars[i+1], QString::null, "\n", "\n")
    562                        << varGlue("PRL_EXPORT_DEFINES", "-D", "\n-D", "\n")
    563                        << varGlue("DEFINES", "-D", "\n-D", "\n");
     566                    Q_ASSERT(false);
    564567                }
    565568                rt.flush();
Note: See TracChangeset for help on using the changeset viewer.