Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Makefile.*
*.user.*
*.o
moc_*.cpp
ui/
ui_*.h
moc_predefs.h
.qm/
Expand Down
6 changes: 4 additions & 2 deletions Jamulus.pro
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ win32 {
# It doesn't work with multiple targets or architectures.
RESOURCES += src/resources.qrc

UI_DIR += ui

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI: Self-healing form of that cleanup — qmake deletes the leftovers while the project file is parsed, before it resolves the includes:

Suggested change
UI_DIR += ui
UI_DIR += ui
# A tree built in place before UI_DIR was set still has ui_*.h in its root, and
# those win: INCPATH lists the source and build roots ahead of -I$$UI_DIR, and
# qmake resolves the include when it writes the Makefile, so the stale copy
# stays bound to every object until it is deleted.
STALE_UI_HEADERS = $$files($$PWD/ui_*.h) $$files($$OUT_PWD/ui_*.h)
STALE_UI_HEADERS = $$unique(STALE_UI_HEADERS)
for (stale, STALE_UI_HEADERS) {
message("Removing stale generated UI header: $$stale")
system($$QMAKE_DEL_FILE $$shell_quote($$shell_path($$stale)))
}

Both roots go to $$files() because a shadow build lists the source root ahead of even -I., so a source tree left dirty by an old in-place build shadows an otherwise clean build directory; $$unique() keeps the in-place case, where the two paths are the same, from deleting twice.

On a tree that had already built in place, one qmake prints 6 removals and moves all 76 generated-header dependency entries in Makefile.Release from ui_*.h to ui/ui_*.h, and an edit to src/aboutdlgbase.ui then reaches the linked binary. On a fresh checkout nothing is removed and the counts are unchanged. Back on main there is no -Iui, so a leftover ui/ is never searched.

Linux Qt 5.15.13 / g++ and macOS Qt 5.15.2 / clang. Windows was not exercised: the system() call running $$QMAKE_DEL_FILE is the part to check there.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is going to be a variable, best to use it in DISTCLEAN_DIRS below to prevent drift.


FORMS_GUI = src/aboutdlgbase.ui \
src/serverdlgbase.ui

Expand Down Expand Up @@ -1213,9 +1215,9 @@ android {
for (abi, ANDROID_ABIS) {
DISTCLEAN_DIRS += debug-$${abi} release-$${abi}
}
DISTCLEAN_DIRS += .qm
DISTCLEAN_DIRS += ui .qm
} else {
DISTCLEAN_DIRS += debug release .qm
DISTCLEAN_DIRS += debug release ui .qm
}

win32 {
Expand Down
Loading