The linker configuration file is now optional: It is loaded only if
variable CMAKE_<LANG>_USE_LINKER_CONFIGURATION is set to TRUE.
The file CMakeAddNewLanguage.txt is updated to take into account the
linker configuration.
Fixes: #26393
The `Platform/<OS>.cmake` modules record platform-specific flag
variables for the C toolchain. The `CMake<LANG>Information` modules
initialize the per-language platform-specific flag variables to defaults
copied from C. However, they have diverged over time, and not all
platform-specific flag variables are initialized correctly for all
languages. Factor out the CXX language's instance of this logic into a
helper macro, and reuse it for all languages for which we previously
had the platform-specific flag variables at least partially filled out.
Previously the Fortran language's copy of this logic used
`if(NOT DEFINED <var>)` instead of just `if(NOT <var>)` to allow
`Platform/<OS>-<COMPILER_ID>-<LANG>` modules to specify empty values for
some platform-specific flag variables without being overridden.
Use this approach in the helper macro so it applies to all languages.
Fixes: #25990
We need `CMAKE_LIBRARY_ARCHITECTURE` to find the package before HIP
compiler ABI detection. However, if HIP is the first enabled language,
the value is not known until `CMAKE_HIP_LIBRARY_ARCHITECTURE` is
determined by the ABI detection step. Resolve this by detecting
`CMAKE_HIP_LIBRARY_ARCHITECTURE` from the compiler id output.
Fixes: #24562
Use REQUIRED for the find_package that loads the hip config, because
it may fail, e.g. because dependent libraries are not found. Before
this if the find_package failed cmake silently continued.
It only makes sense to use the CMake package from the same ROCm
installation that the compiler uses. Ask the HIP compiler to report the
location of the ROCm installation. Verify up front that it contains the
expected CMake package file.
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.
Fixes: #20174