[PATCH] D22499: [llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIR

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 15:30:24 PDT 2017


loladiro updated this revision to Diff 100927.
loladiro edited the summary of this revision.
loladiro added a comment.

Handle absolute path case

I think this should work. Take a look.


https://reviews.llvm.org/D22499

Files:
  tools/llvm-config/BuildVariables.inc.in
  tools/llvm-config/llvm-config.cpp


Index: tools/llvm-config/llvm-config.cpp
===================================================================
--- tools/llvm-config/llvm-config.cpp
+++ tools/llvm-config/llvm-config.cpp
@@ -333,7 +333,9 @@
   } else {
     ActivePrefix = CurrentExecPrefix;
     ActiveIncludeDir = ActivePrefix + "/include";
-    ActiveBinDir = ActivePrefix + "/bin";
+    SmallString<PATH_MAX> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+    sys::fs::make_absolute(ActivePrefix, path);
+    ActiveBinDir = path.str();
     ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
     ActiveIncludeOption = "-I" + ActiveIncludeDir;
Index: tools/llvm-config/BuildVariables.inc.in
===================================================================
--- tools/llvm-config/BuildVariables.inc.in
+++ tools/llvm-config/BuildVariables.inc.in
@@ -34,3 +34,4 @@
 #define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
 #define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@"
 #define LLVM_HAS_GLOBAL_ISEL @LLVM_HAS_GLOBAL_ISEL@
+#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22499.100927.patch
Type: text/x-patch
Size: 1108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170531/954f096f/attachment.bin>


More information about the llvm-commits mailing list