[Lldb-commits] [PATCH] D39215: Default to using in-tree clang for building test executables

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 23 20:24:52 PDT 2017


labath added a comment.

In https://reviews.llvm.org/D39215#904677, @zturner wrote:

> Ok the issue is that you cant use CMake generator expressions in this way.  This should work though:
>
>   if (TARGET clang)
>     set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
>   else()
>     set(LLDB_DEFAULT_TEST_COMPILER "")
>   endif()


That will work, if you don't mind that it will break on multi-configuration builds such as visual studio (though I am not sure how/if regular lit tests work in that scenario). We don't run those tests anyway, and I do not think they are ready to be used, so I definitely won't mind.

> I think you might be able to do something like:
> 
>   if (TARGET clang)
>     get_property(LLDB_DEFAULT_TEST_COMPILER TARGET clang PROPERTY LOCATION)
>   endif()

This (although recommended by stack overflow), does not work on cmake 3.0+.


https://reviews.llvm.org/D39215





More information about the lldb-commits mailing list