CMake: resolve issue finding mold

The default installation path uses `libexec`, missed this as the
package for Arch replaces this with `lib`,
now both are checked.
This commit is contained in:
Campbell Barton 2022-01-17 18:07:12 +11:00
parent a84621347d
commit e1e3043a51
1 changed files with 6 additions and 2 deletions

View File

@ -700,14 +700,18 @@ if(CMAKE_COMPILER_IS_GNUCC)
find_path(
MOLD_BIN_DIR "ld"
HINTS "${MOLD_PREFIX}"
PATH_SUFFIXES "lib/mold" "lib64/mold"
# The default path is `libexec`, Arch Linux for e.g.
# replaces this with `lib` so check both.
PATH_SUFFIXES "libexec/mold" "lib/mold" "lib64/mold"
NO_DEFAULT_PATH
NO_CACHE
)
if(NOT MOLD_BIN_DIR)
message(STATUS
"The mold linker could not find the directory containing the linker command "
"(typically \"${MOLD_PREFIX}/lib/mold\"), using system linker.")
"(typically "
"\"${MOLD_PREFIX}/libexec/mold/ld\") or "
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker.")
set(WITH_LINKER_MOLD OFF)
endif()
unset(MOLD_PREFIX)