File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
22
22
string (REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD} " )
23
23
configure_file (${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY )
24
24
25
+ # Set build-time environment(s).
26
+ add_definitions (-DCMAKE_CFG_INTDIR= "${CMAKE_CFG_INTDIR} " )
27
+
25
28
# Add the llvm-config tool.
26
29
add_llvm_tool (llvm-config
27
30
llvm-config.cpp
Original file line number Diff line number Diff line change @@ -300,7 +300,12 @@ int main(int argc, char **argv) {
300
300
} else if (Arg == " --host-target" ) {
301
301
OS << LLVM_DEFAULT_TARGET_TRIPLE << ' \n ' ;
302
302
} else if (Arg == " --build-mode" ) {
303
- OS << LLVM_BUILDMODE << ' \n ' ;
303
+ char const *build_mode = LLVM_BUILDMODE;
304
+ #if defined(CMAKE_CFG_INTDIR)
305
+ if (!(CMAKE_CFG_INTDIR[0 ] == ' .' && CMAKE_CFG_INTDIR[1 ] == ' \0 ' ))
306
+ build_mode = CMAKE_CFG_INTDIR;
307
+ #endif
308
+ OS << build_mode << ' \n ' ;
304
309
} else if (Arg == " --obj-root" ) {
305
310
OS << LLVM_OBJ_ROOT << ' \n ' ;
306
311
} else if (Arg == " --src-root" ) {
You can’t perform that action at this time.
0 commit comments