minor clean up
This commit is contained in:
parent
116ac11652
commit
dec97eb3e9
@ -77,6 +77,7 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
targetIsJSON = stdenv.lib.hasSuffix ".json" target;
|
targetIsJSON = stdenv.lib.hasSuffix ".json" target;
|
||||||
|
useSysroot = targetIsJSON && !__internal_dontAddSysroot;
|
||||||
|
|
||||||
# see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168
|
# see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168
|
||||||
# the "${}" is needed to transform the path into a /nix/store path before baseNameOf
|
# the "${}" is needed to transform the path into a /nix/store path before baseNameOf
|
||||||
@ -202,8 +203,8 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // {
|
|||||||
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
|
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
|
||||||
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
||||||
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
||||||
${stdenv.lib.optionalString
|
${stdenv.lib.optionalString useSysroot
|
||||||
(targetIsJSON && !__internal_dontAddSysroot) "RUSTFLAGS=\"--sysroot ${sysroot} $RUSTFLAGS\" "
|
"RUSTFLAGS=\"--sysroot ${sysroot} $RUSTFLAGS\" "
|
||||||
}cargo build -j $NIX_BUILD_CORES \
|
}cargo build -j $NIX_BUILD_CORES \
|
||||||
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
||||||
--target ${target} \
|
--target ${target} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user