stella.stamenova added a comment.

Since Visual Studio as a Generator supports multiple build configurations, each 
of the CMakeLists.txt that correspond to lit tests also need to include 
handling of the build mode unless you can guarantee that all the properties are 
set correctly before test/CMakeLists.txt is processed. It would be safer, of 
course, to not rely on build order and always set the correct properties. This 
is to create project files that allow the build mode to be specified at 
build/compile time of the project rather than configuration time when CMake is 
called.

So you will need to add something along the lines of (Note: I think these are 
all the properties you will need, but I have not tested the change, so you will 
need to make sure this covers all the properties):

  if (CMAKE_CFG_INTDIR STREQUAL ".")
    set(LLVM_BUILD_MODE ".")
  else ()
    set(LLVM_BUILD_MODE "%(build_mode)s")
  endif ()
  
  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR})
  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR 
${LLVM_RUNTIME_OUTPUT_INTDIR})

I suspect you will also need to add handling for the custom c/cxx compiler 
options. You can look at: `lldb/lit/lit.site.cfg.in` and 
`lldb/lit/CMakeLists.txt` for the details.


Repository:
  rL LLVM

https://reviews.llvm.org/D45333



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to