aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-03-25 00:03:33 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-07-26 14:51:12 +0000
commita5640968f2f7485b2aa4919f5fa68fd8f23e2d1f (patch)
tree617d4cdfad7f344b03a019797a47945b44753b55 /llvm/tools/llvm-config/llvm-config.cpp
parent28e665fa054d62d4e2c777774cc83dea533dfe6e (diff)
downloadllvm-a5640968f2f7485b2aa4919f5fa68fd8f23e2d1f.zip
llvm-a5640968f2f7485b2aa4919f5fa68fd8f23e2d1f.tar.gz
llvm-a5640968f2f7485b2aa4919f5fa68fd8f23e2d1f.tar.bz2
[llvm][cmake] Follow up to D117973
1. Slightly document the "mark advanced" variable used to control the installed CMake package dir. I would document it more, but I am considering in the future adding pkg-config support in this manner, after which `_PACKGE_DIR` is probably better called `_CMAKE_PACKGE_DIR` or similar. 2. Convey the custom path to the legacy `llvm-config` binary. Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D130539
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index e9fa7bd..2c6c55f 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -370,7 +370,11 @@ int main(int argc, char **argv) {
ActiveBinDir = std::string(Path.str());
}
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ {
+ SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
+ sys::fs::make_absolute(ActivePrefix, Path);
+ ActiveCMakeDir = std::string(Path.str());
+ }
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}