Bug 407625

Summary: Clang source include path in Git MonoRepo
Product: [Developer tools] clazy Reporter: Eugene Zelenko <eugene.zelenko>
Component: generalAssignee: Sergio Martins <smartins>
Status: REPORTED ---    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Eugene Zelenko 2019-05-16 22:18:03 UTC
Clazy could not be built with Git MonoRepo LLVM/Clang, because different path to Clang source include files:

My workaround was:

cmake/FindClang.cmake
-         "${_llvmSourceRoot}/tools/clang/include"     # source dir
+         "${_llvmSourceRoot}/../clang/include"     # source dir

Ideally directory should be checked for existence to support both SubVersion and Git source code layouts.

It may make sense to look onto Include What You Use configuration since it is much simpler, doesn't have such problem and also support LLVM_ENABLE_LIBCXX and LLVM_ENABLE_LLD build variants.
Comment 1 Sergio Martins 2019-05-17 07:20:16 UTC
does it work if you simply add:
${_llvmSourceRoot}/../clang/include"

without removing the old one ?
Comment 2 Eugene Zelenko 2019-05-17 13:23:24 UTC
Most likely it'll work, but it's not good idea to add not existing path into include paths. GCC even has -Wmissing-include-dirs.
Comment 3 Eugene Zelenko 2019-05-17 22:05:05 UTC
Problem with libc++: I build second pass LLVM/Clang with LLVM_ENABLE_LIBCXX and LLVM_ENABLE_LLD. I got a lot of unresolved symbols from libc++ when linking ClazyPlugin.so. Ether Clazy CMake should detect STL from llvm-config or reuse part of LLVM CMake files to setup STL easily.