qmake: Select debug or release build
The qmake hook sets its own `CONFIG+=debug` or `CONFIG+=release` depending on how `qtbase` was built. We no longer rely on using the custom deriver for this feature.
This commit is contained in:
parent
c49c0928ed
commit
b80ce0aeca
@ -197,6 +197,7 @@ let
|
|||||||
qmake = makeSetupHook {
|
qmake = makeSetupHook {
|
||||||
deps = [ self.qtbase.dev ];
|
deps = [ self.qtbase.dev ];
|
||||||
substitutions = {
|
substitutions = {
|
||||||
|
inherit debug;
|
||||||
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
||||||
};
|
};
|
||||||
} ../hooks/qmake-hook.sh;
|
} ../hooks/qmake-hook.sh;
|
||||||
|
@ -199,6 +199,7 @@ let
|
|||||||
qmake = makeSetupHook {
|
qmake = makeSetupHook {
|
||||||
deps = [ self.qtbase.dev ];
|
deps = [ self.qtbase.dev ];
|
||||||
substitutions = {
|
substitutions = {
|
||||||
|
inherit debug;
|
||||||
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
||||||
};
|
};
|
||||||
} ../hooks/qmake-hook.sh;
|
} ../hooks/qmake-hook.sh;
|
||||||
|
@ -179,6 +179,7 @@ let
|
|||||||
qmake = makeSetupHook {
|
qmake = makeSetupHook {
|
||||||
deps = [ self.qtbase.dev ];
|
deps = [ self.qtbase.dev ];
|
||||||
substitutions = {
|
substitutions = {
|
||||||
|
inherit debug;
|
||||||
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
|
||||||
};
|
};
|
||||||
} ../hooks/qmake-hook.sh;
|
} ../hooks/qmake-hook.sh;
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
qmakeFlags=( ${qmakeFlags-} )
|
qmakeFlags=( ${qmakeFlags-} )
|
||||||
|
|
||||||
qmakePrePhase() {
|
qmakePrePhase() {
|
||||||
|
qmakeFlags_orig=( "${qmakeFlags[@]}" )
|
||||||
|
|
||||||
|
# These flags must be added _before_ the flags specified in the derivation.
|
||||||
qmakeFlags=( \
|
qmakeFlags=( \
|
||||||
"PREFIX=$out" \
|
"PREFIX=$out" \
|
||||||
"NIX_OUTPUT_OUT=$out" \
|
"NIX_OUTPUT_OUT=$out" \
|
||||||
@ -11,8 +14,15 @@ qmakePrePhase() {
|
|||||||
"NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
|
"NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
|
||||||
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
|
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
|
||||||
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}" \
|
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}" \
|
||||||
"${qmakeFlags[@]}" \
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if [ -n "@debug@" ]; then
|
||||||
|
qmakeFlags+=( "CONFIG+=debug" )
|
||||||
|
else
|
||||||
|
qmakeFlags+=( "CONFIG+=release" )
|
||||||
|
fi
|
||||||
|
|
||||||
|
qmakeFlags+=( "${qmakeFlags_orig[@]}" )
|
||||||
}
|
}
|
||||||
prePhases+=" qmakePrePhase"
|
prePhases+=" qmakePrePhase"
|
||||||
|
|
||||||
|
@ -9,9 +9,6 @@ args:
|
|||||||
let
|
let
|
||||||
args_ = {
|
args_ = {
|
||||||
|
|
||||||
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
|
|
||||||
++ (args.qmakeFlags or []);
|
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = toString (
|
NIX_CFLAGS_COMPILE = toString (
|
||||||
optional (!debug) "-DQT_NO_DEBUG"
|
optional (!debug) "-DQT_NO_DEBUG"
|
||||||
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
|
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
|
||||||
|
Loading…
Reference in New Issue
Block a user