浏览代码

macOS: use -macos_version_min for recent versions

-macosx_version_min was renamed. Ideally we would base this on the version of
the toolset used, but we don't know that. Instead, use it when targeting
more recent macOS versions

(cherry picked from commit fd83bb10d4b3c1bc30cf3a72cd419882b63b561a)
Jonas Maebe 10 月之前
父节点
当前提交
2789efa067
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      compiler/systems/t_darwin.pas

+ 6 - 1
compiler/systems/t_darwin.pas

@@ -348,7 +348,12 @@ implementation
       begin
         if MacOSXVersionMin<>'' then
           begin
-            result:='-macosx_version_min '+MacOSXVersionMin;
+           { This does not depend on the target version but on the toolchain
+             version, but we only know the former and not the latter }
+           if CompareVersionStrings(MacOSXVersionMin,'11.0') >= 0 then
+             result:='-macosx_version_min '+MacOSXVersionMin
+           else
+             result:='-macos_version_min '+MacOSXVersionMin;
           end
         else if iPhoneOSVersionMin<>'' then
           begin