Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / prop_tgt / HIP_STANDARD.rst
1 HIP_STANDARD
2 ------------
3
4 .. versionadded:: 3.21
5
6 The HIP/C++ standard requested to build this target.
7
8 Supported values are:
9
10 ``98``
11   HIP C++98
12
13 ``11``
14   HIP C++11
15
16 ``14``
17   HIP C++14
18
19 ``17``
20   HIP C++17
21
22 ``20``
23   HIP C++20
24
25 ``23``
26   HIP C++23
27
28 ``26``
29   .. versionadded:: 3.25
30
31   HIP C++26. CMake 3.25 and later *recognize* ``26`` as a valid value,
32   no version has support for any compiler.
33
34 If the value requested does not result in a compile flag being added for
35 the compiler in use, a previous standard flag will be added instead.  This
36 means that using:
37
38 .. code-block:: cmake
39
40   set_property(TARGET tgt PROPERTY HIP_STANDARD 11)
41
42 with a compiler which does not support ``-std=gnu++11`` or an equivalent
43 flag will not result in an error or warning, but will instead add the
44 ``-std=gnu++98`` flag if supported.  This "decay" behavior may be controlled
45 with the :prop_tgt:`HIP_STANDARD_REQUIRED` target property.
46 Additionally, the :prop_tgt:`HIP_EXTENSIONS` target property may be used to
47 control whether compiler-specific extensions are enabled on a per-target basis.
48
49 See the :manual:`cmake-compile-features(7)` manual for information on
50 compile features and a list of supported compilers.
51
52 This property is initialized by the value of
53 the :variable:`CMAKE_HIP_STANDARD` variable if it is set when a target
54 is created.