Skip to content

Commit

Permalink
use checkout specific commit of amalgamate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetyusufoglu committed Dec 6, 2024
1 parent b78fd8b commit 7c7e34b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion script/create-single-header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
workingcopy_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )/.."
dst=${1:-$workingcopy_dir/single-header/include/alpaka/alpaka.hpp}
tmp_dir=$(mktemp -d)
git clone https://github.com/shrpnsld/amalgamate.git --depth 1 $tmp_dir/clone
# clone amalgamate into $tmp_dir/clone and checkout to a specific commit
current_dir=$(pwd) # Save the current directory
commit_hash="a4796f0515fbc56d375a5013dd9004605df9c761"
git clone https://github.com/shrpnsld/amalgamate.git --depth 1 "$tmp_dir/clone" &&
cd "$tmp_dir/clone" &&
git fetch --depth 1 origin "$commit_hash" &&
git checkout "$commit_hash"
cd "$current_dir"
#run amalgamate command to create header file
$tmp_dir/clone/amalgamate -o $tmp_dir -v -a -n 'alpaka' -I $workingcopy_dir/include -- $workingcopy_dir/include/alpaka/alpaka.hpp
mv $tmp_dir/alpaka-amalgamated/alpaka.hpp $dst
rm -rf $tmp_dir

0 comments on commit 7c7e34b

Please sign in to comment.