Felipe97/llama-cpp-compiled
01.2k
1#!/bin/sh2 3CC=$14 5build_number="0"6build_commit="unknown"7build_compiler="unknown"8build_target="unknown"9 10if out=$(git rev-list --count HEAD); then11 # git is broken on WSL so we need to strip extra newlines12 build_number=$(printf '%s' "$out" | tr -d '\n')13fi14 15if out=$(git rev-parse --short HEAD); then16 build_commit=$(printf '%s' "$out" | tr -d '\n')17fi18 19if out=$($CC --version | head -1); then20 build_compiler=$out21fi22 23if out=$($CC -dumpmachine); then24 build_target=$out25fi26 27echo "int LLAMA_BUILD_NUMBER = ${build_number};"28echo "char const *LLAMA_COMMIT = \"${build_commit}\";"29echo "char const *LLAMA_COMPILER = \"${build_compiler}\";"30echo "char const *LLAMA_BUILD_TARGET = \"${build_target}\";"31 