summaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-17 05:48:37 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-17 05:48:37 +0000
commit16d0e126aa37ff2496aff064f56e32de4e59ea7c (patch)
tree7f57ee874153e382c8e89ad17f766a6052f98f64 /tools/llvm-config
parent5a1c0d6e17c42afc216988651bae80cff3e6fe06 (diff)
llvm-config: Let directories aware of CMAKE_CFG_INTDIR.
With llvm-config.exe --bindir --libdir --build-mode, on Visual Studio 2010, In build tree: (OBJ_ROOT)/bin/MinSizeRel (OBJ_ROOT)/lib/MinSizeRel MinSizeRel In installed tree: (INSTALL_PREFIX)/bin (INSTALL_PREFIX)/lib MinSizeRel This is enhancements since r196283. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/llvm-config.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 63f099f1dac..b12be863426 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -184,6 +184,13 @@ int main(int argc, char **argv) {
std::string CurrentExecPrefix;
std::string ActiveObjRoot;
+ // If CMAKE_CFG_INTDIR is given, honor it as build mode.
+ char const *build_mode = LLVM_BUILDMODE;
+#if defined(CMAKE_CFG_INTDIR)
+ if (!(CMAKE_CFG_INTDIR[0] == '.' && CMAKE_CFG_INTDIR[1] == '\0'))
+ build_mode = CMAKE_CFG_INTDIR;
+#endif
+
// Create an absolute path, and pop up one directory (we expect to be inside a
// bin dir).
sys::fs::make_absolute(CurrentPath);
@@ -239,8 +246,8 @@ int main(int argc, char **argv) {
ActiveLibDir = ActiveObjRoot + "/lib";
break;
case CMakeBuildModeStyle:
- ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE;
- ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE;
+ ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
+ ActiveLibDir = ActiveObjRoot + "/lib/" + build_mode;
break;
}
@@ -300,11 +307,6 @@ int main(int argc, char **argv) {
} else if (Arg == "--host-target") {
OS << LLVM_DEFAULT_TARGET_TRIPLE << '\n';
} else if (Arg == "--build-mode") {
- char const *build_mode = LLVM_BUILDMODE;
-#if defined(CMAKE_CFG_INTDIR)
- if (!(CMAKE_CFG_INTDIR[0] == '.' && CMAKE_CFG_INTDIR[1] == '\0'))
- build_mode = CMAKE_CFG_INTDIR;
-#endif
OS << build_mode << '\n';
} else if (Arg == "--assertion-mode") {
#if defined(NDEBUG)