ROCm / ROCm-CompilerSupport

The compiler support repository provides various Lightning Compiler related services.
47 stars 31 forks source link

Find lld includes in LLVM_INCLUDE_DIRS #17

Closed candrews closed 4 years ago

candrews commented 4 years ago

Allows building against an LLVM build tree

candrews commented 4 years ago

Without this PR, how does one build against an installed ROC LLVM/Clang/lld?

I'm doing: -DLLVM_DIR="/usr/lib/llvm/roc/"

The lld includes are at /usr/lib/llvm/roc/include/lld/ - I can't think of any value for DLLVM_BUILD_MAIN_SRC_DIR= that will result in /usr/lib/llvm/roc/include/lld/ being used.

scott-linder commented 4 years ago

You are not expected to set LLVM_BUILD_MAIN_SRC_DIR, it should be set by LLVMConfig.cmake when using an LLVM build tree. It should not be set for an installed copy of LLVM, which I assume is what is at /usr/lib/llvm/roc/? In an installed copy the lld includes are installed under the same directory as the LLVM includes, so there is not need to explicitly add any directories for LLD.