[LLVMdev] compiler-rt CMake build

Brad King brad.king at kitware.com
Tue Feb 25 07:02:54 PST 2014


On 02/25/2014 03:28 AM, Alexey Samsonov wrote:
> Then I run
> $ ninja compiler-rt
> twice. The first run builds the libraries, the second shows only:
> "ninja: no work to do." message.

I'm able to reproduce that, thanks.  This is a subtle interaction
between always-out-of-date rules and order-only dependencies.

The problem is that the build.ninja file has the rule:

 build projects/compiler-rt/src/compiler-rt-stamp/compiler-rt-force-reconfigure: phony || bin/clang bin/llvm-config

to express the always-out-of-date force-reconfigure rule.  The Ninja
documentation says:

 "If a phony build statement is written without any dependencies,
  the target will be considered out of date if it does not exist."

However, the rule has dependencies because the Ninja generator implements
add_dependencies by adding order-only dependencies to every individual
rule in the dependent target on all dependencies.

It looks like the Ninja generator needs to write a rule is always out
of date but still has order-only dependencies.  I think this will work:

 build projects/compiler-rt/src/compiler-rt-stamp/compiler-rt-force-reconfigure: phony | always || bin/clang bin/llvm-config
 build always: phony

I've recorded this issue in the CMake issue tracker:

 http://www.cmake.org/Bug/view.php?id=14771

-Brad



More information about the llvm-dev mailing list