Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
5.12.2
-
None
-
qmake --version
QMake version 3.1
Using Qt version 5.12.2 in /usr/lib/x86_64-linux-gnu
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)
#: hello.pro
include(other.pri)
SOURCES += main.cpp
#: other.pri
linux
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.