Bug 407625 - Clang source include path in Git MonoRepo
Summary: Clang source include path in Git MonoRepo
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-16 22:18 UTC by Eugene Zelenko
Modified: 2019-05-17 22:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.