diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-06-20 10:42:06 (GMT) |
---|---|---|
committer | Harmen Stoppels <me@harmenstoppels.nl> | 2024-06-21 08:53:16 (GMT) |
commit | e74fba3d9cf2f6930732344e84a4086d707e6c17 (patch) | |
tree | 4b0770c56fb7ac23d82ace7146daaa5daf125f54 | |
parent | 90caa3880f345305025048d8f49e4ab1c35b39e1 (diff) | |
download | CMake-e74fba3d9cf2f6930732344e84a4086d707e6c17.zip CMake-e74fba3d9cf2f6930732344e84a4086d707e6c17.tar.gz CMake-e74fba3d9cf2f6930732344e84a4086d707e6c17.tar.bz2 |
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
-rw-r--r-- | Modules/Platform/Linux.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index fba6ab8..58749de 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -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) |