Commit d4c673a9 authored by Raito Bezarius's avatar Raito Bezarius
Browse files

build-support/meson: explicitly use ambiant CMake during cross compilation



Thanks to Qyriad, it was found out that Nixpkgs was unable to cross
compile when CMake was needed at cross compilation time with Meson
because Meson refuse to use the ambiant CMake.

A simple fix is to always provide the ambiant CMake and trust the
packager to pass the right CMake, otherwise the rest of the build would
probably fail in mysterious ways.

An example of package that required this fix is the Lix, a Nix
implementation, that uses `toml11` discovered via CMake during the Meson
configure phase.

Co-authored-by: default avatarQyriad <qyriad@qyriad.me>
Signed-off-by: default avatarRaito Bezarius <masterancpp@gmail.com>
parent 4f554f0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ let
    [binaries]
    llvm-config = 'llvm-config-native'
    rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}']
    # Meson refuses to consider any CMake binary during cross compilation if it's
    # not explicitly specified here, in the cross file.
    # https://github.com/mesonbuild/meson/blob/0ed78cf6fa6d87c0738f67ae43525e661b50a8a2/mesonbuild/cmake/executor.py#L72
    cmake = 'cmake'
  '';

  crossFlags = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ];