[PATCH 0/2][CMake] Availability of out-of-source-tree clang from llvm

Hello.

On Windows, I have met problems to locate "clang" repository onto tools/clang,
Especially, it would be better "clang" would not be located in
llvm/tools in some opportunities.
Yes, I am constructing synthesized meta-repository including both llvm
and clang.

Symlink-like features would not work better with cmake, GNU make etc.

Then, I propose an easier way to be available to refer to
out-of-source-tree clang.

1) By default, tools/clang is assumed.
2) To set LLVM_CLANG_SOURCE_DIR, you can specify clang source tree
wherever you like. (It points tools/clang by default)
3) To set LLVM_CLANG_SOURCE_DIR as empty or invalid, you can suppress
building clang. Then, LLVM_BUILD_CLANG could be deprecated.
X) Wherever clang source tree is, clang is built under tools/clang.

NAKAMURA Takumi (2):
  CMake: Introduce LLVM_CLANG_SOURCE_DIR, "tools/clang" by default.
    Clang will not be built if LLVM_CLANG_SOURCE_DIR="" or
    ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt is not found.
  Deprecate LLVM_BUILD_CLANG. You can skip building clang to define
    LLVM_BUILD_CLANG="" instead.

docs/CMake.html | 5 +++++
tools/CMakeLists.txt | 12 ++++++------
2 files changed, 11 insertions(+), 6 deletions(-)

Doesn't you consider making possible to build Clang from it's own tree, i.e.:
1) Build LLVM with no tools/clang
2) Checkout Clang into arbitrary place
3) Run CMake from Clang dir with setting LLVM_SOURCE_DIR
?

Doesn't you consider making possible to build Clang from it's own tree, i.e.:
1) Build LLVM with no tools/clang
2) Checkout Clang into arbitrary place
3) Run CMake from Clang dir with setting LLVM_SOURCE_DIR
?

Hello Konstantin,

No. Of course I know I would be an option, though.

  - I don't want to build in two place.
  - standalone clang tree is immature. eg. it lacks capability of unittests.
  - Separated builds tend to lose dependencies.

...Takumi