75ca762b89
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
35 lines
736 B
Bash
35 lines
736 B
Bash
declare -a cargoBuildFlags
|
|
|
|
cargoBuildHook() {
|
|
echo "Executing cargoBuildHook"
|
|
|
|
runHook preBuild
|
|
|
|
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
|
pushd "${buildAndTestSubdir}"
|
|
fi
|
|
|
|
(
|
|
set -x
|
|
env \
|
|
"CC_@rustBuildPlatform@=@ccForBuild@" \
|
|
"CXX_@rustBuildPlatform@=@cxxForBuild@" \
|
|
"CC_@rustTargetPlatform@=@ccForHost@" \
|
|
"CXX_@rustTargetPlatform@=@cxxForHost@" \
|
|
cargo build -j $NIX_BUILD_CORES \
|
|
--target @rustTargetPlatformSpec@ \
|
|
--frozen \
|
|
--${cargoBuildType} \
|
|
${cargoBuildFlags}
|
|
)
|
|
|
|
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
|
popd
|
|
fi
|
|
|
|
runHook postBuild
|
|
|
|
echo "Finished cargoBuildHook"
|
|
}
|
|
|
|
buildPhase=cargoBuildHook
|