update make-build.sh to change meson.build version

This commit is contained in:
Kirk Klobe 2023-03-23 07:55:03 -05:00
parent 0e11b40bb2
commit 70afa6c62c
No known key found for this signature in database
GPG Key ID: D108BA1448B0AB7F
2 changed files with 15 additions and 0 deletions

2
extra/make-build.sh Normal file → Executable file
View File

@ -3,6 +3,8 @@
rm -rf tracy-build
mkdir tracy-build
./update-meson-version.sh
if [ ! -f vswhere.exe ]; then
wget https://github.com/microsoft/vswhere/releases/download/2.8.4/vswhere.exe
fi

13
extra/update-meson-version.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
version_header="../public/common/TracyVersion.hpp"
major=$(grep -o -E 'Major = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
minor=$(grep -o -E 'Minor = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
patch=$(grep -o -E 'Patch = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
version="${major}.${minor}.${patch}"
# the extension is required for macOS's outdated sed
sed -i.bak "s/version: '[0-9]*\.[0-9]*\.[0-9]*'/version: '$version'/g" ../meson.build
rm ../meson.build.bak