1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

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.

llvm-svn: 197467
This commit is contained in:
NAKAMURA Takumi 2013-12-17 05:48:37 +00:00
parent 42fe1fadc6
commit ce11506dc8

View File

@ -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)