And*_*eas 32 macos gcc backwards-compatibility
我经常需要定位比我当前运行的版本更旧的Mac OS X版本.由于我更喜欢使用bash shell和Makefile,我不使用Xcode.Apple 明确支持定位较旧的OS X版本,但我一直对通常用于定位旧平台的两个配置步骤的冗余感到困惑:
gcc开始使用--macosx-version-min:
gcc --mmacosx-version-min=10.6 ....
Run Code Online (Sandbox Code Playgroud)该MACOSX_DEPLOYMENT_TARGET环境变量设置为所需的平台,如
export MACOSX_DEPLOYMENT_TARGET=10.6
Run Code Online (Sandbox Code Playgroud)当试图通过搜索找出两者之间的实际差异时,你会得到不同的答案.有些人说他们完全一样,所以只需要使用其中一个.但是,也有声音表明有必要同时执行这两项操作:启动gcc --macosx-version-min 并设置环境变量.
这两件事完全一样吗?是否只需要使用其中一个而不是两个?某处有官方文件吗?Apple提到MACOSX_DEPLOYMENT_TARGET但根本没有提及--macosx-version-min,尽管它似乎更常见.
And*_*eas 34
Mac OS X上的gcc手册页说它们是同义词:
Run Code Online (Sandbox Code Playgroud)-mmacosx-version-min=version The earliest version of MacOS X that this executable will run on is version. Typical values of version include 10.1, 10.2, and 10.3.9. This value can also be set with the MACOSX_DEPLOYMENT_TARGET environment variable. If both the command-line option is specified and the environment variable is set, the command-line option will take precedence.
请记住,苹果将默认编译器更改为 clang。目前 clang 尝试将 gcc 标志翻译为他自己的标志。但它并没有覆盖100%。-mmacosx-version-min因此,有一天可能会停止工作。
| 归档时间: |
|
| 查看次数: |
15783 次 |
| 最近记录: |