[LLVMdev] Understanding some of the recent cmake build changes

Reid Kleckner rnk at google.com
Wed Feb 26 17:19:54 PST 2014


Yep!  This is awesome.  I remember filing a CMake bug about this long ago,
and it looks like this is the answer.


On Wed, Feb 26, 2014 at 5:08 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> I was a bit confused with what the difference was between the old
>
> target_link_libraries(foo bar)
>
> and the new
>
> target_link_libraries(foo INTERFACE|PRIVATE|PUBLIC bar)
>
> To try to find out, I decided to look at the generated build.ninja.
> The difference that shows up is far fewer order only dependencies. For
> example
>
> build lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o:
> CXX_COMPILER /home/espindola/llvm/llvm/lib/TableGen/Error.cpp ||
> lib/libLLVMSupport.a
>
> becomes just
>
> build lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o:
> CXX_COMPILER /home/espindola/llvm/llvm/lib/TableGen/Error.cpp
>
> The net result is that in the old system running
>
> ninja  ./lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o
>
> on a tree just after running cmake would execute 91 commands to build
> lib/libLLVMSupport.a and then Error.cpp.o. On the new system only one
> command is executed :-)
>
> In a more realistic situation, Error.cpp.o will be compiled in
> parallel with the files needed to build lib/libLLVMSupport.a.
>
> Cheers,
> Rafael
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140226/3d4e1b28/attachment.html>


More information about the llvm-dev mailing list