// Copyright (C) 2026 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qt-cmake-policy-qtp0006.html
\ingroup qt-cmake-policies
\since 6.12
\title QTP0006
\keyword qt_cmake_policy_qtp0006

\summary {Enables \c{PRIVATE_CODE} as the default for Wayland protocol source generation.}

This policy was introduced in Qt 6.12. The policy affects the behavior of
\l{qt_generate_wayland_protocol_client_sources} and
\l{qt_generate_wayland_protocol_server_sources} when called without
\c{PRIVATE_CODE} or \c{PUBLIC_CODE}.

If the policy is set to \c OLD, and neither \c{PUBLIC_CODE} nor \c{PRIVATE_CODE}
is passed, the function behaves as if \c{PUBLIC_CODE} was passed and a
deprecation warning is emitted.

If the policy is set to \c NEW, and neither \c{PUBLIC_CODE} nor \c{PRIVATE_CODE}
is passed, the function behaves as if \c{PRIVATE_CODE} was passed and no
deprecation warning is emitted.

When the policy is not set, and neither \c{PUBLIC_CODE} nor \c{PRIVATE_CODE} is
passed, an \c{AUTHOR_WARNING} is emitted and the function behaves as if
\c{PUBLIC_CODE} was passed for backwards compatibility.

For example, the following code does not pass \c{PUBLIC_CODE} or \c{PRIVATE_CODE}.
Because QTP0006 is not set, an \c{AUTHOR_WARNING} is emitted:
\badcode
# QTP0006 not set — AUTHOR_WARNING is emitted
qt_generate_wayland_protocol_client_sources(MyTarget
    FILES myprotocol.xml
)
\endcode

If you set QTP0006 to \c NEW before the call, the function behaves as if
\c{PRIVATE_CODE} was passed and no warning is emitted:
\badcode
qt_policy(SET QTP0006 NEW)
qt_generate_wayland_protocol_client_sources(MyTarget
    FILES myprotocol.xml
)
\endcode

The same policy behaviour applies to \l{qt_generate_wayland_protocol_server_sources}.

\qtpolicydeprecatedbehavior

\sa qt_policy, {Qt CMake policies}, qt_generate_wayland_protocol_client_sources,
    qt_generate_wayland_protocol_server_sources

*/
