Skip to content

Commit

Permalink
For Intel Mac OS target version 10.14
Browse files Browse the repository at this point in the history
This is the latest Mac OS that supports 32 bit binaries so some people
as staying on it.

This should resolve #321
  • Loading branch information
luben committed Jul 19, 2024
1 parent c057b94 commit 4cd2f81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ jniGccFlags := (
jniGccFlags.value.filterNot(_ == "-fPIC") ++
Seq("-D_JNI_IMPLEMENTATION_", "-Wl,--kill-at",
"-static-libgcc", "-Wl,--version-script=" + PWD + "/libzstd-jni.so.map")
else if (System.getProperty("os.name").toLowerCase startsWith "mac")
else if (System.getProperty("os.name").toLowerCase startsWith "mac") {
// For intel, target the latest version that supported 32bit binaries
val target = if (System.getProperty("os.arch") == "x86_64") Seq("-mmacosx-version-min=10.14") else Seq()
// MacOS uses clang that does not support the "-static-libgcc" and version scripts,
// but visibility can be modified by `-exported_symbols_list`
jniGccFlags.value ++ Seq("-exported_symbols_list", PWD + "/libzstd-jni.so.exported")
else
jniGccFlags.value ++ Seq("-exported_symbols_list", PWD + "/libzstd-jni.so.exported") ++ target
} else
// the default is compilation with GCC
jniGccFlags.value ++ Seq(
"-static-libgcc", "-Wl,--version-script=" + PWD + "/libzstd-jni.so.map")
Expand Down

0 comments on commit 4cd2f81

Please sign in to comment.