<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 7, 2014 at 1:59 AM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 02/06/2014 01:02 PM, Alexey Samsonov wrote:<br>
> OK, I feel like I need to learn more about ExternalProject_Add magic.<br>
<br>
</div>It is the CMake equivalent to a configure+make build target that<br>
runs configure+make for another project.<br>
<div class="im"><br>
> I have a few quick questions for people with knowledge - currently:<br>
> 1) "compiler-rt"'s CMake needs to know about targets in the Clang build tree ("clang") and<br>
> in LLVM build tree ("FileCheck", llvm-* command-line tools, googletest etc.), and uses common<br>
> macro from LLVM's CMake modules like "configute_lit_site_cfg", "parse_arguments".<br>
<br>
</div>This will be possible once LLVM and Clang are taught to provide proper<br>
content in LLVMConfig.cmake and ClangConfig.cmake package configuration<br>
files. The patch series I proposed in the thread Greg linked at the<br>
start of this thread is the first step to do that.<br>
<div class="im"><br>
> 2) top-level targets from compiler-rt's CMake files are visible at the root of LLVM's build tree,<br>
> so that I can run "make check-asan" or even "make clang_rt.asan-x86_64" from the root of<br>
> the build tree.<br>
<br>
</div>This would not work with ExternalProject_Add because the CMake<br>
running on LLVM or Clang would not see the targets in compiler-rt<br>
since the project will not even be processed until build (make) time.<br>
In return the compiler-rt would be able to build using the just-built<br>
Clang because it will now be available when CMake runs on compiler-rt.<br>
(IIUC this is currently the case for configure+make.) Also compiler-rt<br>
could now be built outside of a LLVM/Clang that was built unaware of<br>
compiler-rt.<br></blockquote><div><br></div><div>I see the benefit in using just-built Clang, but it's a pity to lose the ability to</div><div>add convenient top-level targets from compiler-rt project. It also means</div>
<div>that we'd need to add "fake" top-level custom targets (that would configure +</div><div>build + do something) in compiler-rt build tree if we want to, say,</div><div>run compiler-rt test suite as a part of "make check-all" command.</div>
<div><br></div><div>I'll take a look at your patches for ExternalProject that were recently</div><div>submitted.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It is also possible to make project/compiler-rt build optionally<br>
with add_subdirectory instead of ExternalProject_Add, as it does now,<br>
with the cost of not using the just-built Clang.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Brad<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>