Skip to content

Commit 92c131a

Browse files
author
Jaroslaw Kubik
committed
Force the OSX compatibility level
We are building mac binaries on modern M1 macs. In order to make sure that the binaries produced are still usable on older systems, we need to enforce desired compatibility level. Now we are producing binaries which should be compatible with at least OSX 10.13 (x86_64) and OSX 11.0 (arm64). CCISSUE: SQUISH-14692
1 parent c05c95e commit 92c131a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

conanfile.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,17 @@ def buildFor(self, arch, prefix):
104104
cmd += ' --extra-cxxflags=-m32'
105105
cmd += ' --extra-ldflags=-m32'
106106

107-
if self.settings.os == 'Macos' and arch == 'x86_64':
108-
cmd += ' --extra-cflags=--target=x86_64-apple-darwin17.7.0'
109-
cmd += ' --extra-cxxflags=--target=x86_64-apple-darwin17.7.0'
110-
cmd += ' --extra-ldflags=--target=x86_64-apple-darwin17.7.0'
107+
if self.settings.os == 'Macos':
108+
if arch == 'x86_64':
109+
compatFlags = '--target=x86_64-apple-darwin17.7.0 -mmacosx-version-min=10.13'
110+
elif arch == 'armv8':
111+
compatFlags = '--target=arm64-apple-darwin20.5.0 -mmacosx-version-min=11.0'
112+
else:
113+
raise Exception('Unsupported architecture: %s' % arch)
114+
115+
cmd += ' "--extra-cflags=%s"' % compatFlags
116+
cmd += ' "--extra-cxxflags=%s"' % compatFlags
117+
cmd += ' "--extra-ldflags=%s"' % compatFlags
111118

112119
self.run(cmd)
113120

0 commit comments

Comments
 (0)