[LLVMdev] compiler-rt CMake build

Alexey Samsonov samsonov at google.com
Mon Feb 10 02:42:55 PST 2014


On Fri, Feb 7, 2014 at 1:59 AM, Brad King <brad.king at kitware.com> wrote:

> On 02/06/2014 01:02 PM, Alexey Samsonov wrote:
> > OK, I feel like I need to learn more about ExternalProject_Add magic.
>
> It is the CMake equivalent to a configure+make build target that
> runs configure+make for another project.
>
> > I have a few quick questions for people with knowledge - currently:
> > 1) "compiler-rt"'s CMake needs to know about targets in the Clang build
> tree ("clang") and
> > in LLVM build tree ("FileCheck", llvm-* command-line tools, googletest
> etc.), and uses common
> > macro from LLVM's CMake modules like "configute_lit_site_cfg",
> "parse_arguments".
>
> This will be possible once LLVM and Clang are taught to provide proper
> content in LLVMConfig.cmake and ClangConfig.cmake package configuration
> files.  The patch series I proposed in the thread Greg linked at the
> start of this thread is the first step to do that.
>
> > 2) top-level targets from compiler-rt's CMake files are visible at the
> root of LLVM's build tree,
> > so that I can run "make check-asan" or even "make clang_rt.asan-x86_64"
> from the root of
> > the build tree.
>
> This would not work with ExternalProject_Add because the CMake
> running on LLVM or Clang would not see the targets in compiler-rt
> since the project will not even be processed until build (make) time.
> In return the compiler-rt would be able to build using the just-built
> Clang because it will now be available when CMake runs on compiler-rt.
> (IIUC this is currently the case for configure+make.)  Also compiler-rt
> could now be built outside of a LLVM/Clang that was built unaware of
> compiler-rt.
>

I see the benefit in using just-built Clang, but it's a pity to lose the
ability to
add convenient top-level targets from compiler-rt project. It also means
that we'd need to add "fake" top-level custom targets (that would configure
+
build + do something) in compiler-rt build tree if we want to, say,
run compiler-rt test suite as a part of "make check-all" command.

I'll take a look at your patches for ExternalProject that were recently
submitted.


>
> It is also possible to make project/compiler-rt build optionally
> with add_subdirectory instead of ExternalProject_Add, as it does now,
> with the cost of not using the just-built Clang.
>
> -Brad
>
>


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140210/e331aaef/attachment.html>


More information about the llvm-dev mailing list