summaryrefslogtreecommitdiff
path: root/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-config/llvm-config.cpp')
-rw-r--r--tools/llvm-config/llvm-config.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 3924e2e55d..fc47bdee36 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") {