mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-16 20:21:41 -06:00
find_library: Search per-arch lib directories when compiling with sysroot
When using Gentoo Prefix on Debian, find_library for libm.so fails, because it needs to locate the lib in $sysroot/usr/lib64/libm.so, i.e. lib64/ not lib/. To fix this, do not disable per-arch lib directories when a sysroot is set. Fixes: #26069
This commit is contained in:
@@ -84,7 +84,7 @@ include(Platform/UnixPaths)
|
||||
|
||||
# Debian has lib32 and lib64 paths only for compatibility so they should not be
|
||||
# searched.
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
if(NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_COMPILER_SYSROOT)
|
||||
if (EXISTS "/etc/debian_version")
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
|
||||
|
||||
Reference in New Issue
Block a user