2017-10-24 13:39:54 +02:00
|
|
|
{ stdenv, lib }:
|
|
|
|
|
|
|
|
let inherit (lib) optional; in
|
|
|
|
|
|
|
|
{ debug }:
|
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
let
|
|
|
|
args_ = {
|
|
|
|
|
|
|
|
qmakeFlags =
|
|
|
|
(args.qmakeFlags or [])
|
|
|
|
++ optional (debug != null)
|
|
|
|
(if debug then "CONFIG+=debug" else "CONFIG+=release");
|
|
|
|
|
|
|
|
cmakeFlags =
|
|
|
|
(args.cmakeFlags or [])
|
|
|
|
++ [ "-DBUILD_TESTING=OFF" ]
|
|
|
|
++ optional (debug != null)
|
|
|
|
(if debug then "-DCMAKE_BUILD_TYPE=Debug"
|
|
|
|
else "-DCMAKE_BUILD_TYPE=Release");
|
|
|
|
|
2017-11-10 16:23:13 +01:00
|
|
|
enableParallelBuilding = args.enableParallelBuilding or true;
|
2017-10-24 13:39:54 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation (args // args_)
|