mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-29 12:54:35 +00:00
f4cef87edf
* Add git-based build information for better issue tracking * macOS fix * "build (hash)" and "CMAKE_SOURCE_DIR" changes * Redo "CMAKE_CURRENT_SOURCE_DIR" and clearer build messages * Fix conditional dependency on missing target * Broke out build-info.cmake, added find_package fallback, and added build into to all examples, added dependencies to Makefile * 4 space indenting for cmake, attempt to clean up my mess in Makefile * Short hash, less fancy Makefile, and don't modify build-info.h if it wouldn't change it
23 lines
423 B
Bash
Executable File
23 lines
423 B
Bash
Executable File
#!/bin/sh
|
|
|
|
BUILD_NUMBER="0"
|
|
BUILD_COMMIT="unknown"
|
|
|
|
REV_LIST=$(git rev-list --count HEAD)
|
|
if [ $? -eq 0 ]; then
|
|
BUILD_NUMBER=$REV_LIST
|
|
fi
|
|
|
|
REV_PARSE=$(git rev-parse --short HEAD)
|
|
if [ $? -eq 0 ]; then
|
|
BUILD_COMMIT=$REV_PARSE
|
|
fi
|
|
|
|
echo "#ifndef BUILD_INFO_H"
|
|
echo "#define BUILD_INFO_H"
|
|
echo ""
|
|
echo "#define BUILD_NUMBER $BUILD_NUMBER"
|
|
echo "#define BUILD_COMMIT \"$BUILD_COMMIT\""
|
|
echo ""
|
|
echo "#endif // BUILD_INFO_H"
|