
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.
12 lines
310 B
CMake
12 lines
310 B
CMake
include(RunCMake)
|
|
|
|
run_cmake(ParseImplicitLinkInfo)
|
|
|
|
run_cmake(Inspect)
|
|
set(info "${RunCMake_BINARY_DIR}/Inspect-build/info.cmake")
|
|
include("${info}")
|
|
|
|
if(INFO_CMAKE_C_IMPLICIT_LINK_DIRECTORIES MATCHES ";")
|
|
run_cmake_with_options(ExcludeDirs "-Dinfo=${RunCMake_BINARY_DIR}/Inspect-build/info.cmake")
|
|
endif()
|