2017-03-13 08:54:56 -07: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-23 18:43:18 -07:00
|
|
|
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
|
2017-03-13 08:54:56 -07:00
|
|
|
PATHS
|
2019-10-12 06:27:42 -07:00
|
|
|
/usr/lib/llvm-10/include
|
2019-10-01 23:11:46 -07:00
|
|
|
/usr/local/llvm100/include
|
2020-04-07 08:13:33 -07:00
|
|
|
/usr/local/llvm10/include
|
2017-03-13 08:54:56 -07:00
|
|
|
/mingw64/include)
|
|
|
|
|
2019-10-01 23:11:46 -07:00
|
|
|
find_library(LLD_LIBRARY NAMES lld-10.0 lld100 lld
|
2018-10-17 06:24:12 -07:00
|
|
|
PATHS
|
2019-10-12 06:27:42 -07:00
|
|
|
/usr/lib/llvm-10/lib
|
2019-10-01 23:11:46 -07:00
|
|
|
/usr/local/llvm100/lib
|
2020-04-07 08:13:33 -07:00
|
|
|
/usr/local/llvm10/lib
|
2018-12-23 14:04:26 -08:00
|
|
|
)
|
2017-04-12 21:12:44 -07:00
|
|
|
if(EXISTS ${LLD_LIBRARY})
|
2017-04-11 03:44:45 -07:00
|
|
|
set(LLD_LIBRARIES ${LLD_LIBRARY})
|
|
|
|
else()
|
2017-03-13 08:54:56 -07:00
|
|
|
macro(FIND_AND_ADD_LLD_LIB _libname_)
|
2017-04-11 03:44:45 -07:00
|
|
|
string(TOUPPER ${_libname_} _prettylibname_)
|
|
|
|
find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
|
|
|
|
PATHS
|
2020-03-29 21:53:02 -07:00
|
|
|
${LLD_LIBDIRS}
|
2019-10-12 06:27:42 -07:00
|
|
|
/usr/lib/llvm-10/lib
|
2019-10-01 23:11:46 -07:00
|
|
|
/usr/local/llvm100/lib
|
2020-04-07 08:13:33 -07:00
|
|
|
/usr/local/llvm10/lib
|
2017-05-22 21:42:53 -07:00
|
|
|
/mingw64/lib
|
|
|
|
/c/msys64/mingw64/lib
|
|
|
|
c:/msys64/mingw64/lib)
|
2017-04-11 03:44:45 -07:00
|
|
|
if(LLD_${_prettylibname_}_LIB)
|
|
|
|
set(LLD_LIBRARIES ${LLD_LIBRARIES} ${LLD_${_prettylibname_}_LIB})
|
|
|
|
endif()
|
|
|
|
endmacro(FIND_AND_ADD_LLD_LIB)
|
2017-03-13 08:54:56 -07:00
|
|
|
|
2017-04-11 03:44:45 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldDriver)
|
2017-10-23 18:43:18 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldMinGW)
|
2017-04-11 03:44:45 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldELF)
|
|
|
|
FIND_AND_ADD_LLD_LIB(lldCOFF)
|
|
|
|
FIND_AND_ADD_LLD_LIB(lldMachO)
|
2018-06-14 15:28:42 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldWasm)
|
2017-04-11 03:44:45 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldReaderWriter)
|
|
|
|
FIND_AND_ADD_LLD_LIB(lldCore)
|
|
|
|
FIND_AND_ADD_LLD_LIB(lldYAML)
|
2017-10-23 18:43:18 -07:00
|
|
|
FIND_AND_ADD_LLD_LIB(lldCommon)
|
2017-04-11 03:44:45 -07:00
|
|
|
endif()
|
2017-03-13 08:54:56 -07:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-03-25 15:43:28 -07:00
|
|
|
find_package_handle_standard_args(lld DEFAULT_MSG LLD_LIBRARIES LLD_INCLUDE_DIRS)
|
2017-03-13 08:54:56 -07:00
|
|
|
|
|
|
|
mark_as_advanced(LLD_INCLUDE_DIRS LLD_LIBRARIES)
|