mac 上的 VLC 编译找不到 MacOSX.sdk

VLC compile on mac can't find MacOSX.sdk

关注 VLC macOSCompile wiki 页面。使用单个命令构建说明。我是 运行 10.14.6,带有 Xcode 11.3.1 命令行工具,开发人员签名等

重要说明 -- 我的 MacOSX.sdk 文件位于此处: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

通过构建创建 makefile 一切顺利,完成 bootstrap 并运行 make。然后我收到以下错误信息——如何将 VLC 指向我的 MacOSX.sdk 文件所在的位置?

IOW 如何设置 vlc 的 "contrib environment"?

请注意下面的代码片段,contrib 将 MacOSX.sdk 文件指针设置为错误的位置 - 我该如何解决?

我需要在 vlc 源中编辑一些东西吗?谢谢。错误:

Setting base environment
Using VLC root dir /Users/GR99/temp/VLC/vlc and triplet x86_64-apple-darwin18
[build] Checking for python3 ...
Python 3.8.1
[build] Building in "/Users/GR99/temp/VLC/vlc/build"
[build] Building building tools
You are ready to build VLC and its contribs
Setting symbol environment
Setting contrib environment with minimum macOS version 10.11 and SDK /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
[build] Building contribs
Packages licensing...    GPL version 3
Creating makefile...
Bootstrap completed.
Run "make" to start compilation.

....

make: Nothing to be done for `fetch'.
make: `.gettext' is up to date.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
# Build Sparkle and change the @rpath
cd sparkle && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.sparkle] Error 64
make: *** [.breakpad] Error 64
make: Target `all' not remade because of errors.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.breakpad] Error 64

比照:../extras/package/macosx/build.sh -h
它说:

usage: extras/package/macosx/build.sh [options]

Build vlc in the current directory

OPTIONS:
   -h            Show some help
   -q            Be quiet
   -j            Force number of cores to be used
   -r            Rebuild everything (tools, contribs, vlc)
   -c            Recompile contribs from sources
   -p            Build packages for all artifacts
   -i <n|u>      Create an installable package (n: nightly, u: unsigned stripped release archive)
   -k <sdk>      Use the specified sdk (default: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk)
   -a <arch>     Use the specified arch (default: x86_64)
   -C            Use the specified VLC build dir
   -b <url>      Enable breakpad support and send crash reports to this URL
   -d            Disable debug mode (on by default)

您的构建命令还应包括使用 -k 选项的 SDK 的位置:

../extras/package/macosx/build.sh -c -k /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

script 否则使用xcrun --show-sdk-path 设置SDK。 xcrun 使用环境变量 $SDKROOT.

注意:您可能想要安装和使用版本控制的 SDK,例如在您的问题中,输出显示它的目标是最低 El Capitan/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk 版本化的 SDK 在旧 Xcode 和 github.

上可用

设置 "contrib environment" 全部由 "single command" 处理。