mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Parse odin version date out of HEAD commit if available
This commit is contained in:
+6
-2
@@ -6,7 +6,6 @@ set -eu
|
||||
: ${LDFLAGS=}
|
||||
: ${LLVM_CONFIG=}
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DODIN_VERSION_RAW=\"dev-$(date +"%Y-%m")\""
|
||||
CXXFLAGS="$CXXFLAGS -std=c++14"
|
||||
DISABLED_WARNINGS="-Wno-switch -Wno-macro-redefined -Wno-unused-value"
|
||||
LDFLAGS="$LDFLAGS -pthread -lm"
|
||||
@@ -15,8 +14,12 @@ OS_NAME="$(uname -s)"
|
||||
|
||||
if [ -d ".git" ] && [ -n "$(command -v git)" ]; then
|
||||
GIT_SHA=$(git show --pretty='%h' --no-patch --no-notes HEAD)
|
||||
GIT_DATE=$(git show "--pretty=%cd" "--date=format:%Y-%m" --no-patch --no-notes HEAD)
|
||||
CPPFLAGS="$CPPFLAGS -DGIT_SHA=\"$GIT_SHA\""
|
||||
else
|
||||
GIT_DATE=$(date +"%Y-%m")
|
||||
fi
|
||||
CPPFLAGS="$CPPFLAGS -DODIN_VERSION_RAW=\"dev-$GIT_DATE\""
|
||||
|
||||
error() {
|
||||
printf "ERROR: %s\n" "$1"
|
||||
@@ -158,7 +161,8 @@ build_odin() {
|
||||
}
|
||||
|
||||
run_demo() {
|
||||
./odin run examples/demo -vet -strict-style -- Hellope World
|
||||
#./odin run examples/demo -vet -strict-style -- Hellope World
|
||||
./odin report
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user