Skip to content

Add CMAKE_LANG_IMPLICIT_LINKER_SEARCH_DIRECTORIES

Ray Donnelly requested to merge mingwandroid/cmake:linker_search_dirs into master

We ask the linker directly for its search dirs rather than going through the compiler. This is necessary when the search dirs for the compiler and those for the linker differ (e.g. when using conda gcc and the system ld).

This difference matters because CMake removes 'implicit directories' from commandlines, and if it removes ones that the linker needs to be told about then the linker will not be able to find shared objects.

Two cases that need this are -Wl,-rpath, and -Wl,-rpath-link, but also any time that the compiler passes paths directly to the linker.

Merge request reports