summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2019-08-16 17:17:45 +0000
committerJordan Rose <jordan_rose@apple.com>2019-08-16 17:17:45 +0000
commitea0ace75e03466d3ee32433828ecb8a780cb5925 (patch)
tree4532f2cf89f8e31fbc7d66f227fc797fdc79727d
parent7ca1e0c825e6242148d14e9f5f727c98a3f3fd11 (diff)
downloadbcm5719-llvm-ea0ace75e03466d3ee32433828ecb8a780cb5925.tar.gz
bcm5719-llvm-ea0ace75e03466d3ee32433828ecb8a780cb5925.zip
Fix llvm-config support for CMake build-mode-style builds
At some point we and/or CMake changed our build-mode-style builds from $LLVM_OBJ_ROOT/bin/$CMAKE_CFG_INTDIR/ to $LLVM_OBJ_ROOT/$CMAKE_CFG_INTDIR/bin/ which is way easier to use. But no one updated llvm-config. https://reviews.llvm.org/D66326 llvm-svn: 369129
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index 7ef7c46a262..6c31df3e173 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -291,8 +291,8 @@ int main(int argc, char **argv) {
IsInDevelopmentTree = true;
DevelopmentTreeLayout = CMakeStyle;
ActiveObjRoot = LLVM_OBJ_ROOT;
- } else if (sys::fs::equivalent(CurrentExecPrefix,
- Twine(LLVM_OBJ_ROOT) + "/bin")) {
+ } else if (sys::fs::equivalent(sys::path::parent_path(CurrentExecPrefix),
+ LLVM_OBJ_ROOT)) {
IsInDevelopmentTree = true;
DevelopmentTreeLayout = CMakeBuildModeStyle;
ActiveObjRoot = LLVM_OBJ_ROOT;
@@ -319,11 +319,14 @@ int main(int argc, char **argv) {
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
break;
case CMakeBuildModeStyle:
+ // FIXME: Should we consider the build-mode-specific path as the prefix?
ActivePrefix = ActiveObjRoot;
- ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
+ ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin";
ActiveLibDir =
- ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX;
+ // The CMake directory isn't separated by build mode.
+ ActiveCMakeDir =
+ ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX + "/cmake/llvm";
break;
}
OpenPOWER on IntegriCloud