simplify cmake logic for finding clang

which fixes the build on windows
This commit is contained in:
Andrew Kelley 2020-03-22 17:35:06 -04:00
parent 87b8b69eb0
commit f9992850a5

View File

@ -7,35 +7,6 @@
# CLANG_LIBRARIES # CLANG_LIBRARIES
# CLANG_LIBDIRS # CLANG_LIBDIRS
if(MSVC)
find_package(CLANG REQUIRED CONFIG)
set(CLANG_LIBRARIES
clangFrontendTool
clangCodeGen
clangFrontend
clangDriver
clangSerialization
clangSema
clangStaticAnalyzerFrontend
clangStaticAnalyzerCheckers
clangStaticAnalyzerCore
clangAnalysis
clangASTMatchers
clangAST
clangParse
clangSema
clangBasic
clangEdit
clangLex
clangARCMigrate
clangRewriteFrontend
clangRewrite
clangCrossTU
clangIndex
)
else()
find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
PATHS PATHS
/usr/lib/llvm/10/include /usr/lib/llvm/10/include
@ -83,7 +54,6 @@ else()
FIND_AND_ADD_CLANG_LIB(clangRewrite) FIND_AND_ADD_CLANG_LIB(clangRewrite)
FIND_AND_ADD_CLANG_LIB(clangCrossTU) FIND_AND_ADD_CLANG_LIB(clangCrossTU)
FIND_AND_ADD_CLANG_LIB(clangIndex) FIND_AND_ADD_CLANG_LIB(clangIndex)
endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CLANG DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS) find_package_handle_standard_args(CLANG DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS)