1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-29 11:12:56 +00:00

build: fix configure on windows

configure failed because of a wrong check. fix the check and also only
check for swift on macOS.
This commit is contained in:
Akemi 2018-02-12 15:09:13 +01:00 committed by Kevin Mitchell
parent c5e4538bc4
commit 3f73520897

View File

@ -44,28 +44,29 @@ def __find_swift_library(ctx):
ctx.end_msg(swift_library)
__add_swift_library_linking_flags(ctx, swift_library)
return
ctx.end_msg(None, "RED")
ctx.end_msg(False)
def __find_macos_sdk(ctx):
ctx.start_msg('Checking for macOS SDK')
sdk = __run('xcrun --sdk macosx --show-sdk-path')
if sdk != "":
if sdk:
ctx.end_msg(sdk)
ctx.env.MACOS_SDK = sdk
else:
ctx.end_msg(None, "RED")
ctx.end_msg(False)
def __find_swift_compiler(ctx):
ctx.start_msg('Checking for swift (Swift compiler)')
swift = __run('xcrun -find swift')
if swift != "":
if swift:
ctx.end_msg(swift)
ctx.env.SWIFT = swift
__add_swift_flags(ctx)
__find_swift_library(ctx)
else:
ctx.end_msg(None, "RED")
ctx.end_msg(False)
def configure(ctx):
__find_macos_sdk(ctx)
__find_swift_compiler(ctx)
if ctx.env.DEST_OS == "darwin":
__find_macos_sdk(ctx)
__find_swift_compiler(ctx)