fix: fix for building
This commit is contained in:
18
mix.exs
18
mix.exs
@@ -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],
|
||||||
|
|||||||
Reference in New Issue
Block a user