wrong `CMAKE_LIBRARY_ARCHITECTURE` with clang
Hello, I am using clang release clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.
There a folder lib/x86_64-unknown-linux-gnu
is existing. This directory is by default specified in ld
command:
ld -L/bin/../lib/x86_64-unknown-linux-gnu
cmake (version 3.21.3) is taking the CMAKE_LIBRARY_ARCHITECTURE
from the first -L
directory of the linker command (via CMAKE_PARSE_IMPLICIT_LINK_INFO).
As a result CMAKE_LIBRARY_ARCHITECTURE
is always x86_64-unknown-linux-gnu
when using clang (instead of expected x86_64-linux-gnu
on Ubuntu). find_library
cannot find libraries anymore which are placed under /usr/lib/x86_64-linux-gnu
.
Edited by Thorsten Klein