fix: fix for building

This commit is contained in:
2026-07-17 12:04:07 +02:00
parent 8fe18d108f
commit e4fa61ae07

18
mix.exs
View File

@@ -2,6 +2,8 @@ defmodule BDS.MixProject do
use Mix.Project use Mix.Project
def project do def project do
ensure_xla_compiler_flags()
[ [
app: :bds, app: :bds,
version: "0.1.0", version: "0.1.0",
@@ -15,6 +17,22 @@ defmodule BDS.MixProject do
] ]
end end
# XLA 0.9.x headers (pulled by exla) illegally specialize `std::is_signed`,
# which Apple clang 17+/libc++ rejects with a hard `-Winvalid-specialization`
# error, breaking the exla NIF build. Disable just that diagnostic on macOS so
# the C++ compile succeeds. Guarded to Darwin so the Linux/gcc build path is
# untouched. Appends rather than overwrites any CFLAGS the caller already set.
defp ensure_xla_compiler_flags do
if :os.type() == {:unix, :darwin} do
flag = "-Wno-invalid-specialization"
current = System.get_env("CFLAGS", "")
unless String.contains?(current, flag) do
System.put_env("CFLAGS", String.trim(flag <> " " <> current))
end
end
end
def application do def application do
[ [
extra_applications: [:logger, :wx, :ssl], extra_applications: [:logger, :wx, :ssl],