[LLVMdev] compiler-rt CMake build

Brad King brad.king at kitware.com
Thu Feb 6 13:59:36 PST 2014


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.

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




More information about the llvm-dev mailing list