SUMMARY I'm trying to build clazy with (MSYS2's) MinGW on Windows. I hit some issues, for two I need help. STEPS TO REPRODUCE 1. cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../$(LLVMINSTALLDIR) -DCMAKE_FIND_LIBRARY_SUFFIXES=.a -DCLAZY_MAN_PAGE=OFF ../clazy 2. mingw32-make OBSERVED RESULT First Issue: Linking ClazyPlugin.dll fails, because the LLVM lib files have mixed path separators and \ is not escaped, GCC eats it. > llvm-config --libfiles E:\llvm/lib/libLLVMWindowsManifest.a ... I don't know if this is an error from LLVM, CMake (or its MinGW Makefiles generator), GCC, or clazy. But I never had such an issue building QtCreator (and its clang based plugins) or doxygen. I've found a work around with adding string(REPLACE "\\" "/" LLVM_LIBS ${LLVM_LIBS}) in the FindLLVM.cmake. Second Issue: [100%] Linking CXX executable bin\clazy-standalone.exe E:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: E:/llvm/lib/libclangASTMatchers.a(ASTMatchersInternal.cpp.obj):ASTMatchersInternal.cpp:(.text+0x1310): multiple definition of `clang::ast_matchers::internal::ASTMatchFinder::isTraversalIgnoringImplicitNodes() const'; lib/libClazyPlugin.dll.a(d027125.o):(.text+0x0): first defined here Following multiple symbols. EXPECTED RESULT First Issue: Either escaped backslashes or only forward slashes. Second Issue: I assume the symbols should not be exported from the clazy plugin. SOFTWARE/OS VERSIONS Windows: 7 Qt Version: 5.15.2 ADDITIONAL INFORMATION Up to date msys2, self compiled Qt and LLVM.
Git commit 96de05dd7795d045258db28270b5b27c6ce37021 by Sergio Martins. Committed on 15/05/2021 at 09:07. Pushed by smartins into branch 'master'. README: Mention supported platforms M +7 -0 README.md https://invent.kde.org/sdk/clazy/commit/96de05dd7795d045258db28270b5b27c6ce37021
I don't have bandwidth to support MinGW so won't work on it Can you try if -DLINK_CLAZY_TO_LLVM=OFF helps ? Windows is very tricky to get right MSVC works very differently than MinGW, regarding llvm and plugin symbols
That did not help.