Browse Source

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
Jonas Maebe 9 months ago
parent
commit
fd83bb10d4
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/systems/t_darwin.pas

+ 6 - 1
compiler/systems/t_darwin.pas

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