<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 9, 2018 at 12:19 PM Stiliyana Stamenova <<a href="mailto:stiliyana.stamenova@gmail.com">stiliyana.stamenova@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>No, we don't need a switch unless we want to be explicit.</div><div><br></div><div>I am not sure what you mean by "fix that instead" - the VS generator? </div></div></blockquote><div><div>What I meant is that if the default behavior (i.e. LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER are not present at CMake configure time) is to use the just built clang, then there is no need for a flag such as LLDB_TEST_JUST_BUILT_CLANG.  Because that would be the same as just not specifying anything.</div><div><br></div><div>What I'm trying to avoid is for people who don't use VS generator having to remember about this in the future.</div></div><div><br></div><div>AFAICT the problem is that CMAKE_CFG_INT_DIR is a string like "$(Configuration)", but in Python we need the string to be something like "%(build_mode)s".  Why don't we just make the path have %(build_mode)s in the first place, instead of making it have $(Configuration)?  Then we don't have to replace anything.</div><div><br></div><div>Specifically, would it make sense to put this logic:</div><div><br></div><div><div>if (CMAKE_CFG_INTDIR STREQUAL ".")</div><div>  set(LLVM_BUILD_MODE ".")</div><div>else ()</div><div>  set(LLVM_BUILD_MODE "%(build_mode)s")</div><div>endif ()</div></div><div><br></div><div>higher up in the LLDB CMake (for example near the top of lldb/CMakeLists.txt), and then don't even use CMAKE_CFG_INT_DIR in the first place?  For example, we could change this:</div><div><br></div><div><div>    set(LLDB_DEFAULT_TEST_C_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")</div><div>    set(LLDB_DEFAULT_TEST_CXX_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")</div></div><div><br></div><div><br></div><div>to this:</div><div><br></div><div><div>    set(LLDB_DEFAULT_TEST_C_COMPILER "${LLVM_BINARY_DIR}/${LLVM_BUILD_MODE}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")</div><div>    set(LLDB_DEFAULT_TEST_CXX_COMPILER "${LLVM_BINARY_DIR}/${LLVM_BUILD_MODE}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")</div></div><div><br></div><div>and similarly replace this:</div><div><br></div><div><div>  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)</div><div>  set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})</div></div><div><br></div><div>with a similar pattern?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">
</div></blockquote></div></div>