From b930c1519fd9d93969206676d87405b775bab556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 16 Oct 2013 13:27:40 +0200 Subject: [PATCH] nif: add support for CFLAGS --- mix.exs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mix.exs b/mix.exs index 44a8f11..ffa470c 100644 --- a/mix.exs +++ b/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))