summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-01-31 23:30:10 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-12 04:49:15 -0800
commit235eb60671c899d55b1174043940763b250fa3b8 (patch)
treeb4e046dd8476feda4d034f925f73d5b0678881c8
parentabf2efb107f7bee329dfd0c89573f70bc4bd7c69 (diff)
downloadmpv-235eb60671c899d55b1174043940763b250fa3b8.tar.bz2
mpv-235eb60671c899d55b1174043940763b250fa3b8.tar.xz
build: fix linking to dev SDK on macOS
on macOS mpv was linked to the system SDK which didn't cause any problems as long as the system SDK was the same as the dev SDK. though it started to cause linking warnings when a new xcode version with the SDK for the next macOS was installed. in the worst case it could also cause linking errors. to fix this we explicitly set the SDK path to the SDK that is used for building instead.
-rw-r--r--waftools/checks/custom.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
index 698742406f..3af9bdb921 100644
--- a/waftools/checks/custom.py
+++ b/waftools/checks/custom.py
@@ -92,6 +92,18 @@ def check_wl_protocols(ctx, dependency_identifier):
return ret
return fn(ctx, dependency_identifier)
+def _run(cmd):
+ from waflib import Utils
+ try:
+ cmd = Utils.subprocess.Popen(cmd,
+ stdout=Utils.subprocess.PIPE,
+ stderr=Utils.subprocess.PIPE,
+ shell=True)
+ output = cmd.stdout.read().strip()
+ return output
+ except Exception:
+ return ""
+
def check_cocoa(ctx, dependency_identifier):
fn = check_cc(
fragment = load_fragment('cocoa.m'),
@@ -100,7 +112,15 @@ def check_cocoa(ctx, dependency_identifier):
includes = ctx.srcnode.abspath(),
linkflags = '-fobjc-arc')
- return fn(ctx, dependency_identifier)
+ res = fn(ctx, dependency_identifier)
+ # on macOS we explicitly need to set the SDK path, otherwise it can lead to
+ # linking warnings or errors
+ if res:
+ ctx.env.append_value('LINKFLAGS', [
+ '-isysroot', '%s' % _run('xcrun --sdk macosx --show-sdk-path')
+ ])
+
+ return res
def check_openal(ctx, dependency_identifier):
checks = [