hanchenye-llvm-project/lldb/utils
Stefan Granitz 088410ffc6 [CMake] Add special case for processing LLDB_DOTEST_ARGS
Summary:
Allow to run the test suite when building LLDB Standalone with Xcode against a provided LLVM build-tree that used a single-configuration generator like Ninja.

So far both test drivers, lit-based `check-lldb` as well as `lldb-dotest`, were looking for test dependencies (clang/dsymutil/etc.) in a subdirectory with the configuration name (Debug/Release/etc.). It was implicitly assuming that both, LLDB and the provided LLVM used the same generator. In practice, however, the opposite is quite common: build the dependencies with Ninja and LLDB with Xcode for development*. With this patch it becomes the default.

(* In fact, it turned out that the Xcode<->Xcode variant didn't even build out of the box. It's fixed since D62879)

Once this is sound, I'm planning the following steps:
* add stage to the [lldb-cmake-standalone bot](http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone/) to build and test it
* update `Building LLDB with Xcode` section in the docs
* bring the same mechanism to swift-lldb
* fade out the manually maintained Xcode project

On macOS build and test like this:
```
$ git clone https://github.com/llvm/llvm-project.git /path/to/llvm-project

$ cd /path/to/lldb-dev-deps
$ cmake -GNinja -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi" /path/to/llvm-project/llvm
$ ninja

$ cd /path/to/lldb-dev-xcode
$ cmake -GXcode -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLDB_BUILD_FRAMEWORK=Off -DLLVM_DIR=/path/to/lldb-dev-deps/lib/cmake/llvm -DClang_DIR=/path/to/lldb-dev-deps/lib/cmake/clang /path/to/llvm-project/lldb
$ xcodebuild -configuration Debug -target check-lldb
$ xcodebuild -configuration Debug -target lldb-dotest
$ ./Debug/bin/lldb-dotest
```

Reviewers: JDevlieghere, jingham, xiaobai, stella.stamenova, labath

Reviewed By: stella.stamenova

Subscribers: labath, mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62859

llvm-svn: 362803
2019-06-07 14:32:51 +00:00
..
git-svn Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
lit-cpuid [CMake] Folder structure for generated Xcode project to cover more targets 2019-05-28 09:29:05 +00:00
lldb-dotest [CMake] Add special case for processing LLDB_DOTEST_ARGS 2019-06-07 14:32:51 +00:00
lui Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
misc Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
sync-source Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
test Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
vim-lldb Python 2/3 compatibility: from __future__ import print_function 2019-03-21 18:27:40 +00:00