mirror of https://github.com/libAthena/athena.git
Fix compiling with clang-10
This commit is contained in:
parent
503cc155c6
commit
07b015782b
|
@ -30,6 +30,8 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ATDNA_DYNAMIC_LLVM)
|
if(ATDNA_DYNAMIC_LLVM)
|
||||||
|
find_library(CLANGCPP_LIB clang-cpp HINTS "${LLVM_ROOT_DIR}/lib")
|
||||||
|
if (NOT CLANGCPP_LIB)
|
||||||
list(APPEND LLVM_LIBS
|
list(APPEND LLVM_LIBS
|
||||||
clangFrontend
|
clangFrontend
|
||||||
clangTooling
|
clangTooling
|
||||||
|
@ -43,6 +45,11 @@ if(ATDNA_DYNAMIC_LLVM)
|
||||||
clangLex
|
clangLex
|
||||||
clangBasic
|
clangBasic
|
||||||
LLVM)
|
LLVM)
|
||||||
|
else()
|
||||||
|
list(APPEND LLVM_LIBS
|
||||||
|
clang-cpp
|
||||||
|
LLVM)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_library(LLVMDEMANGLE_LIB LLVMDemangle HINTS "${LLVM_ROOT_DIR}/lib")
|
find_library(LLVMDEMANGLE_LIB LLVMDemangle HINTS "${LLVM_ROOT_DIR}/lib")
|
||||||
find_library(LLVMBINARYFORMAT_LIB LLVMBinaryFormat HINTS "${LLVM_ROOT_DIR}/lib")
|
find_library(LLVMBINARYFORMAT_LIB LLVMBinaryFormat HINTS "${LLVM_ROOT_DIR}/lib")
|
||||||
|
@ -52,18 +59,27 @@ else()
|
||||||
if (NOT LLVMBINARYFORMAT_LIB)
|
if (NOT LLVMBINARYFORMAT_LIB)
|
||||||
set(LLVMBINARYFORMAT_LIB "")
|
set(LLVMBINARYFORMAT_LIB "")
|
||||||
endif()
|
endif()
|
||||||
|
find_library(CLANG_CPP_LIB clang-cpp HINTS "${LLVM_ROOT_DIR}/lib")
|
||||||
|
if (NOT CLANG_CPP_LIB)
|
||||||
|
list(APPEND CLANG_LIBS
|
||||||
|
clangFrontend
|
||||||
|
clangTooling
|
||||||
|
clangDriver
|
||||||
|
clangSerialization
|
||||||
|
clangParse
|
||||||
|
clangSema
|
||||||
|
clangAnalysis
|
||||||
|
clangEdit
|
||||||
|
clangAST
|
||||||
|
clangLex
|
||||||
|
clangBasic)
|
||||||
|
else()
|
||||||
|
list(APPEND CLANG_LIBS
|
||||||
|
clang-cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND LLVM_LIBS
|
list(APPEND LLVM_LIBS
|
||||||
clangFrontend
|
${CLANG_LIBS}
|
||||||
clangTooling
|
|
||||||
clangDriver
|
|
||||||
clangSerialization
|
|
||||||
clangParse
|
|
||||||
clangSema
|
|
||||||
clangAnalysis
|
|
||||||
clangEdit
|
|
||||||
clangAST
|
|
||||||
clangLex
|
|
||||||
clangBasic
|
|
||||||
LLVMCore
|
LLVMCore
|
||||||
LLVMOption
|
LLVMOption
|
||||||
LLVMMCParser
|
LLVMMCParser
|
||||||
|
@ -134,6 +150,7 @@ if(MSVC)
|
||||||
target_compile_options(atdna PRIVATE /GR-)
|
target_compile_options(atdna PRIVATE /GR-)
|
||||||
else()
|
else()
|
||||||
target_compile_options(atdna PRIVATE -fno-rtti -Wno-error)
|
target_compile_options(atdna PRIVATE -fno-rtti -Wno-error)
|
||||||
|
set_property(TARGET atdna PROPERTY CXX_STANDARD 17)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Define installs
|
# Define installs
|
||||||
|
|
|
@ -1261,10 +1261,13 @@ int main(int argc, const char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::IntrusiveRefCntPtr<clang::FileManager> fman(new clang::FileManager(clang::FileSystemOptions()));
|
llvm::IntrusiveRefCntPtr<clang::FileManager> fman(new clang::FileManager(clang::FileSystemOptions()));
|
||||||
|
#if LLVM_VERSION_MAJOR >= 10
|
||||||
|
clang::tooling::ToolInvocation TI(std::move(args), std::make_unique<ATDNAAction>(), fman.get());
|
||||||
|
#else
|
||||||
ATDNAAction* action = new ATDNAAction();
|
ATDNAAction* action = new ATDNAAction();
|
||||||
clang::tooling::ToolInvocation TI(std::move(args), action, fman.get());
|
clang::tooling::ToolInvocation TI(std::move(args), action, fman.get());
|
||||||
|
#endif
|
||||||
if (!TI.run())
|
if (!TI.run())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue