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:
@@ -700,14 +700,18 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
find_path(
|
find_path(
|
||||||
MOLD_BIN_DIR "ld"
|
MOLD_BIN_DIR "ld"
|
||||||
HINTS "${MOLD_PREFIX}"
|
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_DEFAULT_PATH
|
||||||
NO_CACHE
|
NO_CACHE
|
||||||
)
|
)
|
||||||
if(NOT MOLD_BIN_DIR)
|
if(NOT MOLD_BIN_DIR)
|
||||||
message(STATUS
|
message(STATUS
|
||||||
"The mold linker could not find the directory containing the linker command "
|
"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)
|
set(WITH_LINKER_MOLD OFF)
|
||||||
endif()
|
endif()
|
||||||
unset(MOLD_PREFIX)
|
unset(MOLD_PREFIX)
|
||||||
|
|||||||
Reference in New Issue
Block a user