<div dir="ltr">Yep! This is awesome. I remember filing a CMake bug about this long ago, and it looks like this is the answer.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 5:08 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was a bit confused with what the difference was between the old<br>
<br>
target_link_libraries(foo bar)<br>
<br>
and the new<br>
<br>
target_link_libraries(foo INTERFACE|PRIVATE|PUBLIC bar)<br>
<br>
To try to find out, I decided to look at the generated build.ninja.<br>
The difference that shows up is far fewer order only dependencies. For<br>
example<br>
<br>
build lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o:<br>
CXX_COMPILER /home/espindola/llvm/llvm/lib/TableGen/Error.cpp ||<br>
lib/libLLVMSupport.a<br>
<br>
becomes just<br>
<br>
build lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o:<br>
CXX_COMPILER /home/espindola/llvm/llvm/lib/TableGen/Error.cpp<br>
<br>
The net result is that in the old system running<br>
<br>
ninja ./lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o<br>
<br>
on a tree just after running cmake would execute 91 commands to build<br>
lib/libLLVMSupport.a and then Error.cpp.o. On the new system only one<br>
command is executed :-)<br>
<br>
In a more realistic situation, Error.cpp.o will be compiled in<br>
parallel with the files needed to build lib/libLLVMSupport.a.<br>
<br>
Cheers,<br>
Rafael<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>