mirror of
https://github.com/mpv-player/mpv
synced 2025-01-20 06:11:10 +00:00
build: fix version.h creation
Previous code did not retrigger a relink when version.h changed since it didn't use a waf task.
This commit is contained in:
parent
4a4f788a68
commit
78e771554c
@ -11,7 +11,10 @@ for ac_option do
|
||||
extra="-$ac_arg"
|
||||
;;
|
||||
--versionh=*)
|
||||
version_h="$ac_arg"
|
||||
version_h="$(pwd)/$ac_arg"
|
||||
;;
|
||||
--cwd=*)
|
||||
cwd="$ac_arg"
|
||||
;;
|
||||
--print)
|
||||
print=yes
|
||||
@ -24,6 +27,10 @@ for ac_option do
|
||||
esac
|
||||
done
|
||||
|
||||
if test "$cwd" ; then
|
||||
cd "$cwd"
|
||||
fi
|
||||
|
||||
# Extract revision number from file used by daily tarball snapshots
|
||||
# or from "git describe" output
|
||||
git_revision=$(cat snapshot_version 2> /dev/null)
|
||||
|
14
wscript
14
wscript
@ -918,10 +918,16 @@ def configure(ctx):
|
||||
ctx.store_dependencies_lists()
|
||||
|
||||
def __write_version__(ctx):
|
||||
import subprocess
|
||||
subprocess.call(["sh", "./version.sh",
|
||||
"--versionh=" + ctx.bldnode.abspath() + "/version.h"],
|
||||
cwd=ctx.srcnode.abspath())
|
||||
ctx.env.VERSIONH_ST = '--versionh="%s"'
|
||||
ctx.env.CWD_ST = '--cwd="%s"'
|
||||
ctx.env.VERSIONSH_CWD = [ctx.srcnode.abspath()]
|
||||
|
||||
ctx(
|
||||
source = 'version.sh',
|
||||
target = 'version.h',
|
||||
rule = 'sh ${SRC} ${CWD_ST:VERSIONSH_CWD} ${VERSIONH_ST:TGT}',
|
||||
always = True,
|
||||
update_outputs = True)
|
||||
|
||||
def build(ctx):
|
||||
if ctx.options.variant not in ctx.all_envs:
|
||||
|
Loading…
Reference in New Issue
Block a user