summaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-03 14:35:17 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-03 14:35:17 +0000
commit94f5a677f66e748bcbf7f3e6974881754acf87b2 (patch)
treeea85062240eda02a5cbf5aaedf08c67e73f8dac3 /tools/llvm-config
parent5a10a7cccf9186789ff8591ec7139000a41bc6b6 (diff)
llvm-config: With --build-mode, show ${CMAKE_CFG_INTDIR} on multiconfig builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/CMakeLists.txt3
-rw-r--r--tools/llvm-config/llvm-config.cpp7
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index c651833b548..e653b7790c4 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -22,6 +22,9 @@ set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
+# Set build-time environment(s).
+add_definitions(-DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}")
+
# Add the llvm-config tool.
add_llvm_tool(llvm-config
llvm-config.cpp
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 3924e2e55da..fc47bdee36f 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -300,7 +300,12 @@ int main(int argc, char **argv) {
} else if (Arg == "--host-target") {
OS << LLVM_DEFAULT_TARGET_TRIPLE << '\n';
} else if (Arg == "--build-mode") {
- OS << LLVM_BUILDMODE << '\n';
+ 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 == "--obj-root") {
OS << LLVM_OBJ_ROOT << '\n';
} else if (Arg == "--src-root") {