diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-04-27 20:57:32 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-05 04:26:19 +0000 |
commit | dffca8bb0eac54a29248e5cbb69c35f85be333bf (patch) | |
tree | dd98da2053724464dfede918121f2f41a9b14cf1 /sync.profile | |
parent | 30067d102cbe517203ae693ff17083c5f0c3187f (diff) | |
download | qtbase-dffca8bb0eac54a29248e5cbb69c35f85be333bf.tar.gz |
Add a simple Qt 6/CMake-compatible script a la includemocs.py
Perl is dead and I don't speak Python, so if someone wants to port it,
be my guest. I needed something that I can use to roll out includemocs
across all Qt modules, and this is it. It works for me™, so I don't
expect to do much development with it.
This is an automated committer script I've been using so far:
# SRCDIR=~~~
# BUILDDIR=~~~~
cd $BUILDDIR
find */src -name mocs_compilation.cpp | while read FILE; do
if grep -qsE '^#include' "$FILE"; then
DIR="$(dirname "$FILE")"
LIB="$(basename "$DIR")"
case "$LIB" in
Q*)
LIB="${LIB%%_autogen}"
;;
*)
LIB="Qt${LIB%%_autogen}"
;;
esac
DIR="${DIR%/*}"
path/to/includemocs6.sh "$SRCROOT/$DIR" "$DIR" "$FILE"
(cd "$SRCROOT/$DIR" && git commit -am "$LIB: includemocs
$(cat "$SRCROOT/commit-msg.txt")" --no-edit)
fi
done
If the script cannot associate a moc file with a cpp file, it will
print a warning and continue.
The script tries to include the moc-file right after the
QT_END_NAMESPACE to work around many TUs ending in an #endif from some
#if QT_CONFIG or other. If there's no QT_END_NAMESPACE, it appends
the include and prints a warning.
Fixes: QTBUG-102886
Pick-to: 6.3 6.2
Change-Id: I16c5a9f845777ea2e82f15611b4fdd32f98ce0bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'sync.profile')
0 files changed, 0 insertions, 0 deletions