diff options
Diffstat (limited to 'tests/postbuild/bic/gen.sh')
-rwxr-xr-x | tests/postbuild/bic/gen.sh | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/tests/postbuild/bic/gen.sh b/tests/postbuild/bic/gen.sh index dd148988..15de2b79 100755 --- a/tests/postbuild/bic/gen.sh +++ b/tests/postbuild/bic/gen.sh @@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## Copyright (C) 2022 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. @@ -29,9 +29,10 @@ if [ "$#" -lt 2 ]; then echo "$0 - Generates reference files for b/c autotest" - echo "Usage: $0 [module|-all] [platform]" + echo "Usage: $0 [module|qt=mod1,mod2,...|-all] [platform]" echo "Examples: $0 -all 5.1.0.macx-gcc-ppc32" echo " $0 QtGui 5.0.0.linux-gcc-ia32" + echo " $0 qt=QtGui,QtQuick 5.0.0.linux-gcc-amd64" exit 1 fi @@ -41,6 +42,21 @@ else modules="$1" fi +use_qt="" + +case "$1" in + qt=*) use_qt="yes" + # split qt=foo,bar,baz into ["qt", "foo,bar,baz"] + IFS="=" read -r -a split_qt <<-_EOF_ +$1 +_EOF_ + # split "foo,bar,baz" into ["foo", "bar", "baz"] + IFS="," read -r -a qt_modules <<-_EOF_ +${split_qt[1]} +_EOF_ +;; +esac + GCC_MAJOR=`echo '__GNUC__' | gcc -E - | tail -1` if [ $GCC_MAJOR -ge 8 ]; then @@ -49,15 +65,27 @@ else DUMP_CMDLINE=-fdump-class-hierarchy fi -for module in $modules; do - echo "#include <$module/$module>" >test.cpp - g++ -c -std=c++17 -I$QTDIR/include -DQT_NO_STL $DUMP_CMDLINE -fPIC test.cpp - mv test.cpp*.class $module.$2.txt +function remove_templates { # Remove template classes from the output perl -pi -e '$skip = 1 if (/^(Class|Vtable).*</); if ($skip) { $skip = 0 if (/^$/); $_ = ""; - }' $module.$2.txt -done + }' $1 +} +if [ "$use_qt" == "yes" ]; then + for qt_module in "${qt_modules[@]}"; do + echo -e "#include <$qt_module/$qt_module>\n" >> test.cpp + done + g++ -c -std=c++17 -I$QTDIR/include -DQT_NO_STL $DUMP_CMDLINE -fPIC test.cpp + mv test.cpp*.class qt.$2.txt + remove_templates qt.$2.txt +else + for module in $modules; do + echo "#include <$module/$module>" >test.cpp + g++ -c -std=c++17 -I$QTDIR/include -DQT_NO_STL $DUMP_CMDLINE -fPIC test.cpp + mv test.cpp*.class $module.$2.txt + remove_templates "$module.$2.txt" + done +fi |