mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Optionally exclude implicit link directories via environment
A misconfigured compiler may pass extraneous implicit link directories to its linker. If they are in `CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES`, CMake may generate extra `-L` flags on mixed-language link lines that break linking. Add an environment variable that users can set to work around such misconfiguration of their compilers.
This commit is contained in:
13
Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst
Normal file
13
Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst
Normal file
@@ -0,0 +1,13 @@
|
||||
CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
|
||||
----------------------------------------------
|
||||
|
||||
.. versionadded:: 3.27
|
||||
|
||||
.. include:: ENV_VAR.txt
|
||||
|
||||
A :ref:`semicolon-separated list <CMake Language Lists>` of directories
|
||||
to exclude from the :variable:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES`
|
||||
variable when it is automatically detected from the ``<LANG>`` compiler.
|
||||
|
||||
This may be used to work around misconfigured compiler drivers that pass
|
||||
extraneous implicit link directories to their linker.
|
||||
@@ -50,6 +50,7 @@ Environment Variables that Control the Build
|
||||
/envvar/CMAKE_GENERATOR_TOOLSET
|
||||
/envvar/CMAKE_INSTALL_MODE
|
||||
/envvar/CMAKE_LANG_COMPILER_LAUNCHER
|
||||
/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
|
||||
/envvar/CMAKE_LANG_LINKER_LAUNCHER
|
||||
/envvar/CMAKE_MSVCIDE_RUN_PATH
|
||||
/envvar/CMAKE_NO_VERBOSE
|
||||
|
||||
@@ -6,9 +6,14 @@ Implicit linker search path detected for language ``<LANG>``.
|
||||
Compilers typically pass directories containing language runtime
|
||||
libraries and default library search paths when they invoke a linker.
|
||||
These paths are implicit linker search directories for the compiler's
|
||||
language. For each language enabled by the :command:`project` or
|
||||
language.
|
||||
|
||||
For each language enabled by the :command:`project` or
|
||||
:command:`enable_language` command, CMake automatically detects these
|
||||
directories and reports the results in this variable.
|
||||
The :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES_EXCLUDE` environment
|
||||
variable may be set to exclude specific directories from the automatically
|
||||
detected results.
|
||||
|
||||
When linking to a static library, CMake adds the implicit link directories
|
||||
from this variable for each language used in the static library (except
|
||||
|
||||
Reference in New Issue
Block a user