Files
CMake/Help/variable/CMAKE_LIBRARY_PATH_FLAG.rst
Daksh Mamodiya 89e5c19c55 Linker: Generate per-language link directory flags on Windows
IntelLLVM links through the compiler driver, so its link directory
flag is wrapped in `/Qoption,link,`.  MSVC and CUDA run `link.exe`
directly.  When both are used in one build tree, the IntelLLVM value
of `CMAKE_LIBRARY_PATH_FLAG` leaked onto `link.exe` command lines.
Setting `CMAKE_<LANG>_LIBRARY_PATH_FLAG` per language, as was done
for `CMAKE_<LANG>_LINK_DEF_FILE_FLAG`, gives each link line the
spelling its own linker understands.  The variable is now documented.

Fixes: #28116
2026-10-01 15:37:42 +05:30

11 lines
366 B
ReStructuredText

CMAKE_LIBRARY_PATH_FLAG
-----------------------
The flag to be used to add a library search path to a compiler.
The flag will be used to specify a library directory to the compiler.
On most compilers this is ``-L``.
If the per-language :variable:`CMAKE_<LANG>_LIBRARY_PATH_FLAG` variable
is defined, it takes precedence over :variable:`!CMAKE_LIBRARY_PATH_FLAG`.