summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2019-04-13 15:14:59 +0200
committerJan Ekström <jeebjp@gmail.com>2019-07-21 18:13:07 +0300
commitbc014f2ad43d476730261d181475ec60e9dcdbae (patch)
treef6ccaf8bcfd0dbe1aa4551dd99b3975ed0453f9b
parentf7f5bd80bb92d3c91eb3650b49f1a556a5f6c7f4 (diff)
downloadmpv-bc014f2ad43d476730261d181475ec60e9dcdbae.tar.bz2
mpv-bc014f2ad43d476730261d181475ec60e9dcdbae.tar.xz
build: add all configure flags as conditional flags to Swift compiler
-rw-r--r--waftools/generators/headers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/waftools/generators/headers.py b/waftools/generators/headers.py
index 84f914c2c1..55db354aab 100644
--- a/waftools/generators/headers.py
+++ b/waftools/generators/headers.py
@@ -10,6 +10,15 @@ def __write_config_h__(ctx):
__cp_to_variant__(ctx, ctx.options.variant, 'config.h')
ctx.end_msg("config.h", "PINK")
+def __add_swift_defines__(ctx):
+ if ctx.dependency_satisfied("swift"):
+ ctx.start_msg("Adding conditional Swift flags:")
+ from waflib.Tools.c_config import DEFKEYS, INCKEYS
+ for define in ctx.env[DEFKEYS]:
+ if ctx.is_defined(define) and ctx.get_define(define) == "1":
+ ctx.env.SWIFT_FLAGS.extend(["-D", define])
+ ctx.end_msg("yes")
+
# Approximately escape the string as C string literal
def __escape_c_string(s):
return s.replace("\"", "\\\"").replace("\n", "\\n")
@@ -32,4 +41,5 @@ def __add_mpv_defines__(ctx):
def configure(ctx):
__add_mpv_defines__(ctx)
+ __add_swift_defines__(ctx)
__write_config_h__(ctx)