qt5base-lts/tests/manual/lance/CMakeLists.txt
Marc Mutz 11d6932560 Mark all of Qt as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses in this and some other modules is still
extremely high, too high for anyone to tackle in a short amount of
time. Even if they're not concentrated in just a few TUs, we need to
make progress on a global QT_NO_FOREACH default, so grab the nettle
and stick to our strategy:

Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the
#undef QT_NO_FOREACH to indicate that these actually test the macro.

Task-number: QTBUG-115839
Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-08-19 05:19:42 +00:00

87 lines
2.7 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## lance Binary:
#####################################################################
qt_internal_add_manual_test(lance
SOURCES
../../baseline/shared/paintcommands.cpp ../../baseline/shared/paintcommands.h
interactivewidget.cpp interactivewidget.h
main.cpp
widgets.h
NO_PCH_SOURCES
interactivewidget.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
.
../../baseline/shared
LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::OpenGLWidgets
Qt::PrintSupport
Qt::Widgets
)
# Resources:
set(icons_resource_files
"enum.png"
"tools.png"
)
qt_internal_add_resource(lance "icons"
PREFIX
"/icons"
FILES
${icons_resource_files}
)
set(images_resource_files
"../../baseline/painting/images/alpha.png"
"../../baseline/painting/images/alpha2x2.png"
"../../baseline/painting/images/bitmap.png"
"../../baseline/painting/images/border.png"
"../../baseline/painting/images/borderimage.png"
"../../baseline/painting/images/dome_argb32.png"
"../../baseline/painting/images/dome_indexed.png"
"../../baseline/painting/images/dome_indexed_mask.png"
"../../baseline/painting/images/dome_mono.png"
"../../baseline/painting/images/dome_mono_128.png"
"../../baseline/painting/images/dome_mono_palette.png"
"../../baseline/painting/images/dome_rgb32.png"
"../../baseline/painting/images/dot.png"
"../../baseline/painting/images/face.png"
"../../baseline/painting/images/gam030.png"
"../../baseline/painting/images/gam045.png"
"../../baseline/painting/images/gam056.png"
"../../baseline/painting/images/gam100.png"
"../../baseline/painting/images/gam200.png"
"../../baseline/painting/images/image.png"
"../../baseline/painting/images/mask.png"
"../../baseline/painting/images/mask_100.png"
"../../baseline/painting/images/masked.png"
"../../baseline/painting/images/sign.png"
"../../baseline/painting/images/solid.png"
"../../baseline/painting/images/solid2x2.png"
"../../baseline/painting/images/struct-image-01.jpg"
"../../baseline/painting/images/struct-image-01.png"
"../../baseline/painting/images/zebra.png"
)
qt_internal_add_resource(lance "images"
PREFIX
"/"
BASE
"../../baseline/painting"
FILES
${images_resource_files}
)
## Scopes:
#####################################################################
qt_internal_extend_target(lance CONDITION TARGET Qt::OpenGL
LIBRARIES
Qt::OpenGL
)