- DevelopmentTreeLayoutIsCMakeStyle = false;
- } else if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT) + "/bin") {
+ DevelopmentTreeLayout = MakefileStyle;
+
+ // If we are in a development tree, then check if we are in a BuildTools
+ // directory. This indicates we are built for the build triple, but we
+ // always want to provide information for the host triple.
+ if (sys::path::filename(LLVM_OBJ_ROOT) == "BuildTools") {
+ ActiveObjRoot = sys::path::parent_path(LLVM_OBJ_ROOT);
+ } else {
+ ActiveObjRoot = LLVM_OBJ_ROOT;
+ }
+ } else if (sys::fs::equivalent(CurrentExecPrefix, LLVM_OBJ_ROOT)) {
+ IsInDevelopmentTree = true;
+ DevelopmentTreeLayout = CMakeStyle;
+ ActiveObjRoot = LLVM_OBJ_ROOT;
+ } else if (sys::fs::equivalent(CurrentExecPrefix,
+ Twine(LLVM_OBJ_ROOT) + "/bin")) {