Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,20 @@ fi
comp+=("$CPPFLAGS")

# hash all of our data
prehash="$CC ${comp[@]}" # compiler + flags and files
prehash=
argsprehash="$CC"
for f in "${comp[@]}"; do
[ -f "$f" ] && prehash+="$f $(cpp "$f" 2>&1)"
if [ -f "$f" ]; then
prehash+=$($hash_func < "$f" | cut -d' ' -f1 2>&1)
else
# Skip any empty args resulting from extra spaces
[ "$f" == "" ] && continue
argsprehash+="$f"
fi
done

prehash+=$($hash_func <<< "$argsprehash" | cut -d' ' -f1 2>&1)

# hash everything into one unique identifier, for caching purposes
id="c$("$hash_func" <<< "$prehash" | cut -d' ' -f1)"
tmpdir="$tmproot/$id.src"
Expand Down