2017-03-13 15:54:56 +00:00
|
|
|
# Copyright (c) 2017 Andrew Kelley
|
|
|
|
# This file is MIT licensed.
|
|
|
|
# See http://opensource.org/licenses/MIT
|
|
|
|
|
|
|
|
# LLD_FOUND
|
|
|
|
# LLD_INCLUDE_DIRS
|
|
|
|
# LLD_LIBRARIES
|
|
|
|
|
2017-10-24 02:43:18 +01:00
|
|
|
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
|
2022-07-16 02:51:41 +01:00
|
|
|
HINTS ${LLVM_INCLUDE_DIRS}
|
2022-07-16 16:26:45 +01:00
|
|
|
PATHS
|
2024-08-23 00:09:12 +01:00
|
|
|
/usr/lib/llvm-19/include
|
|
|
|
/usr/local/llvm190/include
|
|
|
|
/usr/local/llvm19/include
|
|
|
|
/usr/local/opt/llvm@19/include
|
|
|
|
/opt/homebrew/opt/llvm@19/include
|
2022-07-16 16:26:45 +01:00
|
|
|
/mingw64/include)
|
2017-03-13 15:54:56 +00:00
|
|
|
|
2024-08-23 00:09:12 +01:00
|
|
|
find_library(LLD_LIBRARY NAMES lld-19.0 lld190 lld NAMES_PER_DIR
|
2022-07-16 02:51:41 +01:00
|
|
|
HINTS ${LLVM_LIBDIRS}
|
2022-07-16 16:26:45 +01:00
|
|
|
PATHS
|
2024-08-23 00:09:12 +01:00
|
|
|
/usr/lib/llvm-19/lib
|
|
|
|
/usr/local/llvm190/lib
|
|
|
|
/usr/local/llvm19/lib
|
|
|
|
/usr/local/opt/llvm@19/lib
|
|
|
|
/opt/homebrew/opt/llvm@19/lib
|
2018-12-23 22:04:26 +00:00
|
|
|
)
|
2017-04-13 05:12:44 +01:00
|
|
|
if(EXISTS ${LLD_LIBRARY})
|
2017-04-11 11:44:45 +01:00
|
|
|
set(LLD_LIBRARIES ${LLD_LIBRARY})
|
|
|
|
else()
|
2017-03-13 15:54:56 +00:00
|
|
|
macro(FIND_AND_ADD_LLD_LIB _libname_)
|
2017-04-11 11:44:45 +01:00
|
|
|
string(TOUPPER ${_libname_} _prettylibname_)
|
2022-07-13 18:36:25 +01:00
|
|
|
find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_} NAMES_PER_DIR
|
2022-07-16 02:51:41 +01:00
|
|
|
HINTS ${LLVM_LIBDIRS}
|
2022-07-16 16:26:45 +01:00
|
|
|
PATHS
|
|
|
|
${LLD_LIBDIRS}
|
2024-08-23 00:09:12 +01:00
|
|
|
/usr/lib/llvm-19/lib
|
|
|
|
/usr/local/llvm190/lib
|
|
|
|
/usr/local/llvm19/lib
|
|
|
|
/usr/local/opt/llvm@19/lib
|
|
|
|
/opt/homebrew/opt/llvm@19/lib
|
2022-07-16 16:26:45 +01:00
|
|
|
/mingw64/lib
|
|
|
|
/c/msys64/mingw64/lib
|
|
|
|
c:/msys64/mingw64/lib)
|
2022-07-16 02:51:41 +01:00
|
|
|
if(LLD_${_prettylibname_}_LIB)
|
|
|
|
set(LLD_LIBRARIES ${LLD_LIBRARIES} ${LLD_${_prettylibname_}_LIB})
|
2017-04-11 11:44:45 +01:00
|
|
|
endif()
|
|
|
|
endmacro(FIND_AND_ADD_LLD_LIB)
|
2017-03-13 15:54:56 +00:00
|
|
|
|
2017-10-24 02:43:18 +01:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldMinGW)
|
2017-04-11 11:44:45 +01:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldELF)
|
|
|
|
FIND_AND_ADD_LLD_LIB(lldCOFF)
|
2018-06-14 23:28:42 +01:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldWasm)
|
2022-02-04 05:12:36 +00:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldMachO)
|
2017-10-24 02:43:18 +01:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldCommon)
|
2017-04-11 11:44:45 +01:00
|
|
|
endif()
|
2017-03-13 15:54:56 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-03-25 22:43:28 +00:00
|
|
|
find_package_handle_standard_args(lld DEFAULT_MSG LLD_LIBRARIES LLD_INCLUDE_DIRS)
|
2017-03-13 15:54:56 +00:00
|
|
|
|
|
|
|
mark_as_advanced(LLD_INCLUDE_DIRS LLD_LIBRARIES)
|