nif: add support for CFLAGS
This commit is contained in:
6
mix.exs
6
mix.exs
@@ -51,6 +51,12 @@ defmodule Mix.Tasks.Compile.Nif do
|
||||
exts = Keyword.get(config, :exts, [:c])
|
||||
compiler = Keyword.get(config, :compilers, ["cc", "gcc", "clang"]) |> find_compiler
|
||||
|
||||
if cflags = System.get_env("CFLAGS") do
|
||||
# FIXME: this isn't going to work too well with quoted spaces
|
||||
# inside arguments
|
||||
flags = [flags, String.split(cflags)]
|
||||
end
|
||||
|
||||
# Create the directory (e.g. "priv/")
|
||||
File.mkdir_p!(Path.dirname(file))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user