<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 9:58 PM, 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>On 02/26/2014 12:43 PM, Alexey Samsonov wrote:<br>
> Do you think it makes sense to land my ExternalProject_Add patch<br>
> so that others can experiment with it? I can add quit with a<br>
> fatal_error/warning if the build tree rules are generated with Ninja.<br>
<br>
</div>Since it is conditional on LLVM_BUILD_EXTERNAL_COMPILER_RT, yes.<br></blockquote><div><br></div><div>Submitted as r202367.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
> parallelism doesn't work when I run "make check-compiler-rt -j8"<br>
> in the original build tree, presumably because we call<br>
> "cd /path/to/compiler-rt/build/tree && make check-all" there.<br>
<br>
</div>Right.  The ExternalProject module has a special case for the<br>
Makefile generators to make with $(MAKE) instead of "make":<br>
<br>
 <a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/ExternalProject.cmake;hb=v2.8.12.2#l846" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/ExternalProject.cmake;hb=v2.8.12.2#l846</a><br>


<br>
so that flags like -j propagate automatically.  You could do<br>
that too:<br>
<br>
  if(CMAKE_GENERATOR MATCHES "Make")<br>
    set(check_compiler_rt "$(MAKE)" "check-all")<br>
  else()<br>
    set(check_compiler_rt ${CMAKE_COMMAND} --build .<br>
      --target check-all --config $<CONFIGURATION>)<br>
  endif()<br>
<br>
  ExternalProject_Get_Property(compiler-rt BINARY_DIR)<br>
  add_custom_target(check-compiler-rt<br>
    COMMAND ${check_compiler_rt}<br>
    DEPENDS compiler-rt<br>
    WORKING_DIRECTORY ${BINARY_DIR}<br>
    VERBATIM<br>
    )<br>
<span><font color="#888888"><br></font></span></blockquote><div><br></div><div>This worked, thanks! Currently I also print fatal_error message if I detect Ninja as a CMAKE_GENERATOR.</div></div><br clear="all"><div><br></div>
-- <br><div>Alexey Samsonov, MSK</div>
</div></div>