mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-23 22:41:05 +01:00
builds: clean version makers a bit
This commit is contained in:
parent
483ee87498
commit
25b95c61ae
@ -96,9 +96,9 @@ if(WIN32)
|
||||
if(MSVC)
|
||||
file(TO_NATIVE_PATH "${VGM_BINARY_DIR}/version.h" VERSION_H_PATH)
|
||||
add_custom_command(OUTPUT ${VGM_BINARY_DIR}/version.h
|
||||
COMMAND "${VGM_SOURCE_DIR}/version.bat"
|
||||
COMMAND "${VGM_SOURCE_DIR}/version-make.bat"
|
||||
ARGS ${VERSION_H_PATH}
|
||||
DEPENDS ${VGM_SOURCE_DIR}/version.bat)
|
||||
DEPENDS ${VGM_SOURCE_DIR}/version-make.bat)
|
||||
add_custom_target(version_h DEPENDS ${VGM_BINARY_DIR}/version.h)
|
||||
else()
|
||||
find_package(Git)
|
||||
|
8
Makefile
8
Makefile
@ -4,9 +4,9 @@
|
||||
|
||||
ifeq ($(VGMSTREAM_VERSION),)
|
||||
# for current dir (expanded later)
|
||||
VGMSTREAM_VERSION_CURR=`./version.sh`
|
||||
VGMSTREAM_VERSION_CURR=`./version-get.sh`
|
||||
# for subdirs (expanded later)
|
||||
VGMSTREAM_VERSION_PREV=`../version.sh`
|
||||
VGMSTREAM_VERSION_PREV=`../version-get.sh`
|
||||
else
|
||||
VGMSTREAM_VERSION_CURR=$(VGMSTREAM_VERSION)
|
||||
VGMSTREAM_VERSION_PREV=$(VGMSTREAM_VERSION)
|
||||
@ -183,8 +183,8 @@ sourceball:
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION_CURR)/
|
||||
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION_CURR).zip master
|
||||
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION_CURR)/version.sh
|
||||
echo "echo \"$(VGMSTREAM_VERSION_CURR)\"" >> vgmstream-$(VGMSTREAM_VERSION_CURR)/version.sh
|
||||
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
||||
echo "echo \"$(VGMSTREAM_VERSION_CURR)\"" >> vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
||||
tar cvzf "vgmstream-$(VGMSTREAM_VERSION_CURR).tar.gz" vgmstream-$(VGMSTREAM_VERSION_CURR)/*
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||
|
||||
|
@ -27,7 +27,7 @@ sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $AUDACIOUS_HDRS/g" ./audacious/Makefile
|
||||
|
||||
# get version to show in about dialogs
|
||||
# again, not very pretty
|
||||
VGMSTREAM_VERSION=`./version.sh`
|
||||
VGMSTREAM_VERSION=`./version-get.sh`
|
||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./audacious/Makefile.autotools.am
|
||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./cli/Makefile.autotools.am
|
||||
|
||||
|
@ -88,7 +88,7 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
@ -116,7 +116,7 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
|
@ -88,7 +88,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
@ -118,7 +118,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
|
0
version.sh → version-get.sh
Executable file → Normal file
0
version.sh → version-get.sh
Executable file → Normal file
@ -23,7 +23,7 @@ for /f %%v in ('git describe --always') do set version=%%v
|
||||
if not "%version%"=="" set version=!version:^:=_!
|
||||
if not "%version%"=="" goto :got_version
|
||||
|
||||
echo Git version cannot be found, can't autogenerate version.h
|
||||
echo Git version not found, can't autogenerate version.h
|
||||
goto :exit
|
||||
|
||||
|
21
version-make.sh
Normal file
21
version-make.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# make current git version (overwrites version.h)
|
||||
VERSION_NAME=VGMSTREAM_VERSION
|
||||
VERSION_FILE=version.h
|
||||
|
||||
|
||||
# test if git exists
|
||||
if ! command -v git > /dev/null ; then
|
||||
VERSION=""
|
||||
else
|
||||
VERSION=$(git describe --always 2>&1 | tr : _ )
|
||||
fi
|
||||
|
||||
|
||||
# ignore git stderr "fatal:*" or blank
|
||||
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
||||
echo "#define $VERSION_NAME \"$VERSION\" /* autogenerated */" > $VERSION_FILE
|
||||
else
|
||||
echo "Git version not found, can't autogenerate version.h"
|
||||
fi;
|
@ -89,7 +89,7 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
@ -119,7 +119,7 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
|
@ -77,7 +77,7 @@
|
||||
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
@ -107,7 +107,7 @@
|
||||
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||
<Command>"$(ProjectDir)..\version-make.bat"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Generating version</Message>
|
||||
|
Loading…
Reference in New Issue
Block a user