Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
/ swift-llvm Public archive

Fix llvm-config support for CMake build-mode-style builds #165

Open
wants to merge 1 commit into
base: apple/stable/20190619
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions tools/llvm-config/llvm-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down