-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): do not patch/rebuild tensorrt if not needed
- Loading branch information
1 parent
e726e94
commit bfd29ec
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
NAME=$1 | ||
PREFIX=$2 | ||
COMPLETION_STAMP=$3 | ||
SOURCE_POSTFIX=$4 | ||
BUILD_POSTFIX=$5 | ||
J=$6 | ||
CMAKE_COMMAND=$7 | ||
shift 7 | ||
ARGS=$@ | ||
[ -f "$COMPLETION_STAMP" ] && echo "$NAME" already built, not rebuilding && exit 0 | ||
echo "External build of : $NAME" | ||
echo "with prefix : $PREFIX" | ||
echo "completion stamp : $COMPLETION_STAMP" | ||
echo "source postfix : $SOURCE_POSTFIX" | ||
echo "build postfix : $BUILD_POSTFIX" | ||
echo "-j : $J" | ||
echo "CMAKE_COMMAND : $CMAKE_COMMAND" | ||
echo "additional args : $ARGS" | ||
$CMAKE_COMMAND -S $PREFIX/$SOURCE_POSTFIX -B $PREFIX/$BUILD_POSTFIX $ARGS | ||
make -C $PREFIX/$BUILD_POSTFIX -j$J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
NAME=$1 | ||
PREFIX=$2 | ||
DOWNLOAD_STAMP=$3 | ||
PATCH_STAMP=$4 | ||
SOURCE_LOCATION=$5 | ||
shift 5 | ||
PATCHES=$@ | ||
[ -f "$PREFIX/$DOWNLOAD_STAMP" ] && [ -f "$PREFIX//$PATCH_STAMP" ] && [ $(( $(stat -c %Y "$PREFIX/$PATCH_STAMP") - $(stat -c %Y "$PREFIX/$DOWNLOAD_STAMP") )) -ge 0 ] && echo "$NAME" already patched, skipping && exit 0 | ||
echo "External patch of : $NAME" | ||
echo "with prefix : $PREFIX" | ||
echo "download stamp : $DOWNLOAD_STAMP" | ||
echo "patch stamp : $PATCH_STAMP" | ||
echo "source location : $SOURCE_LOCATION" | ||
echo "patches : $PATCHES" | ||
cd $SOURCE_LOCATION | ||
git apply $PATCHES |