When a user has CMAKE_NINJA=yes set in /etc/make.conf to use ninja instead of make to build a CMake-based port, that can be overridden when a port has USES=gmake after USES=cmake, leading to a build and stage failure.
For example, building x11/kde4-workspace with CMAKE_NINJA=yes causes Uses/gmake.mk to override MAKE_CMD, and `make build' or `make stage' end up calling gmake instead of ninja. Since CMake generated build.ninja files, gmake will not do anything other than printing its version information.
I think that a port should have only 1 USES that sets MAKE_CMD.
If it needs 2 tools, like scons calling gmake, it should have USES=scons + a build dependency on gmake.
Can't you use something like this?
Also "USES=gmake cmake" is different from "USES=cmake gmake" but it's quite dirty to rely on this.
(In reply to Antoine Brodin from comment #1)
> Can't you use something like this?
> .if !defined(CMAKE_NINJA)
> USES+= gmake
The problem with this is that it adds a burden to every single port that uses CMake and cannot be built with bmake, which is not very feasible.
One thing tcberner@ thought of a while ago was this in Uses/cmake.mk:
which would give preference to ninja as expected. Would something like this be OK?
(In reply to Raphael Kubo da Costa from comment #2)
This will still bring gmake in the build depends.
Maybe a USES= cmake:something, which brings either gmake.mk or ninja.mk depending on CMAKE_NINJA?
I think that there should be an exp-run with CMAKE_NINJA=yes and USES=gmake neutralized to determine what are the actual needs of the ports:
- Are there ports that build fine with gmake but fail to build with ninja?
- Are there ports that build fine with bsd make but fail to build with ninja?
- Are there ports that build fine with either gmake or ninja?
# Neutralize gmake.mk for the exp-run
(In reply to Antoine Brodin from comment #4)
> I think that there should be an exp-run with CMAKE_NINJA=yes and USES=gmake
> neutralized to determine what are the actual needs of the ports:
> - Are there ports that build fine with gmake but fail to build with ninja?
> - Are there ports that build fine with bsd make but fail to build with ninja?
> - Are there ports that build fine with either gmake or ninja?
I work on that, but what's the desired effect of those results on this bug?
A commit references this bug:
Date: Sun Jun 25 21:08:06 UTC 2017
New revision: 444324
Make ninja opt-out in cmake.mk
Using ninja instead of make (1) can lead to significant speed ups while building.
Therefore switch from having the ninja generator opt-in to having it opt-out.
Previously cmake-ports that wanted to use ninja could set
now, ports that do not work with ninja can set
Note, that needing this should be an exception and most often points to a broken
cmake of the port.
The ports using cmake were modified
* removed USES=gmake, if ninja is used
* removed MAKE_ARGS, if ninja is used
* added the cmake-argument noninja if necessary
Exp-run by: antoine
Reviewed by: rakuco
Differential Revision: https://reviews.freebsd.org/D10748