[llvm] r196283 - llvm-config: With --build-mode, show ${CMAKE_CFG_INTDIR} on multiconfig builder.
NAKAMURA Takumi
geek4civic at gmail.com
Tue Dec 3 06:35:17 PST 2013
Author: chapuni
Date: Tue Dec 3 08:35:17 2013
New Revision: 196283
URL: http://llvm.org/viewvc/llvm-project?rev=196283&view=rev
Log:
llvm-config: With --build-mode, show ${CMAKE_CFG_INTDIR} on multiconfig builder.
Modified:
llvm/trunk/tools/llvm-config/CMakeLists.txt
llvm/trunk/tools/llvm-config/llvm-config.cpp
Modified: llvm/trunk/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/CMakeLists.txt?rev=196283&r1=196282&r2=196283&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-config/CMakeLists.txt Tue Dec 3 08:35:17 2013
@@ -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
Modified: llvm/trunk/tools/llvm-config/llvm-config.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.cpp?rev=196283&r1=196282&r2=196283&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.cpp (original)
+++ llvm/trunk/tools/llvm-config/llvm-config.cpp Tue Dec 3 08:35:17 2013
@@ -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") {
More information about the llvm-commits
mailing list