[cmake-developers] [PATCH] Use full path for all source files in ninja build.
Brad King
brad.king at kitware.com
Wed Aug 3 08:56:12 EDT 2016
On 08/02/2016 04:42 PM, Chaoren Lin wrote:
> Our IDE uses "cmake --build /path/to/build" to invoke the build,
> so that we only have to deal with CMake and not the underlying build system.
If you know /path/to/build why not just interpret relative paths with
respect to it as a heuristic? If the paths exist then use them.
> Maybe I can try to fix ninja to resolve paths before sending them to the compiler.
The ninja build tool itself does not have enough information to make
such a transformation. CMake does though. See below.
> Or maybe just add a flag to ConvertToNinjaPath or something.
ConvertToNinjaPath is called from several places that don't all know
whether the file they are passing is a source file for compilation
or not.
Another approach is to use ConvertToNinjaPath for all the build.ninja
inputs and outputs on build statements but use something other than $in
for the source file on the compilation rule. Using an "IN_ABS = ..."
variable could achieve this.
-Brad
More information about the cmake-developers
mailing list