summaryrefslogtreecommitdiffstats
path: root/waftools
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-08-04 10:44:21 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-08-06 09:31:59 +0200
commit212374149f7c957ea25ea12404f92c625fdc211a (patch)
tree3438e2ef3a6735ebcb37e1d88d3ea77ac5133203 /waftools
parentc8cf864bfff3e56c45f129e9d825cb41d54a647e (diff)
downloadmpv-212374149f7c957ea25ea12404f92c625fdc211a.tar.bz2
mpv-212374149f7c957ea25ea12404f92c625fdc211a.tar.xz
build: expose waf variants to the user
This allows the user to execute multiple configuration and build steps. It can be used for several scenarios where you need different compiler flags.
Diffstat (limited to 'waftools')
-rw-r--r--waftools/generators/headers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/waftools/generators/headers.py b/waftools/generators/headers.py
index b38fcb88f4..bd28befd99 100644
--- a/waftools/generators/headers.py
+++ b/waftools/generators/headers.py
@@ -1,3 +1,9 @@
+def __cp_to_variant__(ctx, variant, basename):
+ src = ctx.bldnode.search(basename).read()
+ node = ctx.bldnode.make_node("{0}/{1}".format(variant, basename))
+ node.parent.mkdir()
+ node.write(src)
+
def __get_version__(ctx):
import subprocess
process = subprocess.Popen(["sh", "./version.sh", "--print"],
@@ -17,6 +23,7 @@ def __get_build_date__():
def __write_config_h__(ctx):
ctx.start_msg("Writing configuration header:")
ctx.write_config_header('config.h')
+ __cp_to_variant__(ctx, ctx.options.variant, 'config.h')
ctx.end_msg("config.h", "PINK")
def __write_version_h__(ctx):
@@ -25,6 +32,7 @@ def __write_version_h__(ctx):
ctx.define("VERSION", ctx.env.VERSION)
ctx.define("BUILDDATE", __get_build_date__())
ctx.write_config_header("version.h")
+ __cp_to_variant__(ctx, ctx.options.variant, 'version.h')
ctx.end_msg("version.h", "PINK")
def __add_mplayer_defines__(ctx):