[cmake-developers] [PATCH 0/3] The CMake Ninja generator.
Peter Collingbourne
peter at pcc.me.uk
Tue Nov 22 17:52:37 EST 2011
On Tue, Nov 22, 2011 at 09:21:59PM +0100, Alexander Neundorf wrote:
> On Tuesday 22 November 2011, Peter Collingbourne wrote:
> > On Tue, Nov 15, 2011 at 06:54:01PM +0100, Nicolas Desprès wrote:
> > > On Tue, Nov 15, 2011 at 5:29 PM, Bill Hoffman
> <bill.hoffman at kitware.com>wrote:
> > > > On 11/11/2011 9:36 PM, Peter Collingbourne wrote:
> > > > Note that this generator is *nix only (it relies on POSIX shell
> > > >
> > > >> functionality), and will only be built on *nix platforms. I am not
> > > >> interested in Windows support, but I understand that others have
> > > >> expressed an interest in adding support.
> > > >>
> > > >> How much of the POSIX shell stuff can be done with cmake -E stuff?
> > > >> It
> > > >
> > > > would be good to use as little POSIX stuff as possible as someday when
> > > > someone does the inevitable windows port it is easier...
> > >
> > > Too much in my opinion. Specially the && operator of the shell. Using
> > > cmake -E is the first step. I am planning to suggest an evolution of
> > > Ninja to fix this issue. Actually, it is the main issue which stop me
> > > while writing the beginning of this generator.
> >
> > Other than && we also have:
> >
> > rm -f $file -- used to delete static library archives before rebuilding
>
> cmake -E remove -f $file
I can't see a cmd.exe builtin with the same semantics as rm -f.
But it looks like the -f flag causes cmake to exit with a status
of 0 regardless of whether it was able to remove the file, which is
probably not what we want. "cmake -E remove $file" should work.
> > : -- used as a no-op command
>
> maybe
> cmake -E echo
I don't think that we should spawn another process just for a no-op,
especially on Windows where process creation is expensive. We should
use a shell builtin for this. I can't see a cmd.exe builtin which
is explicitly a no-op, but perhaps a builtin with no effect such as
"echo off" would work.
Anyway, that change should be done by whoever does the Windows port.
Thanks,
--
Peter
More information about the cmake-developers
mailing list