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

Changing a .pri file is not picked by invocation to make

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.12.2
    • Build tools: qmake
    • None
    • qmake --version
      QMake version 3.1
      Using Qt version 5.12.2 in /usr/lib/x86_64-linux-gnu
    • Linux/X11

    Description

      Symptom:

      1. Run qmake to generate the Makefile
      2. Change QMAKE_CXXFLAGS inside a .pri file that is included in the .pro file
      3. Run "make"

      The Makefile is correctly regenerated and CXXFLAGS in the Makefile reflects the change.

      However, the C++ source files were not re-compiled.

      Analysis:

      The .o files in the generated Makefile do not depend on the Makefile itself. So even though the Makefile is regenerated, this does not trigger a remake of the object files.

      Comment:

      I hope this is considered a bug. If the answer is that one is supposed to re-run qmake after a change of a .pri file, my question would be: Why is there a rule to regenerate the Makefile in the first place?

      Files to reproduce the problem:
      $ tree
      .
      ├── hello.pro
      ├── main.cpp
      └── other.pri

      // main.cpp
      int main(void)

      { return 42; }

      #: hello.pro
      include(other.pri)
      SOURCES += main.cpp

      #: other.pri
      linux

      { QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function #: QMAKE_CXXFLAGS_WARN_ON += -W__THIS_DIAGNOSTIC_DOES_NOT_EXIST__ }

      How to reproduce:

      $ qmake

      $ make
      g++ -c -pipe -O2 -Wall -W -Wno-unused-function -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o main.cpp
      g++ -Wl,-O1 -o hello main.o -lQt5Gui -lQt5Core /usr/lib/x86_64-linux-gnu/libGL.so -lpthread

      $ ... change other.pri to include the -W__THIS_DIAGNOSTIC_DOES_NOT_EXIST ...

      $ make
      /usr/lib/qt5/bin/qmake -o Makefile hello.pro
      make: Nothing to be done for 'first'.

      As you see the Makefile was regenerated, but the main.cpp was not recompiled.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            t-qnective Tobias Rittweiler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes