2017-09-13 05:17:19 +01:00
|
|
|
# Copyright (c) 2016 Andrew Kelley
|
|
|
|
# This file is MIT licensed.
|
|
|
|
# See http://opensource.org/licenses/MIT
|
|
|
|
|
|
|
|
# CLANG_FOUND
|
|
|
|
# CLANG_INCLUDE_DIRS
|
|
|
|
# CLANG_LIBRARIES
|
2018-03-17 17:39:58 +00:00
|
|
|
# CLANG_LIBDIRS
|
2017-09-13 05:17:19 +01:00
|
|
|
|
2020-03-22 21:35:06 +00:00
|
|
|
find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
|
2020-04-10 03:28:53 +01:00
|
|
|
PATHS
|
2020-07-25 00:49:43 +01:00
|
|
|
/usr/lib/llvm/11/include
|
|
|
|
/usr/lib/llvm-11/include
|
|
|
|
/usr/lib/llvm-11.0/include
|
|
|
|
/usr/local/llvm110/include
|
|
|
|
/usr/local/llvm11/include
|
2020-04-10 03:28:53 +01:00
|
|
|
/mingw64/include
|
|
|
|
)
|
|
|
|
|
2020-04-10 06:25:15 +01:00
|
|
|
if(ZIG_PREFER_CLANG_CPP_DYLIB)
|
2020-04-17 23:41:21 +01:00
|
|
|
find_library(CLANG_LIBRARIES
|
2020-04-10 03:28:53 +01:00
|
|
|
NAMES
|
2020-07-25 00:49:43 +01:00
|
|
|
clang-cpp-11.0
|
|
|
|
clang-cpp110
|
2020-04-10 03:28:53 +01:00
|
|
|
clang-cpp
|
2020-03-22 21:35:06 +00:00
|
|
|
PATHS
|
2020-04-10 03:28:53 +01:00
|
|
|
${CLANG_LIBDIRS}
|
2020-07-25 00:49:43 +01:00
|
|
|
/usr/lib/llvm-11/lib
|
|
|
|
/usr/local/llvm110/lib
|
|
|
|
/usr/local/llvm11/lib
|
2020-04-10 03:28:53 +01:00
|
|
|
)
|
|
|
|
endif()
|
2020-03-22 21:35:06 +00:00
|
|
|
|
2020-04-17 23:41:21 +01:00
|
|
|
if(NOT CLANG_LIBRARIES)
|
2020-04-10 03:28:53 +01:00
|
|
|
macro(FIND_AND_ADD_CLANG_LIB _libname_)
|
2020-03-22 21:35:06 +00:00
|
|
|
string(TOUPPER ${_libname_} _prettylibname_)
|
|
|
|
find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
|
2020-04-10 03:28:53 +01:00
|
|
|
PATHS
|
|
|
|
${CLANG_LIBDIRS}
|
2020-07-25 00:49:43 +01:00
|
|
|
/usr/lib/llvm/11/lib
|
|
|
|
/usr/lib/llvm-11/lib
|
|
|
|
/usr/lib/llvm-11.0/lib
|
|
|
|
/usr/local/llvm110/lib
|
|
|
|
/usr/local/llvm11/lib
|
2020-04-10 03:28:53 +01:00
|
|
|
/mingw64/lib
|
|
|
|
/c/msys64/mingw64/lib
|
|
|
|
c:\\msys64\\mingw64\\lib
|
|
|
|
)
|
2020-04-12 03:09:17 +01:00
|
|
|
if(CLANG_${_prettylibname_}_LIB)
|
|
|
|
set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_${_prettylibname_}_LIB})
|
|
|
|
endif()
|
2020-04-10 03:28:53 +01:00
|
|
|
endmacro(FIND_AND_ADD_CLANG_LIB)
|
2020-03-22 21:35:06 +00:00
|
|
|
|
2020-04-10 03:28:53 +01:00
|
|
|
FIND_AND_ADD_CLANG_LIB(clangFrontendTool)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangCodeGen)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangFrontend)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangDriver)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSerialization)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSema)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerFrontend)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangAnalysis)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangASTMatchers)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangAST)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangParse)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSema)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangBasic)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangEdit)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangLex)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangARCMigrate)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangRewrite)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangCrossTU)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangIndex)
|
|
|
|
endif()
|
2017-09-13 05:17:19 +01:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-03-25 22:43:28 +00:00
|
|
|
find_package_handle_standard_args(clang DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS)
|
2017-09-13 05:17:19 +01:00
|
|
|
|
2018-03-17 17:39:58 +00:00
|
|
|
mark_as_advanced(CLANG_INCLUDE_DIRS CLANG_LIBRARIES CLANG_LIBDIRS)
|