@@ -88,6 +88,17 @@ def compileStaticLib
88
88
args := #["rcs" , libFile.toString] ++ oFiles.map toString
89
89
}
90
90
91
+ private def getMacOSXDeploymentEnv : BaseIO (String × Option String) := do
92
+ -- It is difficult to identify the correct minor version here, leading to linking warnings like:
93
+ -- `ld64.lld: warning: /usr/lib/system/libsystem_kernel.dylib has version 13.5.0, which is newer than target minimum of 13.0.0`
94
+ -- In order to suppress these we set the MACOSX_DEPLOYMENT_TARGET variable into the far future.
95
+ if System.Platform.isOSX then
96
+ match (← IO.getEnv "MACOSX_DEPLOYMENT_TARGET" ) with
97
+ | some _ => return #[]
98
+ | none => return #[("MACOSX_DEPLOYMENT_TARGET" , some "99.0" )]
99
+ else
100
+ return #[]
101
+
91
102
def compileSharedLib
92
103
(libFile : FilePath) (linkArgs : Array String)
93
104
(linker : FilePath := "cc" )
@@ -96,6 +107,7 @@ def compileSharedLib
96
107
proc {
97
108
cmd := linker.toString
98
109
args := #["-shared" , "-o" , libFile.toString] ++ linkArgs
110
+ env := ← getMacOSXDeploymentEnv
99
111
}
100
112
101
113
def compileExe
@@ -106,16 +118,7 @@ def compileExe
106
118
proc {
107
119
cmd := linker.toString
108
120
args := #["-o" , binFile.toString] ++ linkFiles.map toString ++ linkArgs
109
- env := ← do
110
- -- It is difficult to identify the correct minor version here, leading to linking warnings like:
111
- -- `ld64.lld: warning: /usr/lib/system/libsystem_kernel.dylib has version 13.5.0, which is newer than target minimum of 13.0.0`
112
- -- In order to suppress these we set the MACOSX_DEPLOYMENT_TARGET variable into the far future.
113
- if System.Platform.isOSX then
114
- match (← IO.getEnv "MACOSX_DEPLOYMENT_TARGET" ) with
115
- | some _ => pure #[]
116
- | none => pure #[("MACOSX_DEPLOYMENT_TARGET" , some "99.0" )]
117
- else
118
- pure #[]
121
+ env := ← getMacOSXDeploymentEnv
119
122
}
120
123
121
124
/-- Download a file using `curl`, clobbering any existing file. -/
0 commit comments