llvm-config-2: Fix --cflags and --includedir which pointed at the wrong
authorDaniel Dunbar <daniel@zuster.org>
Thu, 1 Dec 2011 20:00:19 +0000 (20:00 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 1 Dec 2011 20:00:19 +0000 (20:00 +0000)
directory when running from a build directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145622 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-config-2/llvm-config.cpp

index fddd481230b5a8fbb1ea4c66b1adb835cf2a0117..bf3357e9f2f24daa805e8754a96ed4dc82e0e04b 100644 (file)
@@ -210,16 +210,15 @@ int main(int argc, char **argv) {
   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir;
   std::string ActiveIncludeOption;
   if (IsInDevelopmentTree) {
+    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
     ActivePrefix = CurrentExecPrefix;
 
     // CMake organizes the products differently than a normal prefix style
     // layout.
     if (DevelopmentTreeLayoutIsCMakeStyle) {
-      ActiveIncludeDir = ActiveObjRoot + "/include";
       ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE;
       ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE;
     } else {
-      ActiveIncludeDir = ActiveObjRoot + "/include";
       ActiveBinDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/bin";
       ActiveLibDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/lib";
     }