mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
Linker: Generate per-language module -DEF: flags on Windows
With IntelLLVM on Windows, we link using the compiler driver. With MSVC on Windows, we invoke the linker directly. If we use both in a single build tree, for separate languages, the value of `CMAKE_LINK_DEF_FILE_FLAG` conflicts. Add a per-language `CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable to avoid the conflict. Preserve the language-agnostic variable for compatibility with projects that reference it. Fixes: #26005
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
CMAKE_<LANG>_LINK_DEF_FILE_FLAG
|
||||
-------------------------------
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
Linker flag to be used to specify a ``.def`` file for dll creation
|
||||
with the toolchain for language ``<LANG>``.
|
||||
|
||||
CMake sets this variable automatically during toolchain inspection by
|
||||
calls to the :command:`project` or :command:`enable_language` commands.
|
||||
|
||||
If the :variable:`!CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable
|
||||
is defined, it takes precedence over the language-agnostic
|
||||
:variable:`CMAKE_LINK_DEF_FILE_FLAG` variable.
|
||||
@@ -5,3 +5,9 @@ Linker flag to be used to specify a ``.def`` file for dll creation.
|
||||
|
||||
The flag will be used to add a ``.def`` file when creating a dll on
|
||||
Windows; this is only defined on Windows.
|
||||
|
||||
CMake sets this variable automatically during toolchain inspection by
|
||||
calls to the :command:`project` or :command:`enable_language` commands.
|
||||
|
||||
If the per-language :variable:`CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable
|
||||
is defined, it takes precedence over :variable:`!CMAKE_LINK_DEF_FILE_FLAG`.
|
||||
|
||||
Reference in New Issue
Block a user