[cmake-developers] Fortran detection, issue 9220
Ben Boeckel
ben.boeckel at kitware.com
Wed Feb 11 10:27:21 EST 2015
On Wed, Feb 11, 2015 at 09:44:26 -0500, Brad King wrote:
> We already guarantee that CMAKE_<LANG>_COMPILER is set, so we could indicate
> failure simply by having it not set.
Well, the problem is that that is valid in Ninja. It might be available,
but it isn't going to be useful.
> Also one would need to decide what determines whether an optional language
> is not available. If a compiler is available but cannot compile binaries,
> should that be an error or tolerated as "not available"? As a user I would
> expect setting FC=/path/to/gfortran in my environment before calling CMake
> to cause Fortran to be enabled if the project wants it or else an error.
I guess there are two different issues here. Some projects want Fortran
if available (or even to just see whether it is available) while Ninja
needs to error out on Fortran because it just can't get the build
correct. So, IMO, my patch should be completely orthogonal to the
OPTIONAL keyword logic; Ninja doesn't care whether you have Fortran or
not, it just can't build it for you.
> We already treat unknown extensions like .txt files in most cases, so
> this would have to be specific to languages that were OPTIONAL and failed
> to be enabled.
Hrm. Yeah, that could be tricky.
--Ben
More information about the cmake-developers
mailing list