This is an archive of the discontinued LLVM Phabricator instance.

TableGen.cmake: Use DEPFILE for Ninja Generator with CMake>=3.7.
ClosedPublic

Authored by chapuni on May 30 2017, 7:06 PM.

Details

Summary

CMake emits build targets as relative paths (from build.ninja) but Ninja doesn't identify absolute path (in *.d) as relative path (in build.ninja).
So, let file names, in the command line, relative from ${CMAKE_BINARY_DIR}, where build.ninja is.

Note that tblgen is executed on ${CMAKE_BINARY_DIR} as working directory.

Not tested on msvc/ninja yet, due to avoiding reinstallation of newer CMake.

Diff Detail

Repository
rL LLVM

Event Timeline

chapuni created this revision.May 30 2017, 7:06 PM

I have confirmed it works on ninja.exe with CMake-3.9.

include/llvm/IR/Intrinsics.gen.tmp:
  C:/path/to/llvm-project/llvm/include\llvm/CodeGen/ValueTypes.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsAArch64.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsAMDGPU.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsARM.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsBPF.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsHexagon.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsMips.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsNVVM.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsPowerPC.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsSystemZ.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsWebAssembly.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsX86.td
  C:/path/to/llvm-project/llvm/include\llvm/IR/IntrinsicsXCore.td

Each dependent contains '\\' but it's not a problem since each of them is not a target but a dependent source. Ninja.exe is correctly stat-ing them as I expect.

@beanz, I will commit it within a few days.

beanz accepted this revision.Jun 21 2017, 3:00 PM

This looks great! Thanks for doing this.

This revision is now accepted and ready to land.Jun 21 2017, 3:00 PM
This revision was automatically updated to reflect the committed changes.