sylefeb / Silice

Silice is an easy-to-learn, powerful hardware description language, that simplifies designing hardware algorithms with parallelism and pipelines.
Other
1.3k stars 78 forks source link

Versioning #226

Open sylefeb opened 2 years ago

sylefeb commented 2 years ago

A versioning approach needs to be defined:

trabucayre commented 2 years ago

Hi. maybe adding, in compile_silice_linux.sh, something like do the job:

BRANCH=$(git branch --show-current)
if [ $BRANCH == "master" ]; then
    GIT_VERS=$(git describe --tags)
else
    GIT_VERS="$BRANCH-$(git rev-parse --short $(git branch --show-current))"
fi
cmake -DGIT_VERS=$GIT_VERS -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../..

Ok it's linux only but a similar piece of code may works for others OS.