2017-10-24 13:39:54 +02:00
|
|
|
{ stdenv, lib }:
|
|
|
|
|
|
|
|
let inherit (lib) optional; in
|
|
|
|
|
|
|
|
{ debug }:
|
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
let
|
|
|
|
args_ = {
|
|
|
|
|
|
|
|
qmakeFlags =
|
|
|
|
(args.qmakeFlags or [])
|
2018-01-19 14:59:17 +01:00
|
|
|
++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ];
|
2017-10-24 13:39:54 +02:00
|
|
|
|
2018-01-19 14:50:54 +01:00
|
|
|
NIX_CFLAGS_COMPILE =
|
2018-01-19 14:59:17 +01:00
|
|
|
optional (!debug) "-DQT_NO_DEBUG"
|
|
|
|
++ lib.toList (args.NIX_CFLAGS_COMPILE or []);
|
2018-01-02 14:16:38 +01:00
|
|
|
|
2017-10-24 13:39:54 +02:00
|
|
|
cmakeFlags =
|
|
|
|
(args.cmakeFlags or [])
|
2018-01-19 14:59:17 +01:00
|
|
|
++ [
|
|
|
|
"-DBUILD_TESTING=OFF"
|
|
|
|
("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
|
|
|
|
];
|
2017-10-24 13:39:54 +02:00
|
|
|
|
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_)
|