Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57572

QMake doesn't treat source files as source files if it sees them in include

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.6.1
    • Build tools: qmake
    • None
    • Windows7 x64

      Someone probably decided to use regular expression to scan whole project and automatically exclude .c files that appear in include statement from list of compilation units. I see no reason for it, especially since it's undocumented and invisible to the end-user. The only difference is in the generated makefile.

      I have a special clause in my code that allows me to submit whole project as a single compilation unit to my universitie's upload system. The system is retarded and doesn't allow students to structure their homeworks, so I use that as a workaround. For example at the end of my "arrays.h" file, there's:

      #ifdef PREPROCESING_FOR_ODEVSYS
      #include "arrays.c"
      #endif

      This ifdef is does not pass when compiling in qtcreator, but you'd need more than a regular expression to detect that. When I removed this line, the qmake immediatelly added my arrays.c to makefile.

      I used this as a workaround:

      #ifdef PREPROCESING_FOR_ODEVSYS
      #define ARRAYS_C_QMAKE_IS_RETARDED "arrays.c"
      #include ARRAYS_C_QMAKE_IS_RETARDED
      #endif

      This is inconsistent, undocumented behavior in qmake. It needs to be either retracted or made consistent and apparent (eg. by a warning that source file was ignored).

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            buddenha Oswald Buddenhagen
            bugs everywhere MXXIV
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes