Qt Base (Core, Gui, Widgets, Network, ...)
Go to file
Alexandru Croitor 26f8dff7da CMake: Add warnings as errors support for example builds
We want to ensure we don't introduce new build warnings in examples.
We have a mechanism to enable warnings as errors for qt targets like
modules or plugins, but not for targets in example projects.

To enable this, we introduce a new internal target
PlatformExampleInternal, which is linked to all targets created
by qt_add_executable and qt_add_library-like functions in projects
in the <repo>/examples subdirectory.

The detection of targets in example projects is done by checking the
QT_INTERNAL_IS_EXAMPLE_EP_BUILD variable or the
QT_INTERNAL_IS_EXAMPLE_IN_TREE_BUILD variable. These are set either by
ExternalProject_Add in the case of external example projects, or by
qt_examples_build_begin in the case of in-tree example projects.

The PlatformExampleInternal target gets the same warnings as errors
flags as the other Platform*Internal targets.

To enable gradual adoption, the new feature is opt-in rather than
opt-out, on a per-repo basis. The QT_REPO_EXAMPLES_WARNINGS_CLEAN
variable can be set to TRUE in a repo's '.cmake.conf' file.

The warnings as errors behavior is controlled as usual by configuring
qt with -DWARNINGS_ARE_ERRORS=ON.

Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-108448
Change-Id: If62b47b205c111f2a1fec791e5bb6502f5b64f9c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-08-01 16:36:43 +02:00
.github/workflows
LICENSES Merge Wayland client from qtwayland repository into qtbase 2025-05-13 01:50:43 +02:00
bin CMake: Don't hard-code "libexec" in qt-configure-module 2024-08-16 12:36:35 +02:00
cmake CMake: Add warnings as errors support for example builds 2025-08-01 16:36:43 +02:00
coin Enable vcpkg usage for crosscompiled tests 2025-07-16 15:54:22 +02:00
config.tests CMake: Remove superfluous precompile_header feature and config test 2025-03-07 12:02:47 +01:00
dist Remove year from Qt Copyright in REUSE.toml 2025-07-09 15:16:21 +02:00
doc Doc: Update link from VxWorks to Qt Creator documentation when QC 17.0 is released 2025-07-31 12:35:04 +00:00
examples ImageGestures example: decide direction based on swipeAngle 2025-08-01 01:14:13 +02:00
lib
libexec Android: account for namespace = androidPackageName in runner script 2025-07-26 04:38:56 +03:00
mkspecs Remove relics of objc_namespace script 2025-07-31 20:35:05 +08:00
qmake Fail builds on Apple platforms with invalid Info.plist 2025-07-04 15:02:22 +02:00
src CMake: Add warnings as errors support for example builds 2025-08-01 16:36:43 +02:00
tests QUnifiedTimer: fix speed-modified delta calculation 2025-08-01 19:39:24 +08:00
util wasm: Properly separate lines in test output 2025-07-17 17:05:21 +02:00
.cmake.conf Bump minimum requirement for visionOS to version 2 2025-06-20 15:25:11 +02:00
.gitattributes
.gitignore Fix .gitignore to ignore any build dir under the repo or its subdirs 2025-07-22 19:12:39 +00:00
.gitreview Add .gitreview file 2025-03-24 23:19:04 +01:00
.tag
CMakeLists.txt CMake: Don't unconditionally enable the ASM language 2025-05-02 18:13:14 +02:00
REUSE.toml Add android tempaltes to the REUSE.toml 2025-07-10 16:13:27 +02:00
config_help.txt Make doc-snippets a "build part", ie -nomake/make doc-snippets 2025-07-30 16:01:51 +02:00
configure Do not assume FHS in scripts 2024-06-25 11:44:00 +02:00
configure.bat configure.bat: Use call when calling the helper cmake scripts 2025-01-30 22:18:36 +01:00
configure.cmake wasm: require wasm-exceptions for jspi 2025-07-17 13:57:57 +02:00
dependencies.yaml
licenseRule.json Fix typo in licenseRule.json 2025-07-04 16:43:53 +02:00
qt_cmdline.cmake Make doc-snippets a "build part", ie -nomake/make doc-snippets 2025-07-30 16:01:51 +02:00