Skip to content

Commit 4cd2f81

Browse files
committed
For Intel Mac OS target version 10.14
This is the latest Mac OS that supports 32 bit binaries so some people as staying on it. This should resolve #321
1 parent c057b94 commit 4cd2f81

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build.sbt

+5-3
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ jniGccFlags := (
8282
jniGccFlags.value.filterNot(_ == "-fPIC") ++
8383
Seq("-D_JNI_IMPLEMENTATION_", "-Wl,--kill-at",
8484
"-static-libgcc", "-Wl,--version-script=" + PWD + "/libzstd-jni.so.map")
85-
else if (System.getProperty("os.name").toLowerCase startsWith "mac")
85+
else if (System.getProperty("os.name").toLowerCase startsWith "mac") {
86+
// For intel, target the latest version that supported 32bit binaries
87+
val target = if (System.getProperty("os.arch") == "x86_64") Seq("-mmacosx-version-min=10.14") else Seq()
8688
// MacOS uses clang that does not support the "-static-libgcc" and version scripts,
8789
// but visibility can be modified by `-exported_symbols_list`
88-
jniGccFlags.value ++ Seq("-exported_symbols_list", PWD + "/libzstd-jni.so.exported")
89-
else
90+
jniGccFlags.value ++ Seq("-exported_symbols_list", PWD + "/libzstd-jni.so.exported") ++ target
91+
} else
9092
// the default is compilation with GCC
9193
jniGccFlags.value ++ Seq(
9294
"-static-libgcc", "-Wl,--version-script=" + PWD + "/libzstd-jni.so.map")

0 commit comments

Comments
 (0)