Update upstream source from tag 'upstream/3.27.0_rc5'

Update to upstream version '3.27.0~rc5'
with Debian dir 1c3e1b7b6c
ci/unstable
Timo Röhling 2 years ago
commit c6c16d67fc

@ -197,6 +197,10 @@ syn keyword cmakeProperty contained
\ HAS_CXX \ HAS_CXX
\ HEADER_FILE_ONLY \ HEADER_FILE_ONLY
\ HELPSTRING \ HELPSTRING
\ HIP_ARCHITECTURES
\ HIP_EXTENSIONS
\ HIP_STANDARD
\ HIP_STANDARD_REQUIRED
\ IMPLICIT_DEPENDS_INCLUDE_TRANSFORM \ IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
\ IMPORTED \ IMPORTED
\ IMPORTED_COMMON_LANGUAGE_RUNTIME \ IMPORTED_COMMON_LANGUAGE_RUNTIME
@ -1150,6 +1154,74 @@ syn keyword cmakeVariable contained
\ CMAKE_GLOBAL_AUTORCC_TARGET \ CMAKE_GLOBAL_AUTORCC_TARGET
\ CMAKE_GLOBAL_AUTORCC_TARGET_NAME \ CMAKE_GLOBAL_AUTORCC_TARGET_NAME
\ CMAKE_GNUtoMS \ CMAKE_GNUtoMS
\ CMAKE_HIP
\ CMAKE_HIP_ANDROID_TOOLCHAIN_MACHINE
\ CMAKE_HIP_ANDROID_TOOLCHAIN_PREFIX
\ CMAKE_HIP_ANDROID_TOOLCHAIN_SUFFIX
\ CMAKE_HIP_ARCHITECTURES
\ CMAKE_HIP_ARCHIVE_APPEND
\ CMAKE_HIP_ARCHIVE_CREATE
\ CMAKE_HIP_ARCHIVE_FINISH
\ CMAKE_HIP_CLANG_TIDY
\ CMAKE_HIP_COMPILER
\ CMAKE_HIP_COMPILER_ABI
\ CMAKE_HIP_COMPILER_AR
\ CMAKE_HIP_COMPILER_ARCHITECTURE_ID
\ CMAKE_HIP_COMPILER_EXTERNAL_TOOLCHAIN
\ CMAKE_HIP_COMPILER_ID
\ CMAKE_HIP_COMPILER_LAUNCHER
\ CMAKE_HIP_COMPILER_LOADED
\ CMAKE_HIP_COMPILER_PREDEFINES_COMMAND
\ CMAKE_HIP_COMPILER_RANLIB
\ CMAKE_HIP_COMPILER_TARGET
\ CMAKE_HIP_COMPILER_VERSION
\ CMAKE_HIP_COMPILER_VERSION_INTERNAL
\ CMAKE_HIP_COMPILE_FEATURES
\ CMAKE_HIP_COMPILE_OBJECT
\ CMAKE_HIP_CPPCHECK
\ CMAKE_HIP_CPPLINT
\ CMAKE_HIP_CREATE_SHARED_LIBRARY
\ CMAKE_HIP_CREATE_SHARED_MODULE
\ CMAKE_HIP_CREATE_STATIC_LIBRARY
\ CMAKE_HIP_EXTENSIONS
\ CMAKE_HIP_FLAGS
\ CMAKE_HIP_FLAGS_DEBUG
\ CMAKE_HIP_FLAGS_DEBUG_INIT
\ CMAKE_HIP_FLAGS_INIT
\ CMAKE_HIP_FLAGS_MINSIZEREL
\ CMAKE_HIP_FLAGS_MINSIZEREL_INIT
\ CMAKE_HIP_FLAGS_RELEASE
\ CMAKE_HIP_FLAGS_RELEASE_INIT
\ CMAKE_HIP_FLAGS_RELWITHDEBINFO
\ CMAKE_HIP_FLAGS_RELWITHDEBINFO_INIT
\ CMAKE_HIP_IGNORE_EXTENSIONS
\ CMAKE_HIP_IMPLICIT_INCLUDE_DIRECTORIES
\ CMAKE_HIP_IMPLICIT_LINK_DIRECTORIES
\ CMAKE_HIP_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
\ CMAKE_HIP_IMPLICIT_LINK_LIBRARIES
\ CMAKE_HIP_INCLUDE_WHAT_YOU_USE
\ CMAKE_HIP_INIT
\ CMAKE_HIP_LIBRARY_ARCHITECTURE
\ CMAKE_HIP_LINKER_LAUNCHER
\ CMAKE_HIP_LINKER_PREFERENCE
\ CMAKE_HIP_LINKER_PREFERENCE_PROPAGATES
\ CMAKE_HIP_LINKER_WRAPPER_FLAG
\ CMAKE_HIP_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_HIP_LINK_EXECUTABLE
\ CMAKE_HIP_LINK_LIBRARY_FILE_FLAG
\ CMAKE_HIP_LINK_LIBRARY_FLAG
\ CMAKE_HIP_LINK_LIBRARY_SUFFIX
\ CMAKE_HIP_OUTPUT_EXTENSION
\ CMAKE_HIP_PLATFORM_ID
\ CMAKE_HIP_SIMULATE_ID
\ CMAKE_HIP_SIMULATE_VERSION
\ CMAKE_HIP_SIZEOF_DATA_PTR
\ CMAKE_HIP_SOURCE_FILE_EXTENSIONS
\ CMAKE_HIP_STANDARD
\ CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES
\ CMAKE_HIP_STANDARD_LIBRARIES
\ CMAKE_HIP_STANDARD_REQUIRED
\ CMAKE_HIP_VISIBILITY_PRESET
\ CMAKE_HOME_DIRECTORY \ CMAKE_HOME_DIRECTORY
\ CMAKE_HOST_APPLE \ CMAKE_HOST_APPLE
\ CMAKE_HOST_SOLARIS \ CMAKE_HOST_SOLARIS
@ -1502,6 +1574,7 @@ syn keyword cmakeVariable contained
\ CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA \ CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA
\ CMAKE_USER_MAKE_RULES_OVERRIDE_CXX \ CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
\ CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran \ CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran
\ CMAKE_USER_MAKE_RULES_OVERRIDE_HIP
\ CMAKE_USER_MAKE_RULES_OVERRIDE_Java \ CMAKE_USER_MAKE_RULES_OVERRIDE_Java
\ CMAKE_USER_MAKE_RULES_OVERRIDE_RC \ CMAKE_USER_MAKE_RULES_OVERRIDE_RC
\ CMAKE_USER_MAKE_RULES_OVERRIDE_Swift \ CMAKE_USER_MAKE_RULES_OVERRIDE_Swift
@ -2575,6 +2648,7 @@ syn keyword cmakeKWdoxygen_add_docs contained
syn keyword cmakeKWenable_language contained syn keyword cmakeKWenable_language contained
\ ASM \ ASM
\ CUDA \ CUDA
\ HIP
\ ISPC \ ISPC
\ OBJC \ OBJC
\ OBJCXX \ OBJCXX
@ -3317,6 +3391,7 @@ syn keyword cmakeKWproject contained
\ CMAKE_PROJECT_ \ CMAKE_PROJECT_
\ CUDA \ CUDA
\ DESCRIPTION \ DESCRIPTION
\ HIP
\ HOMEPAGE_URL \ HOMEPAGE_URL
\ ISPC \ ISPC
\ LANGUAGES \ LANGUAGES
@ -3630,6 +3705,9 @@ syn keyword cmakeKWtry_compile contained
\ EXECUTABLE \ EXECUTABLE
\ FALSE \ FALSE
\ GHS \ GHS
\ HIP_EXTENSIONS
\ HIP_STANDARD
\ HIP_STANDARD_REQUIRED
\ INCLUDE_DIRECTORIES \ INCLUDE_DIRECTORIES
\ LANG \ LANG
\ LINK_DIRECTORIES \ LINK_DIRECTORIES
@ -3749,6 +3827,9 @@ syn keyword cmakeGeneratorExpressions contained
\ GENERATE \ GENERATE
\ GENEX_EVAL \ GENEX_EVAL
\ GNU \ GNU
\ HIP_COMPILER_ID
\ HIP_COMPILER_VERSION
\ HIP_STANDARD
\ HOST_LINK \ HOST_LINK
\ IF \ IF
\ IGNORE \ IGNORE

