From fd1369d8fcda295af879e5db5e28099881f6ca4a Mon Sep 17 00:00:00 2001 From: "Maciej S. Szmigiero" Date: Sun, 29 Sep 2019 00:31:33 +0200 Subject: Make sure main/qtpass actually depends on libqtpass.a Currently, if one changes some source file in src and then runs make the libqtpass.a gets correctly rebuilt, however main/qtpass isn't actually relinked to make use of this new library version. According to the qmake project file snippet at the very bottom of https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html internal static libraries need to be manually added to their users PRE_TARGETDEPS, too. The same goes for tests that link to libqtpass.a. --- main/main.pro | 2 ++ tests/auto/ui/ui.pro | 1 + tests/auto/util/util.pro | 1 + 3 files changed, 4 insertions(+) diff --git a/main/main.pro b/main/main.pro index 515dfcf9..64cf8200 100644 --- a/main/main.pro +++ b/main/main.pro @@ -5,6 +5,8 @@ QT += core gui CONFIG += c++11 LIBS = -L"$$OUT_PWD/../src/$(OBJECTS_DIR)" -lqtpass $$LIBS +clang|gcc:PRE_TARGETDEPS += "$$OUT_PWD/../src/$(OBJECTS_DIR)/libqtpass.a" + INCLUDEPATH += ../src macx { diff --git a/tests/auto/ui/ui.pro b/tests/auto/ui/ui.pro index a7324599..7949d49a 100644 --- a/tests/auto/ui/ui.pro +++ b/tests/auto/ui/ui.pro @@ -3,6 +3,7 @@ SOURCES += tst_ui.cpp LIBS = -L"$$OUT_PWD/../../../src/$(OBJECTS_DIR)" -lqtpass $$LIBS +clang|gcc:PRE_TARGETDEPS += "$$OUT_PWD/../../../src/$(OBJECTS_DIR)/libqtpass.a" HEADERS += passworddialog.h \ passwordconfiguration.h diff --git a/tests/auto/util/util.pro b/tests/auto/util/util.pro index 89aa15be..41fd89cb 100644 --- a/tests/auto/util/util.pro +++ b/tests/auto/util/util.pro @@ -3,6 +3,7 @@ SOURCES += tst_util.cpp \ LIBS = -L"$$OUT_PWD/../../../src/$(OBJECTS_DIR)" -lqtpass $$LIBS +clang|gcc:PRE_TARGETDEPS += "$$OUT_PWD/../../../src/$(OBJECTS_DIR)/libqtpass.a" HEADERS += util.h \ filecontent.h -- cgit v1.2.3