patch for CIndex linakge error on Mingw, set the proper LINKER_LANGUAGE for CIndex and c-index-test

\tools\clang\tools\CIndex && D:\Tools\Building\cmake\bin\cmake.exe -E cmake_link_script CMakeFiles\CIndex.dir\link.txt --verbose=1
D:\Tools\Building\gcc\bin\g++.exe -shared -o …\bin\libCIndex.dll -Wl,–out-implib,…\lib\libCIndex.dll.a -Wl,–major-image-version,0,–minor-image-version,0 CMakeFiles\CIndex.dir\CIndex.cpp.obj …\lib\libLLVMMC.a …\lib\libLLVMSupport.a …\lib\libLLVMSystem.a …\lib\libclangFrontend.a …\lib\libclangIndex.a …\lib\libclangSema.a …\lib\libclangAST.a …\lib\libclangLex.a …\lib\libclangBasic.a -lgcc_eh -lgcc_eh -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
…\lib\libclangFrontend.a(ASTUnit.cpp.obj):ASTUnit.cpp:(.text$_ZN5clang13SourceManagerC1Ev[clang::SourceManager::SourceManager()]+0xf): undefined reference to llvm::BumpPtrAllocator::DefaultSlabAllocator' ..\..\..\..\lib\libclangFrontend.a(ASTUnit.cpp.obj):ASTUnit.cpp:(.text$_ZN5clang13SourceManagerC1Ev[clang::SourceManager::SourceManager()]+0x27): undefined reference to llvm::BumpPtrAllocator::BumpPtrAllocator(unsigned int, unsigned int, llvm::SlabAllocator&)’
…\lib\libclangFrontend.a(ASTUnit.cpp.obj):ASTUnit.cpp:(.text$_ZN5clang13SourceManagerC1Ev[clang::SourceManager::SourceManager()]+0x17f): undefined reference to llvm::BumpPtrAllocator::~BumpPtrAllocator()' ..\..\..\..\lib\libclangFrontend.a(PCHReader.cpp.obj):PCHReader.cpp:(.text+0x61ed): undefined reference to llvm::MemoryBuffer::getMemBuffer(char const*, char const*, char const*)’
…\lib\libclangFrontend.a(PCHReader.cpp.obj):PCHReader.cpp:(.text+0x79d0): undefined reference to llvm::MemoryBuffer::getSTDIN()' ..\..\..\..\lib\libclangFrontend.a(PCHReader.cpp.obj):PCHReader.cpp:(.text+0x7a11): undefined reference to llvm::MemoryBuffer::getFile(char const*, std::string*, long long)’
…\lib\libclangFrontend.a(PCHReader.cpp.obj):PCHReader.cpp:(.text+0x860c): undefined refer

And more

These two patch should apply at the same time.

It’s not a good idea to direct set the LINKER_LANGUAGE
at CMakeLists.txt files.

llvm-AddLLvm-Cmake-patch-for-Dynamic-linkage-Library.patch (2.64 KB)

CIndex-linkage-patch.patch (854 Bytes)