@ -333,6 +333,15 @@ Most of the expressions in this section are closely associated with the
:command:`list` command, providing the same capabilities, but in :command:`list` command, providing the same capabilities, but in
the form of a generator expression. the form of a generator expression.
In each of the following list-related generator expressions, the ``list``
must not contain any commas if that generator expression expects something to
be provided after the ``list``. For example, the expression
``$<LIST:FIND,list,value>`` requires a ``value`` after the ``list``.
Since a comma is used to separate the ``list`` and the ``value``, the ``list``
cannot itself contain a comma. This restriction does not apply to the
:command:`list` command, it is specific to the list-handling generator
expressions only.
.. _GenEx List Comparisons: .. _GenEx List Comparisons:
List Comparisons List Comparisons
@ -354,133 +363,151 @@ List Queries
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the list's length. The number of items in the ``list``.
.. genex:: $<LIST:GET,list,index,...> .. genex:: $<LIST:GET,list,index,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the list of elements specified by indices from the list. Expands to the list of items specified by indices from the ``list``.
.. genex:: $<LIST:SUBLIST,list,begin,length> .. genex:: $<LIST:SUBLIST,list,begin,length>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a sublist of the given list. If <length> is 0, an empty list will be A sublist of the given ``list``. If ``length`` is 0, an empty list
returned. If <length> is -1 or the list is smaller than <begin>+<length> then will be returned. If ``length`` is -1 or the list is smaller than
the remaining elements of the list starting at <begin> will be returned. ``begin + length``, the remaining items of the list starting at
``begin`` will be returned.
.. genex:: $<LIST:FIND,list,value> .. genex:: $<LIST:FIND,list,value>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the index of the element specified in the list or -1 if it wasn't The index of the first item in ``list`` with the specified ``value``,
found. or -1 if ``value`` is not in the ``list``.
.. _GenEx List Transformations: .. _GenEx List Transformations:
List Transformations List Transformations
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
.. _GenEx LIST-JOIN:
.. genex:: $<LIST:JOIN,list,glue> .. genex:: $<LIST:JOIN,list,glue>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a string which joins the list with the content of the ``glue`` string Converts ``list`` to a single string with the content of the ``glue`` string
inserted between each item. inserted between each item. This is conceptually the same operation as
:genex:`$<JOIN:list,glue>`, but the two have different behavior with regard
to empty items. ``$<LIST:JOIN,list,glue>`` preserves all empty items,
whereas :genex:`$<JOIN:list,glue>` drops all empty items from the list.
.. genex:: $<LIST:APPEND,list,element,...> .. genex:: $<LIST:APPEND,list,item,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the elements appended. The ``list`` with each ``item`` appended. Multiple items should be
separated by commas.
.. genex:: $<LIST:PREPEND,list,element,...> .. genex:: $<LIST:PREPEND,list,item,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the elements inserted at the beginning of the list. The ``list`` with each ``item`` inserted at the beginning. If there are
multiple items, they should be separated by commas, and the order of the
prepended items will be preserved.
.. genex:: $<LIST:INSERT,list,index,element,...> .. genex:: $<LIST:INSERT,list,index,item,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the elements inserted at the specified index. It is an The ``list`` with the ``item`` (or multiple items) inserted at the specified
error to specify an out-of-range index. Valid indexes are 0 to N where N is ``index``. Multiple items should be separated by commas.
the length of the list, inclusive. An empty list has length 0.
It is an error to specify an out-of-range ``index``. Valid indexes are 0 to N,
where N is the length of the list, inclusive. An empty list has length 0.
.. genex:: $<LIST:POP_BACK,list> .. genex:: $<LIST:POP_BACK,list>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the last element was removed. The ``list`` with the last item removed.
.. genex:: $<LIST:POP_FRONT,list> .. genex:: $<LIST:POP_FRONT,list>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the first element was removed. The ``list`` with the first item removed.
.. genex:: $<LIST:REMOVE_ITEM,list,value,...> .. genex:: $<LIST:REMOVE_ITEM,list,value,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with all instances of the given values were removed. The ``list`` with all instances of the given ``value`` (or values) removed.
If multiple values are given, they should be separated by commas.
.. genex:: $<LIST:REMOVE_AT,list,index,...> .. genex:: $<LIST:REMOVE_AT,list,index,...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with all values at given indices were removed. The ``list`` with the item at each given ``index`` removed.
.. _GenEx LIST-REMOVE_DUPLICATES:
.. genex:: $<LIST:REMOVE_DUPLICATES,list> .. genex:: $<LIST:REMOVE_DUPLICATES,list>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list where duplicated items were removed. The relative order of The ``list`` with all duplicated items removed. The relative order of
items is preserved, but if duplicates are encountered, only the first items is preserved, but if duplicates are encountered, only the first
instance is preserved. instance is preserved. The result is the same as
:genex:`$<REMOVE_DUPLICATES:list>`.
.. _GenEx LIST-FILTER:
.. genex:: $<LIST:FILTER,list,INCLUDE|EXCLUDE,regex> .. genex:: $<LIST:FILTER,list,INCLUDE|EXCLUDE,regex>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns a list with the items that match the regular expression ``regex`` A list of items from the ``list`` which match (``INCLUDE``) or do not match
were included or removed. (``EXCLUDE``) the regular expression ``regex``. The result is the same as
:genex:`$<FILTER:list,INCLUDE|EXCLUDE,regex>`.
.. genex:: $<LIST:TRANSFORM,list,ACTION[,SELECTOR]> .. genex:: $<LIST:TRANSFORM,list,ACTION[,SELECTOR]>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the list transformed by applying an ``ACTION`` to all or, by The ``list`` transformed by applying an ``ACTION`` to all or, by
specifying a ``SELECTOR``, to the selected elements of the list. specifying a ``SELECTOR``, to the selected list items.
.. note:: .. note::
The ``TRANSFORM`` sub-command does not change the number of elements in the The ``TRANSFORM`` sub-command does not change the number of items in the
list. If a ``SELECTOR`` is specified, only some elements will be changed, list. If a ``SELECTOR`` is specified, only some items will be changed,
the other ones will remain the same as before the transformation. the other ones will remain the same as before the transformation.
``ACTION`` specifies the action to apply to the elements of the list. ``ACTION`` specifies the action to apply to the items of the list.
The actions have exactly the same semantics as of the The actions have exactly the same semantics as for the
:command:`list(TRANSFORM)` command. ``ACTION`` must be one of the following: :command:`list(TRANSFORM)` command. ``ACTION`` must be one of the following:
:command:`APPEND <list(TRANSFORM_APPEND)>`, :command:`PREPEND <list(TRANSFORM_APPEND)>` :command:`APPEND <list(TRANSFORM_APPEND)>`, :command:`PREPEND <list(TRANSFORM_APPEND)>`
Append, prepend specified value to each element of the list. Append, prepend specified value to each item of the list.
.. code-block:: cmake .. code-block:: cmake
$<LIST:TRANSFORM,list,(APPEND|PREPEND),value[,SELECTOR]> $<LIST:TRANSFORM,list,(APPEND|PREPEND),value[,SELECTOR]>
:command:`TOLOWER <list(TRANSFORM_TOLOWER)>`, :command:`TOUPPER <list(TRANSFORM_TOLOWER)>` :command:`TOLOWER <list(TRANSFORM_TOLOWER)>`, :command:`TOUPPER <list(TRANSFORM_TOLOWER)>`
Convert each element of the list to lower, upper characters. Convert each item of the list to lower, upper characters.
.. code-block:: cmake .. code-block:: cmake
$<LIST:TRANSFORM,list,(TOLOWER|TOUPPER)[,SELECTOR]> $<LIST:TRANSFORM,list,(TOLOWER|TOUPPER)[,SELECTOR]>
:command:`STRIP <list(TRANSFORM_STRIP)>` :command:`STRIP <list(TRANSFORM_STRIP)>`
Remove leading and trailing spaces from each element of the list. Remove leading and trailing spaces from each item of the list.
.. code-block:: cmake .. code-block:: cmake
@ -488,13 +515,13 @@ List Transformations
:command:`REPLACE <list(TRANSFORM_REPLACE)>`: :command:`REPLACE <list(TRANSFORM_REPLACE)>`:
Match the regular expression as many times as possible and substitute Match the regular expression as many times as possible and substitute
the replacement expression for the match for each element of the list. the replacement expression for the match for each item of the list.
.. code-block:: cmake .. code-block:: cmake
$<LIST:TRANSFORM,list,REPLACE,regular_expression,replace_expression[,SELECTOR]> $<LIST:TRANSFORM,list,REPLACE,regular_expression,replace_expression[,SELECTOR]>
``SELECTOR`` determines which elements of the list will be transformed. ``SELECTOR`` determines which items of the list will be transformed.
Only one type of selector can be specified at a time. When given, Only one type of selector can be specified at a time. When given,
``SELECTOR`` must be one of the following: ``SELECTOR`` must be one of the following:
@ -515,7 +542,7 @@ List Transformations
``REGEX`` ``REGEX``
Specify a regular expression. Specify a regular expression.
Only elements matching the regular expression will be transformed. Only items matching the regular expression will be transformed.
.. code-block:: cmake .. code-block:: cmake
@ -523,23 +550,29 @@ List Transformations
.. genex:: $<JOIN:list,glue> .. genex:: $<JOIN:list,glue>
Joins the list with the content of the ``glue`` string inserted between each Joins the ``list`` with the content of the ``glue`` string inserted between
item. each item. This is conceptually the same operation as
:ref:`$\<LIST:JOIN,list,glue\> <GenEx LIST-JOIN>`, but the two have
different behavior with regard to empty items.
:ref:`$\<LIST:JOIN,list,glue\> <GenEx LIST-JOIN>` preserves all empty items,
whereas ``$<JOIN,list,glue>`` drops all empty items from the list.
.. genex:: $<REMOVE_DUPLICATES:list> .. genex:: $<REMOVE_DUPLICATES:list>
.. versionadded:: 3.15 .. versionadded:: 3.15
Removes duplicated items in the given ``list``. The relative order of items Removes duplicated items in the given ``list``. The relative order of items
is preserved, but if duplicates are encountered, only the first instance is is preserved, and if duplicates are encountered, only the first instance is
preserved. retained. The result is the same as
:ref:`$\<LIST:REMOVE_DUPLICATES,list\> <GenEx LIST-REMOVE_DUPLICATES>`.
.. genex:: $<FILTER:list,INCLUDE|EXCLUDE,regex> .. genex:: $<FILTER:list,INCLUDE|EXCLUDE,regex>
.. versionadded:: 3.15 .. versionadded:: 3.15
Includes or removes items from ``list`` that match the regular expression Includes or removes items from ``list`` that match the regular expression
``regex``. ``regex``. The result is the same as
:ref:`$\<LIST:FILTER,list,INCLUDE|EXCLUDE,regex\> <GenEx LIST-FILTER>`.
.. _GenEx List Ordering: .. _GenEx List Ordering:
@ -550,13 +583,13 @@ List Ordering
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the list with the elements in reverse order. The ``list`` with the items in reverse order.
.. genex:: $<LIST:SORT,list[,(COMPARE:option|CASE:option|ORDER:option)]...> .. genex:: $<LIST:SORT,list[,(COMPARE:option|CASE:option|ORDER:option)]...>
.. versionadded:: 3.27 .. versionadded:: 3.27
Returns the list sorted according the specified options. The ``list`` sorted according to the specified options.
Use one of the ``COMPARE`` options to select the comparison method Use one of the ``COMPARE`` options to select the comparison method
for sorting: for sorting:
@ -566,26 +599,25 @@ List Ordering
This is the default behavior if the ``COMPARE`` option is not given. This is the default behavior if the ``COMPARE`` option is not given.
``FILE_BASENAME`` ``FILE_BASENAME``
Sorts a list of pathnames of files by their basenames. Sorts a list of file paths by their basenames.
``NATURAL`` ``NATURAL``
Sorts a list of strings using natural order Sorts a list of strings using natural order (see the man page for
(see ``strverscmp(3)`` manual), i.e. such that contiguous digits ``strverscmp(3)``), such that contiguous digits are compared as whole
are compared as whole numbers. numbers. For example, the following list ``10.0 1.1 2.1 8.0 2.0 3.1``
For example: the following list `10.0 1.1 2.1 8.0 2.0 3.1` will be sorted as ``1.1 2.0 2.1 3.1 8.0 10.0`` if the ``NATURAL``
will be sorted as `1.1 2.0 2.1 3.1 8.0 10.0` if the ``NATURAL`` comparison is selected, whereas it will be sorted as
comparison is selected where it will be sorted as ``1.1 10.0 2.0 2.1 3.1 8.0`` with the ``STRING`` comparison.
`1.1 10.0 2.0 2.1 3.1 8.0` with the ``STRING`` comparison.
Use one of the ``CASE`` options to select a case sensitive or case Use one of the ``CASE`` options to select a case-sensitive or
insensitive sort mode: case-insensitive sort mode:
``SENSITIVE`` ``SENSITIVE``
List items are sorted in a case-sensitive manner. List items are sorted in a case-sensitive manner.
This is the default behavior if the ``CASE`` option is not given. This is the default behavior if the ``CASE`` option is not given.
``INSENSITIVE`` ``INSENSITIVE``
List items are sorted case insensitively. The order of List items are sorted in a case-insensitive manner. The order of
items which differ only by upper/lowercase is not specified. items which differ only by upper/lowercase is not specified.
To control the sort order, one of the ``ORDER`` options can be given: To control the sort order, one of the ``ORDER`` options can be given:
@ -597,8 +629,8 @@ List Ordering
``DESCENDING`` ``DESCENDING``
Sorts the list in descending order. Sorts the list in descending order.
This is an error to specify multiple times the same option. Various options Options can be specified in any order, but it is an error to specify the
can be specified in any order: same option multiple times.
.. code-block:: cmake .. code-block:: cmake
@ -1789,20 +1821,20 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
.. versionadded:: 3.27 .. versionadded:: 3.27
Full path to the linker import file. On DLL platforms, it would be the Full path to the linker import file. On DLL platforms, it would be the
``.lib`` file. On AIX, for the executables, and on macOS, for the shared ``.lib`` file. For executables on AIX, and for shared libraries on macOS,
libraries, it could be, respectively, the ``.imp`` or ``.tbd`` import file, it could be, respectively, the ``.imp`` or ``.tbd`` import file,
depending of the value of :prop_tgt:`ENABLE_EXPORTS` property. depending on the value of the :prop_tgt:`ENABLE_EXPORTS` property.
An empty string is returned when there is no import file associated with the This expands to an empty string when there is no import file associated
target. with the target.
.. genex:: $<TARGET_IMPORT_FILE_BASE_NAME:tgt> .. genex:: $<TARGET_IMPORT_FILE_BASE_NAME:tgt>
.. versionadded:: 3.27 .. versionadded:: 3.27
Base name of file linker import file of the target ``tgt`` without prefix and Base name of the linker import file of the target ``tgt`` without prefix or
suffix. For example, if target file name is ``libbase.tbd``, the base name is suffix. For example, if the target file name is ``libbase.tbd``, the base
``base``. name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME` See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`
target properties and their configuration specific variants target properties and their configuration specific variants
@ -1831,7 +1863,7 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
Suffix of the import file of the target ``tgt``. Suffix of the import file of the target ``tgt``.
The suffix corresponds to the file extension (such as ".lib" or ".tbd"). The suffix corresponds to the file extension (such as ``.lib`` or ``.tbd``).
See also the :prop_tgt:`IMPORT_SUFFIX` target property. See also the :prop_tgt:`IMPORT_SUFFIX` target property.
@ -1842,13 +1874,15 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
.. versionadded:: 3.27 .. versionadded:: 3.27
Name of the import file of the target target ``tgt``. Name of the import file of the target ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on. expression is evaluated on.
.. genex:: $<TARGET_IMPORT_FILE_DIR:tgt> .. genex:: $<TARGET_IMPORT_FILE_DIR:tgt>
.. versionadded:: 3.27
Directory of the import file of the target ``tgt``. Directory of the import file of the target ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this Note that ``tgt`` is not added as a dependency of the target this
@ -1863,11 +1897,11 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
.. versionadded:: 3.27 .. versionadded:: 3.27
On macOS, it could be the ``.tbd`` import file associated with the shared On macOS, it could be the ``.tbd`` import file associated with the shared
library, depending of the value of :prop_tgt:`ENABLE_EXPORTS` property. library, depending on the value of the :prop_tgt:`ENABLE_EXPORTS` property.
This generator expression is equivalent to This generator expression is equivalent to
:genex:`$<TARGET_LINKER_LIBRARY_FILE>` or :genex:`$<TARGET_LINKER_LIBRARY_FILE>` or
:genex:`$<TARGET_LINKER_IMPORT_FILE>` generator expressions, depending of the :genex:`$<TARGET_LINKER_IMPORT_FILE>` generator expressions, depending on the
characteristics of the target and the platform. characteristics of the target and the platform.
.. genex:: $<TARGET_LINKER_FILE_BASE_NAME:tgt> .. genex:: $<TARGET_LINKER_FILE_BASE_NAME:tgt>

@ -157,6 +157,12 @@ Generator Expressions
:ref:`transformation <GenEx Path Transformations>` operations learned :ref:`transformation <GenEx Path Transformations>` operations learned
to process :ref:`lists <CMake Language Lists>` of paths element-wise. to process :ref:`lists <CMake Language Lists>` of paths element-wise.
* The :genex:`TARGET_IMPORT_FILE`, :genex:`TARGET_IMPORT_FILE_BASE_NAME`,
:genex:`TARGET_IMPORT_FILE_PREFIX`, :genex:`TARGET_IMPORT_FILE_SUFFIX`,
:genex:`TARGET_IMPORT_FILE_NAME`, and :genex:`TARGET_IMPORT_FILE_DIR`
generator expressions were added. These expand to details about the
linker import file for a target.
* The :genex:`TARGET_RUNTIME_DLL_DIRS` generator expression was added. * The :genex:`TARGET_RUNTIME_DLL_DIRS` generator expression was added.
It expands to a list of the directories containing DLLs in It expands to a list of the directories containing DLLs in
:genex:`TARGET_RUNTIME_DLLS`. :genex:`TARGET_RUNTIME_DLLS`.

@ -124,7 +124,10 @@ unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS)
unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG) unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG)
if(NOT CMAKE_HIP_COMPILER_ROCM_LIB) if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib") set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS
"${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib"
"${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib64"
)
if(CMAKE_HIP_LIBRARY_ARCHITECTURE) if(CMAKE_HIP_LIBRARY_ARCHITECTURE)
list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}") list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}")
endif() endif()
@ -146,6 +149,12 @@ if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
endif() endif()
unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS) unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS)
endif() endif()
if(CMAKE_HIP_COMPILER_ROCM_LIB MATCHES "/lib64$" AND NOT DEFINED CMAKE_SIZEOF_VOID_P)
# We have not yet determined the target ABI but we need 'find_package' to
# search lib64 directories to find hip-lang CMake package dependencies.
# This will be replaced by ABI detection later.
set(CMAKE_HIP_SIZEOF_DATA_PTR 8)
endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_HIP_COMPILER}" PATH) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_HIP_COMPILER}" PATH)

@ -499,11 +499,7 @@ if(Protobuf_INCLUDE_DIR)
math(EXPR _PROTOBUF_MAJOR_VERSION "${Protobuf_LIB_VERSION} / 1000000") math(EXPR _PROTOBUF_MAJOR_VERSION "${Protobuf_LIB_VERSION} / 1000000")
math(EXPR _PROTOBUF_MINOR_VERSION "${Protobuf_LIB_VERSION} / 1000 % 1000") math(EXPR _PROTOBUF_MINOR_VERSION "${Protobuf_LIB_VERSION} / 1000 % 1000")
math(EXPR _PROTOBUF_SUBMINOR_VERSION "${Protobuf_LIB_VERSION} % 1000") math(EXPR _PROTOBUF_SUBMINOR_VERSION "${Protobuf_LIB_VERSION} % 1000")
if (_PROTOBUF_MINOR_VERSION GREATER_EQUAL "21") set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
set(Protobuf_VERSION "${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
else()
set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
endif()
if(Protobuf_DEBUG) if(Protobuf_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@ -524,7 +520,9 @@ if(Protobuf_INCLUDE_DIR)
"${Protobuf_PROTOC_EXECUTABLE} reveals version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}") "${Protobuf_PROTOC_EXECUTABLE} reveals version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}")
endif() endif()
if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${Protobuf_VERSION}") # protoc version 22 and up don't print the major version any more
if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${Protobuf_VERSION}" AND
NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
message(WARNING "Protobuf compiler version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" message(WARNING "Protobuf compiler version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}"
" doesn't match library version ${Protobuf_VERSION}") " doesn't match library version ${Protobuf_VERSION}")
endif() endif()
@ -556,7 +554,7 @@ if(Protobuf_INCLUDE_DIR)
INTERFACE_COMPILE_FEATURES cxx_std_11 INTERFACE_COMPILE_FEATURES cxx_std_11
) )
endif() endif()
if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotobuf APPEND PROPERTY set_property(TARGET protobuf::libprotobuf APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
) )
@ -589,7 +587,7 @@ if(Protobuf_INCLUDE_DIR)
set_target_properties(protobuf::libprotobuf-lite PROPERTIES set_target_properties(protobuf::libprotobuf-lite PROPERTIES
IMPORTED_LOCATION_DEBUG "${Protobuf_LITE_LIBRARY_DEBUG}") IMPORTED_LOCATION_DEBUG "${Protobuf_LITE_LIBRARY_DEBUG}")
endif() endif()
if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
) )
@ -627,7 +625,7 @@ if(Protobuf_INCLUDE_DIR)
INTERFACE_COMPILE_FEATURES cxx_std_11 INTERFACE_COMPILE_FEATURES cxx_std_11
) )
endif() endif()
if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotoc APPEND PROPERTY set_property(TARGET protobuf::libprotoc APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
) )

