llvm.org GIT mirror llvm / 40d65dc
llvm-config: Use sys::fs::equivalent instead of string comparison. - Hopefully fixes PR11600 (untested). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156865 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 8 years ago
1 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
189189 sys::path::parent_path(CurrentPath)).str();
190190
191191 // Check to see if we are inside a development tree by comparing to possible
192 // locations (prefix style or CMake style). This could be wrong in the face of
193 // symbolic links, but is good enough.
194 if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT) + "/" + LLVM_BUILDMODE) {
192 // locations (prefix style or CMake style).
193 if (sys::fs::equivalent(CurrentExecPrefix,
194 Twine(LLVM_OBJ_ROOT) + "/" + LLVM_BUILDMODE)) {
195195 IsInDevelopmentTree = true;
196196 DevelopmentTreeLayout = MakefileStyle;
197197
203203 } else {
204204 ActiveObjRoot = LLVM_OBJ_ROOT;
205205 }
206 } else if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT)) {
206 } else if (sys::fs::equivalent(CurrentExecPrefix, LLVM_OBJ_ROOT)) {
207207 IsInDevelopmentTree = true;
208208 DevelopmentTreeLayout = CMakeStyle;
209209 ActiveObjRoot = LLVM_OBJ_ROOT;
210 } else if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT) + "/bin") {
210 } else if (sys::fs::equivalent(CurrentExecPrefix,
211 Twine(LLVM_OBJ_ROOT) + "/bin")) {
211212 IsInDevelopmentTree = true;
212213 DevelopmentTreeLayout = CMakeBuildModeStyle;
213214 ActiveObjRoot = LLVM_OBJ_ROOT;