@ -4,6 +4,8 @@ if(CMAKE_ANDROID_NDK)
include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android.cmake OPTIONAL) include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android.cmake OPTIONAL)
endif() endif()
include(Platform/Linux)
# Natively compiling on an Android host doesn't need these flags to be reset. # Natively compiling on an Android host doesn't need these flags to be reset.
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
return() return()

@ -2,7 +2,7 @@
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 27) set(CMake_VERSION_MINOR 27)
set(CMake_VERSION_PATCH 0) set(CMake_VERSION_PATCH 0)
set(CMake_VERSION_RC 4) set(CMake_VERSION_RC 5)
set(CMake_VERSION_IS_DIRTY 0) set(CMake_VERSION_IS_DIRTY 0)
# Start with the full version number used in tags. It has no dev info. # Start with the full version number used in tags. It has no dev info.
@ -21,7 +21,7 @@ endif()
if(NOT CMake_VERSION_NO_GIT) if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info. # If this source was exported by 'git archive', use its commit info.
set(git_info [==[b384058e4b CMake 3.27.0-rc4]==]) set(git_info [==[8bcba75b1c CMake 3.27.0-rc5]==])
# Otherwise, try to identify the current development source version. # Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "

@ -6,6 +6,7 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include <utility>
#include <cm3p/cppdap/optional.h> #include <cm3p/cppdap/optional.h>
#include <cm3p/cppdap/session.h> #include <cm3p/cppdap/session.h>
@ -78,12 +79,14 @@ cmDebuggerBreakpointManager::HandleSetBreakpointsRequest(
cmSystemTools::GetActualCaseForPath(request.source.path.value()); cmSystemTools::GetActualCaseForPath(request.source.path.value());
const dap::array<dap::SourceBreakpoint> defaultValue{}; const dap::array<dap::SourceBreakpoint> defaultValue{};
const auto& breakpoints = request.breakpoints.value(defaultValue); const auto& breakpoints = request.breakpoints.value(defaultValue);
if (Breakpoints.find(sourcePath) != Breakpoints.end()) {
Breakpoints[sourcePath].clear();
}
response.breakpoints.resize(breakpoints.size());
if (ListFileFunctionLines.find(sourcePath) != ListFileFunctionLines.end()) { if (ListFileFunctionLines.find(sourcePath) != ListFileFunctionLines.end()) {
// The file has loaded, we can validate breakpoints. // The file has loaded, we can validate breakpoints.
if (Breakpoints.find(sourcePath) != Breakpoints.end()) {
Breakpoints[sourcePath].clear();
}
response.breakpoints.resize(breakpoints.size());
for (size_t i = 0; i < breakpoints.size(); i++) { for (size_t i = 0; i < breakpoints.size(); i++) {
int64_t correctedLine = int64_t correctedLine =
CalibrateBreakpointLine(sourcePath, breakpoints[i].line); CalibrateBreakpointLine(sourcePath, breakpoints[i].line);
@ -106,7 +109,6 @@ cmDebuggerBreakpointManager::HandleSetBreakpointsRequest(
// The file has not loaded, validate breakpoints later. // The file has not loaded, validate breakpoints later.
ListFilePendingValidations.emplace(sourcePath); ListFilePendingValidations.emplace(sourcePath);
response.breakpoints.resize(breakpoints.size());
for (size_t i = 0; i < breakpoints.size(); i++) { for (size_t i = 0; i < breakpoints.size(); i++) {
Breakpoints[sourcePath].emplace_back(NextBreakpointId++, Breakpoints[sourcePath].emplace_back(NextBreakpointId++,
breakpoints[i].line); breakpoints[i].line);
@ -191,6 +193,15 @@ std::vector<int64_t> cmDebuggerBreakpointManager::GetBreakpoints(
return breakpoints; return breakpoints;
} }
size_t cmDebuggerBreakpointManager::GetBreakpointCount() const
{
size_t count = 0;
for (auto const& pair : Breakpoints) {
count += pair.second.size();
}
return count;
}
void cmDebuggerBreakpointManager::ClearAll() void cmDebuggerBreakpointManager::ClearAll()
{ {
std::unique_lock<std::mutex> lock(Mutex); std::unique_lock<std::mutex> lock(Mutex);

@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep #include "cmConfigure.h" // IWYU pragma: keep
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <mutex> #include <mutex>
#include <string> #include <string>
@ -55,6 +56,7 @@ public:
std::vector<cmListFileFunction> const& functions); std::vector<cmListFileFunction> const& functions);
std::vector<int64_t> GetBreakpoints(std::string const& sourcePath, std::vector<int64_t> GetBreakpoints(std::string const& sourcePath,
int64_t line); int64_t line);
size_t GetBreakpointCount() const;
void ClearAll(); void ClearAll();
}; };

@ -78,15 +78,16 @@ dap::array<dap::Variable> cmDebuggerVariables::HandleVariablesRequest()
entry.Value.empty()) { entry.Value.empty()) {
continue; continue;
} }
variables.push_back(dap::Variable{ {}, variables.push_back(dap::Variable{
{}, {},
{}, {},
entry.Name, {},
{}, entry.Name,
PrivateDataHint, {},
entry.Type, PrivateDataHint,
entry.Value, SupportsVariableType ? entry.Type : dap::optional<dap::string>(),
0 }); entry.Value,
0 });
} }
} }
@ -106,16 +107,16 @@ void cmDebuggerVariables::EnumerateSubVariablesIfAny(
{ {
dap::array<dap::Variable> ret; dap::array<dap::Variable> ret;
for (auto const& variables : SubVariables) { for (auto const& variables : SubVariables) {
toBeReturned.emplace_back( toBeReturned.emplace_back(dap::Variable{
dap::Variable{ {}, {},
{}, {},
{}, {},
variables->GetName(), variables->GetName(),
{}, {},
PrivatePropertyHint, PrivatePropertyHint,
SupportsVariableType ? "collection" : nullptr, SupportsVariableType ? "collection" : dap::optional<dap::string>(),
variables->GetValue(), variables->GetValue(),
variables->GetId() }); variables->GetId() });
} }
} }

@ -384,7 +384,9 @@ static const struct RemoveDuplicatesNode : public cmGeneratorExpressionNode
"$<REMOVE_DUPLICATES:...> expression requires one parameter"); "$<REMOVE_DUPLICATES:...> expression requires one parameter");
} }
return cmList{ parameters.front() }.remove_duplicates().to_string(); return cmList{ parameters.front(), cmList::EmptyElements::Yes }
.remove_duplicates()
.to_string();
} }
} removeDuplicatesNode; } removeDuplicatesNode;

@ -2733,7 +2733,8 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
auto mm = CxxModuleMapContent(*modmap_fmt, locs, object, usages); auto mm = CxxModuleMapContent(*modmap_fmt, locs, object, usages);
// XXX(modmap): If changing this path construction, change // XXX(modmap): If changing this path construction, change
// `cmNinjaTargetGenerator::WriteObjectBuildStatements` to generate the // `cmNinjaTargetGenerator::WriteObjectBuildStatements` and
// `cmNinjaTargetGenerator::ExportObjectCompileCommand` to generate the
// corresponding file path. // corresponding file path.
cmGeneratedFileStream mmf(cmStrCat(object.PrimaryOutput, ".modmap")); cmGeneratedFileStream mmf(cmStrCat(object.PrimaryOutput, ".modmap"));
mmf << mm; mmf << mm;

@ -1428,8 +1428,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
if (!modmapFormat.empty()) { if (!modmapFormat.empty()) {
// XXX(modmap): If changing this path construction, change // XXX(modmap): If changing this path construction, change
// `cmGlobalNinjaGenerator::WriteDyndep` to expect the corresponding file // `cmGlobalNinjaGenerator::WriteDyndep` and
// path. // `cmNinjaTargetGenerator::ExportObjectCompileCommand` to expect the
// corresponding file path.
std::string ddModmapFile = cmStrCat(objectFileName, ".modmap"); std::string ddModmapFile = cmStrCat(objectFileName, ".modmap");
vars["DYNDEP_MODULE_MAP_FILE"] = ddModmapFile; vars["DYNDEP_MODULE_MAP_FILE"] = ddModmapFile;
objBuild.OrderOnlyDeps.push_back(ddModmapFile); objBuild.OrderOnlyDeps.push_back(ddModmapFile);
@ -1688,11 +1689,32 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
escapedSourceFileName = this->LocalGenerator->ConvertToOutputFormat( escapedSourceFileName = this->LocalGenerator->ConvertToOutputFormat(
escapedSourceFileName, cmOutputConverter::SHELL); escapedSourceFileName, cmOutputConverter::SHELL);
std::string fullFlags = flags;
{
bool const needDyndep =
this->GetGeneratorTarget()->NeedDyndep(language, outputConfig);
std::string const modmapFormatVar =
cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FORMAT");
std::string const modmapFormat =
this->Makefile->GetSafeDefinition(modmapFormatVar);
if (needDyndep && !modmapFormat.empty()) {
std::string modmapFlags = this->GetMakefile()->GetRequiredDefinition(
cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FLAG"));
// XXX(modmap): If changing this path construction, change
// `cmGlobalNinjaGenerator::WriteDyndep` and
// `cmNinjaTargetGenerator::WriteObjectBuildStatement` to expect the
// corresponding file path.
cmSystemTools::ReplaceString(modmapFlags, "<MODULE_MAP_FILE>",
cmStrCat(objectFileName, ".modmap"));
fullFlags += cmStrCat(' ', modmapFlags);
}
}
compileObjectVars.Source = escapedSourceFileName.c_str(); compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str(); compileObjectVars.Object = objectFileName.c_str();
compileObjectVars.ObjectDir = objectDir.c_str(); compileObjectVars.ObjectDir = objectDir.c_str();
compileObjectVars.ObjectFileDir = objectFileDir.c_str(); compileObjectVars.ObjectFileDir = objectFileDir.c_str();
compileObjectVars.Flags = flags.c_str(); compileObjectVars.Flags = fullFlags.c_str();
compileObjectVars.Defines = defines.c_str(); compileObjectVars.Defines = defines.c_str();
compileObjectVars.Includes = includes.c_str(); compileObjectVars.Includes = includes.c_str();

@ -309,7 +309,7 @@ void cmUVReadOnlyProcess::UVExit(uv_process_t* handle, int64_t exitStatus,
// Set error message on demand // Set error message on demand
proc.Result()->ExitStatus = exitStatus; proc.Result()->ExitStatus = exitStatus;
proc.Result()->TermSignal = termSignal; proc.Result()->TermSignal = termSignal;
if (!proc.Result()->error()) { if (proc.Result()->ErrorMessage.empty()) {
if (termSignal != 0) { if (termSignal != 0) {
proc.Result()->ErrorMessage = cmStrCat( proc.Result()->ErrorMessage = cmStrCat(
"Process was terminated by signal ", proc.Result()->TermSignal); "Process was terminated by signal ", proc.Result()->TermSignal);

@ -2502,6 +2502,26 @@ int cmVSLink::LinkIncremental()
int cmVSLink::LinkNonIncremental() int cmVSLink::LinkNonIncremental()
{ {
// The MSVC link tool expects 'rc' to be in the PATH if it needs to embed
// manifests, but the user might explicitly set 'CMAKE_RC_COMPILER' instead.
// Add its location as a fallback at the end of PATH.
if (cmSystemTools::FileIsFullPath(this->RcPath)) {
std::string rcDir = cmSystemTools::GetFilenamePath(this->RcPath);
#ifdef _WIN32
std::replace(rcDir.begin(), rcDir.end(), '/', '\\');
char const pathSep = ';';
#else
char const pathSep = ':';
#endif
cm::optional<std::string> path = cmSystemTools::GetEnvVar("PATH");
if (path) {
path = cmStrCat(*path, pathSep, rcDir);
} else {
path = rcDir;
}
cmSystemTools::PutEnv(cmStrCat("PATH=", *path));
}
// Sort out any manifests. // Sort out any manifests.
if (this->LinkGeneratesManifest || !this->UserManifests.empty()) { if (this->LinkGeneratesManifest || !this->UserManifests.empty()) {
std::string opt = std::string opt =

@ -19,11 +19,15 @@
do { \ do { \
ASSERT_TRUE(x.name == expectedName); \ ASSERT_TRUE(x.name == expectedName); \
ASSERT_TRUE(x.value == expectedValue); \ ASSERT_TRUE(x.value == expectedValue); \
ASSERT_TRUE(x.type.value() == expectedType); \ if (expectedType == nullptr) { \
ASSERT_TRUE(x.evaluateName.has_value() == false); \ ASSERT_TRUE(x.type == dap::optional<dap::string>()); \
if (std::string(expectedType) == "collection") { \ } else { \
ASSERT_TRUE(x.variablesReference != 0); \ ASSERT_TRUE(x.type == dap::optional<dap::string>(expectedType)); \
if (std::string(expectedType) == "collection") { \
ASSERT_TRUE(x.variablesReference != 0); \
} \
} \ } \
ASSERT_TRUE(x.evaluateName.has_value() == false); \
} while (false) } while (false)
#define ASSERT_VARIABLE_REFERENCE(x, expectedName, expectedValue, \ #define ASSERT_VARIABLE_REFERENCE(x, expectedName, expectedValue, \

@ -51,6 +51,13 @@ static bool testHandleBreakpointRequestBeforeFileIsLoaded()
sourcePath, false); sourcePath, false);
ASSERT_BREAKPOINT(response.breakpoints[2], 2, sourceBreakpoints[2].line, ASSERT_BREAKPOINT(response.breakpoints[2], 2, sourceBreakpoints[2].line,
sourcePath, false); sourcePath, false);
ASSERT_TRUE(breakpointManager.GetBreakpointCount() == 3);
// setBreakpoints should override any existing breakpoints
setBreakpointRequest.breakpoints.value().clear();
helper.Client->send(setBreakpointRequest).get();
ASSERT_TRUE(breakpointManager.GetBreakpointCount() == 0);
return true; return true;
} }
@ -103,6 +110,12 @@ static bool testHandleBreakpointRequestAfterFileIsLoaded()
sourcePath, true); sourcePath, true);
ASSERT_TRUE(notExpectBreakpointEvents.load()); ASSERT_TRUE(notExpectBreakpointEvents.load());
ASSERT_TRUE(breakpointManager.GetBreakpointCount() == 5);
// setBreakpoints should override any existing breakpoints
setBreakpointRequest.breakpoints.value().clear();
helper.Client->send(setBreakpointRequest).get();
ASSERT_TRUE(breakpointManager.GetBreakpointCount() == 0);
return true; return true;
} }

@ -8,6 +8,7 @@
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include <cm3p/cppdap/optional.h>
#include <cm3p/cppdap/protocol.h> #include <cm3p/cppdap/protocol.h>
#include <cm3p/cppdap/types.h> #include <cm3p/cppdap/types.h>
@ -174,6 +175,33 @@ static bool testSortTheResult()
return true; return true;
} }
static bool testNoSupportsVariableType()
{
auto variablesManager =
std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
auto vars = std::make_shared<cmDebugger::cmDebuggerVariables>(
variablesManager, "Variables", false, []() {
return std::vector<cmDebugger::cmDebuggerVariableEntry>{ { "test",
"value" } };
});
auto subvars = std::make_shared<cmDebugger::cmDebuggerVariables>(
variablesManager, "Children", false);
vars->AddSubVariables(subvars);
dap::array<dap::Variable> variables =
variablesManager->HandleVariablesRequest(
CreateVariablesRequest(vars->GetId()));
ASSERT_TRUE(variables.size() == 2);
ASSERT_VARIABLE(variables[0], "Children", "", nullptr);
ASSERT_VARIABLE(variables[1], "test", "value", nullptr);
return true;
}
int testDebuggerVariables(int, char*[]) int testDebuggerVariables(int, char*[])
{ {
return runTests(std::vector<std::function<bool()>>{ return runTests(std::vector<std::function<bool()>>{
@ -181,5 +209,6 @@ int testDebuggerVariables(int, char*[])
testConstructors, testConstructors,
testIgnoreEmptyStringEntries, testIgnoreEmptyStringEntries,
testSortTheResult, testSortTheResult,
testNoSupportsVariableType,
}); });
} }

@ -8,6 +8,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <cm3p/cppdap/optional.h>
#include <cm3p/cppdap/protocol.h> #include <cm3p/cppdap/protocol.h>
#include <cm3p/cppdap/types.h> #include <cm3p/cppdap/types.h>
#include <stddef.h> #include <stddef.h>

@ -152,6 +152,11 @@ if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION)
run_cxx_module_test(scan_properties) run_cxx_module_test(scan_properties)
endif () endif ()
# Tests which require compile commands support.
if ("compile_commands" IN_LIST CMake_TEST_MODULE_COMPILATION)
run_cxx_module_test(export-compile-commands)
endif ()
# Tests which require collation work. # Tests which require collation work.
if ("collation" IN_LIST CMake_TEST_MODULE_COMPILATION) if ("collation" IN_LIST CMake_TEST_MODULE_COMPILATION)
run_cxx_module_test(public-req-private) run_cxx_module_test(public-req-private)

@ -0,0 +1,25 @@
if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
list(APPEND RunCMake_TEST_FAILED
"No compile commands database detected.")
endif ()
file(READ "${RunCMake_TEST_BINARY_DIR}/compile_commands.json" compile_commands)
string(JSON length
LENGTH "${compile_commands}")
math(EXPR length "${length} - 1")
foreach (item RANGE "${length}")
string(JSON entry
GET "${compile_commands}"
"${item}")
string(JSON command
GET "${entry}"
"command")
if (NOT command MATCHES "(@|-fmodule-mapper=).*\\.modmap")
string(JSON output
GET "${entry}"
"output")
list(APPEND RunCMake_TEST_FAILED
"Missing `.modmap` argument for '${output}'")
endif ()
endforeach ()

@ -0,0 +1,4 @@
CMake Warning \(dev\) at CMakeLists.txt:9 \(target_sources\):
CMake's C\+\+ module support is experimental. It is meant only for
experimentation and feedback to CMake developers.
This warning is for project developers. Use -Wno-dev to suppress it.

@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.24)
project(cxx_modules_export_compile_commands CXX)
include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
add_executable(export-compile-commands)
target_sources(export-compile-commands
PRIVATE
main.cxx
PRIVATE
FILE_SET CXX_MODULES
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}"
FILES
importable.cxx)
target_compile_features(export-compile-commands PUBLIC cxx_std_20)
add_test(NAME export-compile-commands COMMAND export-compile-commands)

@ -0,0 +1,6 @@
export module importable;
export int from_import()
{
return 0;
}

@ -0,0 +1,6 @@
import importable;
int main(int argc, char* argv[])
{
return from_import();
}

@ -0,0 +1,6 @@
file(READ "${RunCMake_TEST_BINARY_DIR}/REMOVE_DUPLICATES-generated.txt" content)
set(expected "1;;2;3")
if(NOT content STREQUAL expected)
set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
endif()

@ -0,0 +1,3 @@
cmake_policy(VERSION 3.11)
file(GENERATE OUTPUT "REMOVE_DUPLICATES-generated.txt" CONTENT "$<REMOVE_DUPLICATES:1$<SEMICOLON>$<SEMICOLON>2$<SEMICOLON>$<SEMICOLON>3>")

@ -36,6 +36,7 @@ run_cmake(TARGET_NAME_IF_EXISTS-alias-target)
run_cmake(TARGET_NAME_IF_EXISTS-imported-target) run_cmake(TARGET_NAME_IF_EXISTS-imported-target)
run_cmake(TARGET_NAME_IF_EXISTS-imported-global-target) run_cmake(TARGET_NAME_IF_EXISTS-imported-global-target)
run_cmake(REMOVE_DUPLICATES-empty) run_cmake(REMOVE_DUPLICATES-empty)
run_cmake(REMOVE_DUPLICATES-empty-element)
run_cmake(REMOVE_DUPLICATES-1) run_cmake(REMOVE_DUPLICATES-1)
run_cmake(REMOVE_DUPLICATES-2) run_cmake(REMOVE_DUPLICATES-2)
run_cmake(REMOVE_DUPLICATES-3) run_cmake(REMOVE_DUPLICATES-3)

@ -737,7 +737,7 @@ class CMakeDomain(Domain):
def get_objects(self): def get_objects(self):
for refname, obj in self.data['objects'].items(): for refname, obj in self.data['objects'].items():
yield (refname, obj.name, obj.objtype, obj.docname, obj.node_id, 1) yield (refname, refname, obj.objtype, obj.docname, obj.node_id, 1)
def setup(app): def setup(app):

Loading…
Cancel
Save